[PATCH] powerpc: enable NAP only on cpus who support it to avoid memory corruption
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sat, 11 Mar 2006 23:55:01 +0000 (10:55 +1100)
committerPaul Mackerras <paulus@samba.org>
Thu, 16 Mar 2006 05:55:02 +0000 (16:55 +1100)
This patch fixes incorrect setting of powersave_nap to 1 on all
PowerMacs, potentially causing memory corruption on some models. This
bug was introuced by me during the 32/64 bits merge.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/powermac/feature.c
arch/powerpc/platforms/powermac/setup.c

index 34714d3ea69a1f4ffb3d05247a858e3daf5a9626..bbe794891a2076c22dc7b361b79b95451b0b6f1a 100644 (file)
@@ -2491,9 +2491,7 @@ found:
                        pmac_mb.model_id = PMAC_TYPE_COMET;
                iounmap(mach_id_ptr);
        }
-#endif /* CONFIG_POWER4 */
 
-#ifdef CONFIG_6xx
        /* Set default value of powersave_nap on machines that support it.
         * It appears that uninorth rev 3 has a problem with it, we don't
         * enable it on those. In theory, the flush-on-lock property is
@@ -2522,10 +2520,11 @@ found:
         * NAP mode
         */
        powersave_lowspeed = 1;
-#endif /* CONFIG_6xx */
-#ifdef CONFIG_POWER4
+
+#else /* CONFIG_POWER4 */
        powersave_nap = 1;
-#endif
+#endif  /* CONFIG_POWER4 */
+
        /* Check for "mobile" machine */
        if (model && (strncmp(model, "PowerBook", 9) == 0
                   || strncmp(model, "iBook", 5) == 0))
index 1955462f4082fa01cb19785dd5b60a5c00cf592f..29c2946f1c77e5f00dfb68fd686221d37b7f36f4 100644 (file)
@@ -621,10 +621,6 @@ static void __init pmac_init_early(void)
        /* Probe motherboard chipset */
        pmac_feature_init();
 
-       /* We can NAP */
-       powersave_nap = 1;
-       printk(KERN_INFO "Using native/NAP idle loop\n");
-
        /* Initialize debug stuff */
        udbg_scc_init(!!strstr(cmd_line, "sccdbg"));
        udbg_adb_init(!!strstr(cmd_line, "btextdbg"));