Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq

* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
[CPUFREQ] powernow-k8.c: fix a check-after-use
[CPUFREQ] Remove duplicate check in powernow-k8
[CPUFREQ] drivers/cpufreq/cpufreq.c: static functions mustn't be exported
[CPUFREQ] If max_freq got reduced (e.g. by _PPC) a write to sysfs scaling_governor let cpufreq core stuck at low max_freq for ever
[CPUFREQ] x86_64: Proper null pointer check in powernow_k8_get
[CPUFREQ] x86_64: Revert earlier powernow-k8 change
[CPUFREQ] Update LART site URL
[CPUFREQ] Remove pointless check in conservative governor.
[CPUFREQ] trailing whitespace removal de-jour.
[CPUFREQ] extra debugging in cpufreq_add_dev()

+27 -18
+1 -1
Documentation/cpu-freq/index.txt
··· 53 53 * http://lists.linux.org.uk/mailman/listinfo/cpufreq 54 54 55 55 Clock and voltage scaling for the SA-1100: 56 - * http://www.lart.tudelft.nl/projects/scaling 56 + * http://www.lartmaker.nl/projects/scaling
+5 -5
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
··· 905 905 { 906 906 cpumask_t oldmask = CPU_MASK_ALL; 907 907 struct powernow_k8_data *data = powernow_data[pol->cpu]; 908 - u32 checkfid = data->currfid; 909 - u32 checkvid = data->currvid; 908 + u32 checkfid; 909 + u32 checkvid; 910 910 unsigned int newstate; 911 911 int ret = -EIO; 912 912 913 913 if (!data) 914 914 return -EINVAL; 915 + 916 + checkfid = data->currfid; 917 + checkvid = data->currvid; 915 918 916 919 /* only run on specific CPU from here on */ 917 920 oldmask = current->cpus_allowed; ··· 1108 1105 unsigned int khz = 0; 1109 1106 1110 1107 data = powernow_data[first_cpu(cpu_core_map[cpu])]; 1111 - 1112 - if (!data) 1113 - return -EINVAL; 1114 1108 1115 1109 if (!data) 1116 1110 return -EINVAL;
+1 -1
drivers/cpufreq/Kconfig
··· 99 99 Enable this cpufreq governor when you either want to set the 100 100 CPU frequency manually or when an userspace program shall 101 101 be able to set the CPU dynamically, like on LART 102 - <http://www.lart.tudelft.nl/> 102 + <http://www.lartmaker.nl/>. 103 103 104 104 For details, take a look at <file:Documentation/cpu-freq/>. 105 105
+18 -7
drivers/cpufreq/cpufreq.c
··· 319 319 } 320 320 return -EINVAL; 321 321 } 322 - EXPORT_SYMBOL_GPL(cpufreq_parse_governor); 323 322 324 323 325 324 /* drivers/base/cpu.c */ ··· 345 346 show_one(scaling_max_freq, max); 346 347 show_one(scaling_cur_freq, cur); 347 348 349 + static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy); 350 + 348 351 /** 349 352 * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access 350 353 */ ··· 365 364 if (ret != 1) \ 366 365 return -EINVAL; \ 367 366 \ 368 - ret = cpufreq_set_policy(&new_policy); \ 367 + mutex_lock(&policy->lock); \ 368 + ret = __cpufreq_set_policy(policy, &new_policy); \ 369 + policy->user_policy.object = policy->object; \ 370 + mutex_unlock(&policy->lock); \ 369 371 \ 370 372 return ret ? ret : count; \ 371 373 } ··· 424 420 if (cpufreq_parse_governor(str_governor, &new_policy.policy, &new_policy.governor)) 425 421 return -EINVAL; 426 422 427 - ret = cpufreq_set_policy(&new_policy); 423 + /* Do not use cpufreq_set_policy here or the user_policy.max 424 + will be wrongly overridden */ 425 + mutex_lock(&policy->lock); 426 + ret = __cpufreq_set_policy(policy, &new_policy); 427 + 428 + policy->user_policy.policy = policy->policy; 429 + policy->user_policy.governor = policy->governor; 430 + mutex_unlock(&policy->lock); 431 + 428 432 return ret ? ret : count; 429 433 } 430 434 ··· 697 685 if (!cpu_online(j)) 698 686 continue; 699 687 700 - dprintk("CPU already managed, adding link\n"); 688 + dprintk("CPU %u already managed, adding link\n", j); 701 689 cpufreq_cpu_get(cpu); 702 690 cpu_sys_dev = get_cpu_sysdev(j); 703 691 sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, ··· 707 695 policy->governor = NULL; /* to assure that the starting sequence is 708 696 * run in cpufreq_set_policy */ 709 697 mutex_unlock(&policy->lock); 710 - 698 + 711 699 /* set default policy */ 712 - 713 700 ret = cpufreq_set_policy(&new_policy); 714 701 if (ret) { 715 702 dprintk("setting policy failed\n"); ··· 718 707 module_put(cpufreq_driver->owner); 719 708 dprintk("initialization complete\n"); 720 709 cpufreq_debug_enable_ratelimit(); 721 - 710 + 722 711 return 0; 723 712 724 713
+2 -4
drivers/cpufreq/cpufreq_conservative.c
··· 176 176 ret = sscanf (buf, "%u", &input); 177 177 178 178 mutex_lock(&dbs_mutex); 179 - if (ret != 1 || input > 100 || input < 0 || 180 - input <= dbs_tuners_ins.down_threshold) { 179 + if (ret != 1 || input > 100 || input <= dbs_tuners_ins.down_threshold) { 181 180 mutex_unlock(&dbs_mutex); 182 181 return -EINVAL; 183 182 } ··· 195 196 ret = sscanf (buf, "%u", &input); 196 197 197 198 mutex_lock(&dbs_mutex); 198 - if (ret != 1 || input > 100 || input < 0 || 199 - input >= dbs_tuners_ins.up_threshold) { 199 + if (ret != 1 || input > 100 || input >= dbs_tuners_ins.up_threshold) { 200 200 mutex_unlock(&dbs_mutex); 201 201 return -EINVAL; 202 202 }