Skip to contentSkip to conversation

cpufreq: fix powernow-k8 load bug

PATCH In review Randy Dunlap 3 participants 8 messages Jun 21, 2006 – Jun 23, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: fix powernow-k8 load bug

Fix powernow-k8 doesn't load bug.
Reference: https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/35145

http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=dce0ca36f2ae348f005735e9acd400d2c0954421

---
 arch/i386/kernel/cpu/cpufreq/powernow-k8.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +1 -1
@@ -1008,7 +1008,7 @@ static int __cpuinit powernowk8_cpu_init
 		 * an UP version, and is deprecated by AMD.
 		 */
 
-		if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
+		if ((num_online_cpus() != 1)) {
 			printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
 			kfree(data);
 			return -ENODEV;
#2 lore raw
Quoted 7 lines · Dave Jones
Quoted 4 lines · Randy Dunlap

Fix powernow-k8 doesn't load bug.
Reference: https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/35145

http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=dce0ca36f2ae348f005735e9acd400d2c0954421

Already fixed in -git1

My bad, I mixed it up with the similar fix for powernow-k7. I'll queue this up tomorrow morning.

thanks,

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#3 lore raw
In reply to Randy Dunlap

Hi!

Quoted 15 lines

Fix powernow-k8 doesn't load bug.
Reference: https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/35145

http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=dce0ca36f2ae348f005735e9acd400d2c0954421

---
 arch/i386/kernel/cpu/cpufreq/powernow-k8.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

arch/i386/kernel/cpu/cpufreq/powernow-k8.c static int __cpuinit powernowk8_cpu_init · line 1014

Quoted 8 lines
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +1 -1
@@ -1008,7 +1008,7 @@ static int __cpuinit powernowk8_cpu_init
 		 * an UP version, and is deprecated by AMD.
 		 */
 
-		if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
+		if ((num_online_cpus() != 1)) {
 			printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
 			kfree(data);
 			return -ENODEV;

Seems wrong to me... what if I boot, then hotplug second cpu?

Signature · 1 line
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms         
#4 lore raw
Quoted 6 lines · Pavel Machek
Quoted 6 lines
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +0 -0
@@ -1008,7 +1008,7 @@ static int __cpuinit powernowk8_cpu_init
 		 * an UP version, and is deprecated by AMD.
 		 */
 
Quoted 8 lines

arch/i386/kernel/cpu/cpufreq/powernow-k8.c static int __cpuinit powernowk8_cpu_init · line 1014

Quoted 6 lines
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +1 -1
-		if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
+		if ((num_online_cpus() != 1)) {
 			printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
 			kfree(data);
 			return -ENODEV;

Seems wrong to me... what if I boot, then hotplug second cpu?

We only run this code if powernow_k8_cpu_init_acpi() has failed, which it should never do on an SMP system.

So, you get exactly the same behaviour, as expected. You can't support >1 CPU with PSB.

The above patch makes sure things continue to work if you run an SMP kernel on UP hardware.

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#5 lore raw

Hi!

Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +0 -0
@@ -1008,7 +1008,7 @@ static int __cpuinit powernowk8_cpu_init
 		 * an UP version, and is deprecated by AMD.
 		 */
 
Quoted 8 lines

arch/i386/kernel/cpu/cpufreq/powernow-k8.c static int __cpuinit powernowk8_cpu_init · line 1014

Quoted 6 lines
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +1 -1
-		if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
+		if ((num_online_cpus() != 1)) {
 			printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
 			kfree(data);
 			return -ENODEV;

Seems wrong to me... what if I boot, then hotplug second cpu?

Quoted 8 lines

We only run this code if powernow_k8_cpu_init_acpi() has failed, which it should never do on an SMP system.

So, you get exactly the same behaviour, as expected. You can't support >1 CPU with PSB.

The above patch makes sure things continue to work if you run an SMP kernel on UP hardware.

I'm pretty sure you'll find SMP machine with broken ACPI cpufreq (therefore cpu_init_acpi() will fail). And if user is perverse enough, he might boot with one cpu then simulate hotplug of second one.

OTOH:

1) user is already doing perverse things at this point

and

2) machine BIOS is b0rken

...so... it is only theoretical and probably not worth fixing.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw
Quoted 18 lines · Pavel Machek
Quoted 18 lines
Quoted 6 lines
Quoted 6 lines
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +0 -0
@@ -1008,7 +1008,7 @@ static int __cpuinit powernowk8_cpu_init
 		 * an UP version, and is deprecated by AMD.
 		 */
 
Quoted 8 lines

arch/i386/kernel/cpu/cpufreq/powernow-k8.c static int __cpuinit powernowk8_cpu_init · line 1014

Quoted 6 lines
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +1 -1
-		if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
+		if ((num_online_cpus() != 1)) {
 			printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
 			kfree(data);
 			return -ENODEV;

Seems wrong to me... what if I boot, then hotplug second cpu?

We only run this code if powernow_k8_cpu_init_acpi() has failed, which it should never do on an SMP system.

Quoted 8 lines
Quoted 5 lines

So, you get exactly the same behaviour, as expected. You can't support >1 CPU with PSB.

The above patch makes sure things continue to work if you run an SMP kernel on UP hardware.

I'm pretty sure you'll find SMP machine with broken ACPI cpufreq (therefore cpu_init_acpi() will fail).

So? It fails now, it'll fail after this patch. That's not the situation that this patch is changing.

If you have >1 CPU, you *must* have a working ACPI BIOS.

Quoted 9 lines

he might boot with one cpu then simulate hotplug of second one.

1) user is already doing perverse things at this point

and

2) machine BIOS is b0rken

...so... it is only theoretical and probably not worth fixing.

SMP kernel on UP hardware is not theoretical, and is worth fixing.

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#7 lore raw
Quoted 38 lines · Dave Jones
Quoted 18 lines · Pavel Machek
Quoted 18 lines
Quoted 6 lines
Quoted 6 lines
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +0 -0
@@ -1008,7 +1008,7 @@ static int __cpuinit powernowk8_cpu_init
 		 * an UP version, and is deprecated by AMD.
 		 */
 
Quoted 8 lines

arch/i386/kernel/cpu/cpufreq/powernow-k8.c static int __cpuinit powernowk8_cpu_init · line 1014

Quoted 6 lines
arch/i386/kernel/cpu/cpufreq/powernow-k8.c +1 -1
-		if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
+		if ((num_online_cpus() != 1)) {
 			printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
 			kfree(data);
 			return -ENODEV;

Seems wrong to me... what if I boot, then hotplug second cpu?

We only run this code if powernow_k8_cpu_init_acpi() has failed, which it should never do on an SMP system.

Quoted 8 lines
Quoted 5 lines

So, you get exactly the same behaviour, as expected. You can't support >1 CPU with PSB.

The above patch makes sure things continue to work if you run an SMP kernel on UP hardware.

I'm pretty sure you'll find SMP machine with broken ACPI cpufreq (therefore cpu_init_acpi() will fail).

So? It fails now, it'll fail after this patch. That's not the situation that this patch is changing.

If you have >1 CPU, you *must* have a working ACPI BIOS.

Quoted 4 lines

he might boot with one cpu then simulate hotplug of second one.

1) user is already doing perverse things at this point

Quoted 7 lines
Quoted 5 lines

and

2) machine BIOS is b0rken

...so... it is only theoretical and probably not worth fixing.

SMP kernel on UP hardware is not theoretical, and is worth fixing.

Problem _I_ pointed out is theoretical, so the patch is okay and sorry for the noise.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html