Commit 0f6f2c78 authored by Richard Henderson's avatar Richard Henderson

[ALPHA] Convert DEBUG_MCHECK define to runtime variable.

From Jay Estabrook <Jay.Estabrook@compaq.com>.
parent 789448b7
......@@ -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"
......
......@@ -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;
}
......
......@@ -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 */
}
/*
......
......@@ -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,23 +580,27 @@ t2_machine_check(unsigned long vector, unsigned long la_ptr,
*
* Just dismiss it for now on this CPU...
*/
#if DEBUG_MCHECK > 0
#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 /* DEBUG_MCHECK */
}
#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 */
}
#endif
t2_mcheck_last_taken = 0;
mb();
return;
......@@ -606,13 +610,15 @@ t2_machine_check(unsigned long vector, unsigned long la_ptr,
}
}
#if DEBUG_MCHECK > 0
#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 /* DEBUG_MCHECK */
}
#endif
process_mcheck_info(vector, la_ptr, regs, "T2", mcheck_expected(cpu));
}
......@@ -438,7 +438,8 @@ 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);
titan_process_logout_frame(mchk_header, alpha_verbose_mcheck);
if (alpha_verbose_mcheck)
dik_show_regs(regs, NULL);
#endif /* CONFIG_VERBOSE_MCHECK */
......
......@@ -130,9 +130,11 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
* ignore it.
*/
#if DEBUG_MCHECK > 0
#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 */
}
/*
......
......@@ -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);
......@@ -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);
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment