Revert "cpufreq: ondemand: Don't synchronize sample rate unless mulitple cpus present"
[firefly-linux-kernel-4.4.55.git] / drivers / cpufreq / cpufreq_ondemand.c
index 071699de50eef68a56e586224ccbe1d07e319011..8fb07103628c9d0e68ae3d2507bf3982bc7dcf49 100644 (file)
 
 #define DEF_FREQUENCY_DOWN_DIFFERENTIAL                (10)
 #define DEF_FREQUENCY_UP_THRESHOLD             (80)
+#ifdef CONFIG_ARCH_RK29
+#define MICRO_FREQUENCY_DOWN_DIFFERENTIAL      (10)
+#define MICRO_FREQUENCY_UP_THRESHOLD           (80)
+#else
 #define MICRO_FREQUENCY_DOWN_DIFFERENTIAL      (3)
 #define MICRO_FREQUENCY_UP_THRESHOLD           (95)
+#endif
 #define MICRO_FREQUENCY_MIN_SAMPLE_RATE                (10000)
 #define MIN_FREQUENCY_UP_THRESHOLD             (11)
 #define MAX_FREQUENCY_UP_THRESHOLD             (100)
@@ -111,7 +116,11 @@ static struct dbs_tuners {
 } dbs_tuners_ins = {
        .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
        .down_differential = DEF_FREQUENCY_DOWN_DIFFERENTIAL,
+#ifdef CONFIG_ARCH_RK29
+       .ignore_nice = 1,
+#else
        .ignore_nice = 0,
+#endif
        .powersave_bias = 0,
 };
 
@@ -133,9 +142,9 @@ static inline cputime64_t get_cpu_idle_time_jiffy(unsigned int cpu,
 
        idle_time = cputime64_sub(cur_wall_time, busy_time);
        if (wall)
-               *wall = cur_wall_time;
+               *wall = (cputime64_t)jiffies_to_usecs(cur_wall_time);
 
-       return idle_time;
+       return (cputime64_t)jiffies_to_usecs(idle_time);
 }
 
 static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)