Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/eeh: More relaxed hotplug criterion

Currently, we rely on the existence of struct pci_driver::err_handler
to decide if the corresponding PCI device should be unplugged during
EEH recovery (partially hotplug case). However that check is not
sufficient. Some device drivers implement only some of the EEH error
handlers to collect diag-data. That means the driver still expects a
hotplug to recover from the EEH error.

This makes the hotplug criterion more relaxed: if the device driver
doesn't provide all necessary EEH error handlers, it will experience
hotplug during EEH recovery.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
[mpe: Minor change log rewording]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Gavin Shan and committed by
Michael Ellerman
f2da4ccf 527d10ef

+4 -1
+4 -1
arch/powerpc/kernel/eeh_driver.c
··· 416 416 driver = eeh_pcid_get(dev); 417 417 if (driver) { 418 418 eeh_pcid_put(dev); 419 - if (driver->err_handler) 419 + if (driver->err_handler && 420 + driver->err_handler->error_detected && 421 + driver->err_handler->slot_reset && 422 + driver->err_handler->resume) 420 423 return NULL; 421 424 } 422 425