Subject: [PATCH] powerpc: EEH recovery tweaks
Subsystems (2)
Paul,
Please apply and forward upstream. This patch is not urgent, it provides fixes for a code path that is not currently used by any existing driver.
--linas
If one attempts to create a device driver recovery sequence that does not depend on a hard reset of the device, but simply just attempts to resume processing, then one discovers that the recovery sequence implemented on powerpc is not quite right. This patch fixes this up.
Signed-off-by Linas Vepstas <[email protected]>
----
arch/powerpc/platforms/pseries/eeh.c | 1 + arch/powerpc/platforms/pseries/eeh_driver.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
arch/powerpc/platforms/pseries/eeh_driver.c +10 -3
@@ -170,14 +170,19 @@ static void eeh_report_reset(struct pci_static void eeh_report_resume (struct pci_dev *dev,void *userdata) {struct pci_driver *driver = dev->driver; +struct device_node *dn =pci_device_to_OF_node (dev); dev->error_state = pci_channel_io_normal;if (!driver)return ; -if (!driver->err_handler) -return ; -if (!driver->err_handler->resume) + +if ((PCI_DN (dn)->eeh_mode) &EEH_MODE_IRQ_DISABLED ) { +PCI_DN (dn)->eeh_mode &= ~EEH_MODE_IRQ_DISABLED ; +enable_irq (dev->irq); + } +if (!driver->err_handler || + !driver->err_handler->resume)return ; driver->err_handler->resume (dev);
@@ -407,6 +412,8 @@ struct pci_dn * handle_eeh_events (strucif (rc) result =PCI_ERS_RESULT_NEED_RESET ; +else + result =PCI_ERS_RESULT_RECOVERED ; }/* If any device has a hard failure, then shut off everything. */