Commit f36c5227 authored by Mike Mason's avatar Mike Mason Committed by Benjamin Herrenschmidt

powerpc/eeh: Don't panic when EEH_MAX_FAILS is exceeded

This patch changes the EEH_MAX_FAILS action from panic to printing an
error message.  Panicking under under this condition is too harsh.
Although performance will be affected and the device may not recover,
the system is still running, which at the very least should allow for a
more graceful shutdown. The patch also removes the msleep() within a
spinlock, which can lead to a deadlock and is not recommended.
Signed-off-by: default avatarMike Mason <mmlnx@us.ibm.com>
Acked-by: default avatarLinas Vepstas <linasvepstas@gmail.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 57a20d8f
...@@ -75,9 +75,9 @@ ...@@ -75,9 +75,9 @@
*/ */
/* If a device driver keeps reading an MMIO register in an interrupt /* If a device driver keeps reading an MMIO register in an interrupt
* handler after a slot isolation event has occurred, we assume it * handler after a slot isolation event, it might be broken.
* is broken and panic. This sets the threshold for how many read * This sets the threshold for how many read attempts we allow
* attempts we allow before panicking. * before printing an error message.
*/ */
#define EEH_MAX_FAILS 2100000 #define EEH_MAX_FAILS 2100000
...@@ -470,6 +470,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) ...@@ -470,6 +470,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
unsigned long flags; unsigned long flags;
struct pci_dn *pdn; struct pci_dn *pdn;
int rc = 0; int rc = 0;
const char *location;
total_mmio_ffs++; total_mmio_ffs++;
...@@ -509,18 +510,15 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) ...@@ -509,18 +510,15 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
rc = 1; rc = 1;
if (pdn->eeh_mode & EEH_MODE_ISOLATED) { if (pdn->eeh_mode & EEH_MODE_ISOLATED) {
pdn->eeh_check_count ++; pdn->eeh_check_count ++;
if (pdn->eeh_check_count >= EEH_MAX_FAILS) { if (pdn->eeh_check_count % EEH_MAX_FAILS == 0) {
printk (KERN_ERR "EEH: Device driver ignored %d bad reads, panicing\n", location = of_get_property(dn, "ibm,loc-code", NULL);
pdn->eeh_check_count); printk (KERN_ERR "EEH: %d reads ignored for recovering device at "
"location=%s driver=%s pci addr=%s\n",
pdn->eeh_check_count, location,
dev->driver->name, pci_name(dev));
printk (KERN_ERR "EEH: Might be infinite loop in %s driver\n",
dev->driver->name);
dump_stack(); dump_stack();
msleep(5000);
/* re-read the slot reset state */
if (read_slot_reset_state(pdn, rets) != 0)
rets[0] = -1; /* reset state unknown */
/* If we are here, then we hit an infinite loop. Stop. */
panic("EEH: MMIO halt (%d) on device:%s\n", rets[0], pci_name(dev));
} }
goto dn_unlock; goto dn_unlock;
} }
......
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