]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add powernow dual core oops fix, fwd from gentoo via daniel drake
authorChris Wright <chrisw@osdl.org>
Sun, 31 Jul 2005 05:14:15 +0000 (22:14 -0700)
committerChris Wright <chrisw@osdl.org>
Sun, 31 Jul 2005 05:14:15 +0000 (22:14 -0700)
queue/powernow-dual-core-amd-oops.patch [new file with mode: 0644]
queue/series

diff --git a/queue/powernow-dual-core-amd-oops.patch b/queue/powernow-dual-core-amd-oops.patch
new file mode 100644 (file)
index 0000000..f404b2a
--- /dev/null
@@ -0,0 +1,64 @@
+From stable-bounces@linux.kernel.org  Sat Jul 30 13:30:11 2005
+Date: Sat, 30 Jul 2005 21:30:30 +0100
+From: Daniel Drake <dsd@gentoo.org>
+To: stable@kernel.org
+Cc: davej@redhat.com
+Subject: [PATCH] Fix powernow oops on dual-core athlon
+
+From: Dave Jones <davej@redhat.com>
+Date: Thu, 28 Jul 2005 16:38:21 +0000 (-0700)
+Subject: powernow-k8 requires that a data structure for
+X-Git-Tag: v2.6.13-rc4
+X-Git-Url: http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=03938c3f1062b0f279a0ef937a471d4db83702ed
+
+powernow-k8 requires that a data structure for
+each core be created in the _cpu_init function
+call.  The cpufreq infrastructure doesn't call
+_cpu_init for the second core in each processor.
+Some systems crashed when _get was called with
+an odd-numbered core because it tried to
+dereference a NULL pointer since the data
+structure had not been created.
+
+The attached patch solves the problem by
+initializing data structures for all shared
+cores in the _cpu_init function.  It should
+apply to 2.6.12-rc6 and has been tested by
+AMD and Sun.
+
+Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
+Signed-off-by: Dave Jones <davej@redhat.com>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+
+--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
++++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+@@ -44,7 +44,7 @@
+ #define PFX "powernow-k8: "
+ #define BFX PFX "BIOS error: "
+-#define VERSION "version 1.40.2"
++#define VERSION "version 1.40.4"
+ #include "powernow-k8.h"
+ /* serialize freq changes  */
+@@ -978,7 +978,7 @@ static int __init powernowk8_cpu_init(st
+ {
+       struct powernow_k8_data *data;
+       cpumask_t oldmask = CPU_MASK_ALL;
+-      int rc;
++      int rc, i;
+       if (!check_supported_cpu(pol->cpu))
+               return -ENODEV;
+@@ -1064,7 +1064,9 @@ static int __init powernowk8_cpu_init(st
+       printk("cpu_init done, current fid 0x%x, vid 0x%x\n",
+              data->currfid, data->currvid);
+-      powernow_data[pol->cpu] = data;
++      for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
++              powernow_data[i] = data;
++      }
+       return 0;
index 9fe9903c7bf92f0359697f173f75d186f778ce1f..fd15318f32c7f6541d52422c0bf04637fb07f7ef 100644 (file)
@@ -10,3 +10,4 @@ ipsec-array-overflow.patch
 bio_clone-fix.patch
 sys_get_thread_area-leak.patch
 early-vlan-fix.patch
+powernow-dual-core-amd-oops.patch