powernow-k7: Work when kernel is compiled for SMP
PATCH 3/15 powernow-k7: Work when kernel is compiled for SMP
On a UP system with SMP compiled kernel, the powernow-k7 module would not initialize (returned -ENODEV). Not sure why policy->cpu != 0 for UP systems, but since policy->cpu isn't used anywhere, just check for num_cpus in the system, and fail of it's > 1.
---
arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
a1418b50daac86ff02e0d7a4cba6185a452ca393
arch/i386/kernel/cpu/cpufreq/powernow-k7.c +6 -4
@@ -576,9 +576,6 @@ static int __init powernow_cpu_init (strunion msr_fidvidstatus fidvidstatus;int result; -if (policy->cpu !=0 ) -return -ENODEV ; -rdmsrl (MSR_K7_FID_VID_STATUS , fidvidstatus.val);/* recalibrate cpu_khz */
@@ -664,8 +661,13 @@ static struct cpufreq_driver powernow_drstatic int __init powernow_init (void ) { -if (check_powernow ()==0 ) +/* Does not support multi-cpu systems */ +if (num_online_cpus () !=1 ||num_possible_cpus () !=1 )return -ENODEV ; + +if (check_powernow () ==0 ) +return -ENODEV ; +return cpufreq_register_driver (&powernow_driver); }
Signature · 1 line
1.0.5
Quoted 4 lines · Ben Collins
On a UP system with SMP compiled kernel, the powernow-k7 module would not initialize (returned
-ENODEV). Not sure whypolicy->cpu!= 0 for UPSigned-off-by Ben Collins <[email protected]>
May the smp_processor_id() be != 0 on _true_ UP on SMP? What happens if (using virtual CPU hotplug) the module is modprobe'd with one CPU online, and then the second CPU becomes online later?
Dominik
Quoted 9 lines · Dominik Brodowski
Quoted 4 lines · Ben Collins
On a UP system with SMP compiled kernel, the powernow-k7 module would not initialize (returned
-ENODEV). Not sure whypolicy->cpu!= 0 for UPSigned-off-by Ben Collins <[email protected]>May the
smp_processor_id()be != 0 on _true_ UP on SMP? What happens if (using virtual CPU hotplug) the module is modprobe'd with one CPU online, and then the second CPU becomes online later?
That's why there is num_possible_cpus() checked aswell. That's supposed to report possible hotplug cpu's, even if not plugged, correct?
Signature · 3 lines
Ben Collins <[email protected]> Developer Ubuntu Linux
Quoted 5 lines · Ben Collins
Quoted 4 lines · Dominik Brodowski
Quoted 3 lines · Ben Collins
On a UP system with SMP compiled kernel, the powernow-k7 module would not initialize (returned
-ENODEV). Not sure whypolicy->cpu!= 0 for UP
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Ben Collins <[email protected]>May the
smp_processor_id()be != 0 on _true_ UP on SMP? What happens if (using virtual CPU hotplug) the module is modprobe'd with one CPU online, and then the second CPU becomes online later?That's why there is
num_possible_cpus()checked aswell. That's supposed to report possible hotplug cpu's, even if not plugged, correct?
Yes, sure. Sorry...
Dominik