]> git.hungrycats.org Git - linux/commitdiff
[ALPHA] Convert DEBUG_MCHECK define to runtime variable.
authorRichard Henderson <rth@kanga.twiddle.home>
Sat, 16 Aug 2003 18:06:37 +0000 (11:06 -0700)
committerRichard Henderson <rth@kanga.twiddle.home>
Sat, 16 Aug 2003 18:06:37 +0000 (11:06 -0700)
From Jay Estabrook <Jay.Estabrook@compaq.com>.

arch/alpha/Kconfig
arch/alpha/kernel/core_cia.c
arch/alpha/kernel/core_lca.c
arch/alpha/kernel/core_t2.c
arch/alpha/kernel/err_titan.c
arch/alpha/kernel/irq_alpha.c
arch/alpha/kernel/proto.h
arch/alpha/kernel/setup.c

index e63b35d5c019fec5ec59b7cfcf7c573d58b71b11..1124b016ce5535ac9afb5e78ed07fff927d36898 100644 (file)
@@ -556,6 +556,24 @@ config ALPHA_LARGE_VMALLOC
 config VERBOSE_MCHECK
        bool "Verbose Machine Checks"
 
+config VERBOSE_MCHECK_ON
+       int "Verbose Printing Mode (0=off, 1=on, 2=all)"
+       depends on VERBOSE_MCHECK
+       default 1
+       ---help---
+         This option allows the default printing mode to be set, and then
+         possibly overridden by a boot command argument.
+
+         For example, if one wanted the option of printing verbose
+         machine checks, but wanted the default to be as if verbose
+         machine check printing was turned off, then one would choose
+         the printing mode to be 0. Then, upon reboot, one could add
+         the boot command line "verbose_mcheck=1" to get the normal
+         verbose machine check printing, or "verbose_mcheck=2" to get
+         the maximum information available.
+
+         Take the default (1) unless you want more control or more info.
+
 source "drivers/pci/Kconfig"
 source "drivers/eisa/Kconfig"
 
index 54d7a6c31e76c209e895691492e3ea186948e481..459e209e9e40da0c126959e7216739befeff5646 100644 (file)
@@ -1099,7 +1099,8 @@ cia_decode_parity_error(struct el_CIA_sysdata_mcheck *cia)
        printk(KERN_CRIT "  Command: %s, Parity bit: %d\n", cmd, par);
        printk(KERN_CRIT "  Address: %#010lx, Mask: %#lx\n", addr, mask);
 }
-#endif
+#endif /* CONFIG_VERBOSE_MCHECK */
+
 
 static int
 cia_decode_mchk(unsigned long la_ptr)
@@ -1114,6 +1115,9 @@ cia_decode_mchk(unsigned long la_ptr)
                return 0;
 
 #ifdef CONFIG_VERBOSE_MCHECK
+       if (!alpha_verbose_mcheck)
+               return 1;
+
        switch (ffs(cia->cia_err & 0xfff) - 1) {
        case 0: /* CIA_ERR_COR_ERR */
                cia_decode_ecc_error(cia, "Corrected ECC error");
@@ -1186,7 +1190,7 @@ cia_decode_mchk(unsigned long la_ptr)
        if (cia->cia_err & CIA_ERR_LOST_IOA_TIMEOUT)
                printk(KERN_CRIT "CIA lost machine check: "
                       "I/O timeout\n");
-#endif
+#endif /* CONFIG_VERBOSE_MCHECK */
 
        return 1;
 }
index 7f8768ff9d00dd76dbac4a200436d28340f99f58..41c05ba20ba6baf5ad0f08607c9eadca3a513423 100644 (file)
@@ -460,8 +460,8 @@ lca_machine_check(unsigned long vector, unsigned long la_ptr,
        }
 
        /* Dump the logout area to give all info.  */
-#if DEBUG_MCHECK > 1
-       {
+#ifdef CONFIG_VERBOSE_MCHECK
+       if (alpha_verbose_mcheck > 1) {
                unsigned long * ptr = (unsigned long *) la_ptr;
                long i;
                for (i = 0; i < el.c->size / sizeof(long); i += 2) {
@@ -469,7 +469,7 @@ lca_machine_check(unsigned long vector, unsigned long la_ptr,
                               i*sizeof(long), ptr[i], ptr[i+1]);
                }
        }
-#endif
+#endif /* CONFIG_VERBOSE_MCHECK */
 }
 
 /*
index 0054ae2fc3c33f844392e51173976f22bb3a29e0..e028ecf0ad4bde38fb1a5a35b41ab8c178a3685c 100644 (file)
@@ -557,9 +557,9 @@ t2_machine_check(unsigned long vector, unsigned long la_ptr,
                 struct pt_regs * regs)
 {
        int cpu = smp_processor_id();
-#if DEBUG_MCHECK > 0
+#ifdef CONFIG_VERBOSE_MCHECK
        struct el_common *mchk_header = (struct el_common *)la_ptr;
-#endif /* DEBUG_MCHECK */
+#endif
 
        /* Clear the error before any reporting.  */
        mb();
@@ -580,39 +580,45 @@ t2_machine_check(unsigned long vector, unsigned long la_ptr,
                 *
                 * Just dismiss it for now on this CPU...
                 */
-#if DEBUG_MCHECK > 0
-               printk("t2_machine_check(cpu%d): any_expected 0x%x -"
-                       " (assumed) spurious -"
-                       " code 0x%x\n", cpu, t2_mcheck_any_expected,
-                       (unsigned int)mchk_header->code);
-#endif /* DEBUG_MCHECK */
+#ifdef CONFIG_VERBOSE_MCHECK
+               if (alpha_verbose_mcheck > 1) {
+                       printk("t2_machine_check(cpu%d): any_expected 0x%x -"
+                              " (assumed) spurious -"
+                              " code 0x%x\n", cpu, t2_mcheck_any_expected,
+                              (unsigned int)mchk_header->code);
+               }
+#endif
                return;
        }
 
        if (!mcheck_expected(cpu) && !t2_mcheck_any_expected) {
                if (t2_mcheck_last_taken & (1 << cpu)) {
-#if DEBUG_MCHECK > 0
+#ifdef CONFIG_VERBOSE_MCHECK
+                   if (alpha_verbose_mcheck > 1) {
                        printk("t2_machine_check(cpu%d): last_taken 0x%x - "
                               "unexpected mcheck - code 0x%x\n",
                               cpu, t2_mcheck_last_taken,
                               (unsigned int)mchk_header->code);
-#endif /* DEBUG_MCHECK */
-                       t2_mcheck_last_taken = 0;
-                       mb();
-                       return;
+                   }
+#endif
+                   t2_mcheck_last_taken = 0;
+                   mb();
+                   return;
                } else {
                        t2_mcheck_last_taken = 0;
                        mb();
                }
        }
 
-#if DEBUG_MCHECK > 0
-       printk("%s t2_mcheck(cpu%d): last_taken 0x%x - "
-              "any_expected 0x%x - code 0x%x\n",
-              (mcheck_expected(cpu) ? "EX" : "UN"), cpu,
-              t2_mcheck_last_taken, t2_mcheck_any_expected,
-              (unsigned int)mchk_header->code);
-#endif /* DEBUG_MCHECK */
+#ifdef CONFIG_VERBOSE_MCHECK
+       if (alpha_verbose_mcheck > 1) {
+               printk("%s t2_mcheck(cpu%d): last_taken 0x%x - "
+                      "any_expected 0x%x - code 0x%x\n",
+                      (mcheck_expected(cpu) ? "EX" : "UN"), cpu,
+                      t2_mcheck_last_taken, t2_mcheck_any_expected,
+                      (unsigned int)mchk_header->code);
+       }
+#endif
 
        process_mcheck_info(vector, la_ptr, regs, "T2", mcheck_expected(cpu));
 }
index 8dab97547d67ab25ff02964ddee3f86203dc8065..505cdb3db1400a290da689b9cac621ed02fe9391 100644 (file)
@@ -438,8 +438,9 @@ titan_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs)
                       (unsigned int)vector, (int)smp_processor_id());
                
 #ifdef CONFIG_VERBOSE_MCHECK
-               titan_process_logout_frame(mchk_header, 1);
-               dik_show_regs(regs, NULL);
+               titan_process_logout_frame(mchk_header, alpha_verbose_mcheck);
+               if (alpha_verbose_mcheck)
+                       dik_show_regs(regs, NULL);
 #endif /* CONFIG_VERBOSE_MCHECK */
 
                err_print_prefix = saved_err_prefix;
index 0c2b0190db0fe219f3becd4bbaf719f4d7dec147..e6ded33c6e22c2904963c72f44d920393e252583 100644 (file)
@@ -130,9 +130,11 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
         * ignore it.
         */
 
-#if DEBUG_MCHECK > 0
-        printk(KERN_CRIT "%s machine check %s\n", machine,
-               expected ? "expected." : "NOT expected!!!");
+#ifdef CONFIG_VERBOSE_MCHECK
+       if (alpha_verbose_mcheck > 1) {
+               printk(KERN_CRIT "%s machine check %s\n", machine,
+                      expected ? "expected." : "NOT expected!!!");
+       }
 #endif
 
        if (expected) {
@@ -188,8 +190,8 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
 
        dik_show_regs(regs, NULL);
 
-#if DEBUG_MCHECK > 1
-       {
+#ifdef CONFIG_VERBOSE_MCHECK
+       if (alpha_verbose_mcheck > 1) {
                /* Dump the logout area to give all info.  */
                unsigned long *ptr = (unsigned long *)la_ptr;
                long i;
@@ -198,7 +200,7 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
                               i*sizeof(long), ptr[i], ptr[i+1]);
                }
        }
-#endif
+#endif /* CONFIG_VERBOSE_MCHECK */
 }
 
 /*
index 2320a47cef48a26d1cd7ca6c800ccc367c2a4113..6368af8b929916f01dd3357da7315d7a13cc461a 100644 (file)
@@ -110,6 +110,9 @@ extern unsigned long wildfire_node_mem_size(int);
 /* setup.c */
 extern unsigned long srm_hae;
 extern int boot_cpuid;
+#ifdef CONFIG_VERBOSE_MCHECK
+extern unsigned long alpha_verbose_mcheck;
+#endif
 
 /* srmcons.c */
 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM)
@@ -205,8 +208,6 @@ extern struct mcheck_info
 #define mcheck_extra(cpu)      ((void)(cpu), __mcheck_info.extra)
 #endif
 
-#define DEBUG_MCHECK 0          /* 0 = minimal, 1 = debug, 2 = debug+dump.  */
-
 extern void process_mcheck_info(unsigned long vector, unsigned long la_ptr,
                                struct pt_regs *regs, const char *machine,
                                int expected);
index 021c51c66b993baebc28a92b9546a8ef7f330ce5..0858e8a744136c42945552cdb6ea4e42d80ef18c 100644 (file)
@@ -63,6 +63,12 @@ static struct notifier_block alpha_panic_block = {
 struct hwrpb_struct *hwrpb;
 unsigned long srm_hae;
 
+#ifdef CONFIG_VERBOSE_MCHECK
+/* 0=minimum, 1=verbose, 2=all */
+/* These can be overridden via the command line, ie "verbose_mcheck=2") */
+unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON;
+#endif
+
 /* Which processor we booted from.  */
 int boot_cpuid;
 
@@ -538,6 +544,12 @@ setup_arch(char **cmdline_p)
                                get_mem_size_limit(p+9) << PAGE_SHIFT;
                        continue;
                }
+#ifdef CONFIG_VERBOSE_MCHECK
+               if (strncmp(p, "verbose_mcheck=", 15) == 0) {
+                       alpha_verbose_mcheck = simple_strtol(p+15, NULL, 0);
+                       continue;
+               }
+#endif
        }
 
        /* Replace the command line, now that we've killed it with strsep.  */
@@ -597,6 +609,38 @@ setup_arch(char **cmdline_p)
               var_name, alpha_mv.vector_name,
               (alpha_using_srm ? "SRM" : "MILO"));
 
+       printk("Major Options: "
+#ifdef CONFIG_SMP
+              "SMP "
+#endif
+#ifdef CONFIG_ALPHA_EV56
+              "EV56 "
+#endif
+#ifdef CONFIG_ALPHA_EV67
+              "EV67 "
+#endif
+#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS
+              "LEGACY_START "
+#endif
+#ifdef CONFIG_VERBOSE_MCHECK
+              "VERBOSE_MCHECK "
+#endif
+
+#ifdef CONFIG_DISCONTIGMEM
+              "DISCONTIGMEM "
+#ifdef CONFIG_NUMA
+              "NUMA "
+#endif
+#endif
+
+#ifdef CONFIG_DEBUG_SPINLOCK
+              "DEBUG_SPINLOCK "
+#endif
+#ifdef CONFIG_MAGIC_SYSRQ
+              "MAGIC_SYSRQ "
+#endif
+              "\n");
+
        printk("Command line: %s\n", command_line);
 
        /*