Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq: [CPUFREQ] use max load in conservative governor [CPUFREQ] fix a lockdep warning
···11131113 unsigned int cpu = sys_dev->id;11141114 unsigned long flags;11151115 struct cpufreq_policy *data;11161116+ struct kobject *kobj;11171117+ struct completion *cmp;11161118#ifdef CONFIG_SMP11171119 struct sys_device *cpu_sys_dev;11181120 unsigned int j;···11431141 dprintk("removing link\n");11441142 cpumask_clear_cpu(cpu, data->cpus);11451143 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);11461146- sysfs_remove_link(&sys_dev->kobj, "cpufreq");11441144+ kobj = &sys_dev->kobj;11471145 cpufreq_cpu_put(data);11481146 cpufreq_debug_enable_ratelimit();11491147 unlock_policy_rwsem_write(cpu);11481148+ sysfs_remove_link(kobj, "cpufreq");11501149 return 0;11511150 }11521151#endif···11841181 data->governor->name, CPUFREQ_NAME_LEN);11851182#endif11861183 cpu_sys_dev = get_cpu_sysdev(j);11871187- sysfs_remove_link(&cpu_sys_dev->kobj, "cpufreq");11841184+ kobj = &cpu_sys_dev->kobj;11851185+ unlock_policy_rwsem_write(cpu);11861186+ sysfs_remove_link(kobj, "cpufreq");11871187+ lock_policy_rwsem_write(cpu);11881188 cpufreq_cpu_put(data);11891189 }11901190 }···11981192 if (cpufreq_driver->target)11991193 __cpufreq_governor(data, CPUFREQ_GOV_STOP);1200119412011201- kobject_put(&data->kobj);11951195+ kobj = &data->kobj;11961196+ cmp = &data->kobj_unregister;11971197+ unlock_policy_rwsem_write(cpu);11981198+ kobject_put(kobj);1202119912031200 /* we need to make sure that the underlying kobj is actually12041201 * not referenced anymore by anybody before we proceed with12051202 * unloading.12061203 */12071204 dprintk("waiting for dropping of refcount\n");12081208- wait_for_completion(&data->kobj_unregister);12051205+ wait_for_completion(cmp);12091206 dprintk("wait complete\n");1210120712081208+ lock_policy_rwsem_write(cpu);12111209 if (cpufreq_driver->exit)12121210 cpufreq_driver->exit(data);12131213-12141211 unlock_policy_rwsem_write(cpu);1215121212161213 free_cpumask_var(data->related_cpus);
+6-2
drivers/cpufreq/cpufreq_conservative.c
···444444static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)445445{446446 unsigned int load = 0;447447+ unsigned int max_load = 0;447448 unsigned int freq_target;448449449450 struct cpufreq_policy *policy;···502501 continue;503502504503 load = 100 * (wall_time - idle_time) / wall_time;504504+505505+ if (load > max_load)506506+ max_load = load;505507 }506508507509 /*···515511 return;516512517513 /* Check for frequency increase */518518- if (load > dbs_tuners_ins.up_threshold) {514514+ if (max_load > dbs_tuners_ins.up_threshold) {519515 this_dbs_info->down_skip = 0;520516521517 /* if we are already at full speed then break out early */···542538 * can support the current CPU usage without triggering the up543539 * policy. To be safe, we focus 10 points under the threshold.544540 */545545- if (load < (dbs_tuners_ins.down_threshold - 10)) {541541+ if (max_load < (dbs_tuners_ins.down_threshold - 10)) {546542 freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100;547543548544 this_dbs_info->requested_freq -= freq_target;