]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/mm/pat.c
Merge branches 'x86/asm', 'x86/cleanups', 'x86/cpudetect', 'x86/debug', 'x86/doc...
[linux-2.6-omap-h63xx.git] / arch / x86 / mm / pat.c
index 7b61036427df69d11a33044d60bc85102931e385..9127e31c726866d462d0da61d03ceade383ced4e 100644 (file)
@@ -30,7 +30,7 @@
 #ifdef CONFIG_X86_PAT
 int __read_mostly pat_enabled = 1;
 
-void __cpuinit pat_disable(char *reason)
+void __cpuinit pat_disable(const char *reason)
 {
        pat_enabled = 0;
        printk(KERN_INFO "%s\n", reason);
@@ -42,6 +42,11 @@ static int __init nopat(char *str)
        return 0;
 }
 early_param("nopat", nopat);
+#else
+static inline void pat_disable(const char *reason)
+{
+       (void)reason;
+}
 #endif
 
 
@@ -78,16 +83,20 @@ void pat_init(void)
        if (!pat_enabled)
                return;
 
-       /* Paranoia check. */
-       if (!cpu_has_pat && boot_pat_state) {
-               /*
-                * If this happens we are on a secondary CPU, but
-                * switched to PAT on the boot CPU. We have no way to
-                * undo PAT.
-                */
-               printk(KERN_ERR "PAT enabled, "
-                      "but not supported by secondary CPU\n");
-               BUG();
+       if (!cpu_has_pat) {
+               if (!boot_pat_state) {
+                       pat_disable("PAT not supported by CPU.");
+                       return;
+               } else {
+                       /*
+                        * If this happens we are on a secondary CPU, but
+                        * switched to PAT on the boot CPU. We have no way to
+                        * undo PAT.
+                        */
+                       printk(KERN_ERR "PAT enabled, "
+                              "but not supported by secondary CPU\n");
+                       BUG();
+               }
        }
 
        /* Set PWT to Write-Combining. All other bits stay the same */