powerpc/eeh: Defer printing stack trace
Currently we print a stack trace in the event handler to help with debugging EEH issues. In the case of suprise hot-unplug this is unneeded, so we want to prevent printing the stack trace unless we know it's due to an actual device error. To accomplish this, we can save a stack trace at the point of detection and only print it once the EEH recovery handler has determined the freeze was due to an actual error. Since the whole point of this is to prevent spurious EEH output we also move a few prints out of the detection thread, or mark them as pr_debug so anyone interested can get output from the eeh_check_dev_failure() if they want. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190903101605.2890-6-oohall@gmail.com
This commit is contained in:

committed by
Michael Ellerman

parent
b104af5a76
commit
25baf3d816
@@ -863,8 +863,44 @@ void eeh_handle_normal_event(struct eeh_pe *pe)
|
||||
if (eeh_slot_presence_check(edev->pdev))
|
||||
devices++;
|
||||
|
||||
if (!devices)
|
||||
if (!devices) {
|
||||
pr_debug("EEH: Frozen PHB#%x-PE#%x is empty!\n",
|
||||
pe->phb->global_number, pe->addr);
|
||||
goto out; /* nothing to recover */
|
||||
}
|
||||
|
||||
/* Log the event */
|
||||
if (pe->type & EEH_PE_PHB) {
|
||||
pr_err("EEH: PHB#%x failure detected, location: %s\n",
|
||||
pe->phb->global_number, eeh_pe_loc_get(pe));
|
||||
} else {
|
||||
struct eeh_pe *phb_pe = eeh_phb_pe_get(pe->phb);
|
||||
|
||||
pr_err("EEH: Frozen PHB#%x-PE#%x detected\n",
|
||||
pe->phb->global_number, pe->addr);
|
||||
pr_err("EEH: PE location: %s, PHB location: %s\n",
|
||||
eeh_pe_loc_get(pe), eeh_pe_loc_get(phb_pe));
|
||||
}
|
||||
|
||||
/*
|
||||
* Print the saved stack trace now that we've verified there's
|
||||
* something to recover.
|
||||
*/
|
||||
if (pe->trace_entries) {
|
||||
void **ptrs = (void **) pe->stack_trace;
|
||||
int i;
|
||||
|
||||
pr_err("EEH: Frozen PHB#%x-PE#%x detected\n",
|
||||
pe->phb->global_number, pe->addr);
|
||||
|
||||
/* FIXME: Use the same format as dump_stack() */
|
||||
pr_err("EEH: Call Trace:\n");
|
||||
for (i = 0; i < pe->trace_entries; i++)
|
||||
pr_err("EEH: [%pK] %pS\n", ptrs[i], ptrs[i]);
|
||||
|
||||
pe->trace_entries = 0;
|
||||
}
|
||||
|
||||
|
||||
eeh_pe_update_time_stamp(pe);
|
||||
pe->freeze_count++;
|
||||
|
Reference in New Issue
Block a user