powerpc/eeh: Can't recover from non-PE-reset case
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Thu, 24 Apr 2014 08:00:26 +0000 (18:00 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 28 Apr 2014 07:35:01 +0000 (17:35 +1000)
When PCI_ERS_RESULT_CAN_RECOVER returned from device drivers, the
EEH core should enable I/O and DMA for the affected PE. However,
it was missed to have DMA enabled in eeh_handle_normal_event().
Besides, the frozen state of the affected PE should be cleared
after successful recovery, but we didn't.

The patch fixes both of the issues as above.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/eeh_driver.c

index f99ba9b7632219641c25921edea15c9261db9f79..7100a5b96e7059caf572609dec9d7f9393f0106f 100644 (file)
@@ -640,7 +640,6 @@ static void eeh_handle_normal_event(struct eeh_pe *pe)
                        result = PCI_ERS_RESULT_NEED_RESET;
                } else {
                        pr_info("EEH: Notify device drivers to resume I/O\n");
-                       result = PCI_ERS_RESULT_NONE;
                        eeh_pe_dev_traverse(pe, eeh_report_mmio_enabled, &result);
                }
        }
@@ -652,10 +651,17 @@ static void eeh_handle_normal_event(struct eeh_pe *pe)
 
                if (rc < 0)
                        goto hard_fail;
-               if (rc)
+               if (rc) {
                        result = PCI_ERS_RESULT_NEED_RESET;
-               else
+               } else {
+                       /*
+                        * We didn't do PE reset for the case. The PE
+                        * is still in frozen state. Clear it before
+                        * resuming the PE.
+                        */
+                       eeh_pe_state_clear(pe, EEH_PE_ISOLATED);
                        result = PCI_ERS_RESULT_RECOVERED;
+               }
        }
 
        /* If any device has a hard failure, then shut off everything. */