瀏覽代碼

[POWERPC] EEH: verify state change

After requesting a state change, verify that the state change
actually ocurred, and the system ends up in the expected state.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Linas Vepstas 18 年之前
父節點
當前提交
fa1be476a2
共有 2 個文件被更改,包括 10 次插入2 次删除
  1. 5 1
      arch/powerpc/platforms/pseries/eeh.c
  2. 5 1
      arch/powerpc/platforms/pseries/eeh_driver.c

+ 5 - 1
arch/powerpc/platforms/pseries/eeh.c

@@ -527,9 +527,13 @@ rtas_pci_enable(struct pci_dn *pdn, int function)
 		            function);
 		            function);
 
 
 	if (rc)
 	if (rc)
-		printk(KERN_WARNING "EEH: Cannot enable function %d, err=%d dn=%s\n",
+		printk(KERN_WARNING "EEH: Unexpected state change %d, err=%d dn=%s\n",
 		        function, rc, pdn->node->full_name);
 		        function, rc, pdn->node->full_name);
 
 
+	rc = eeh_wait_for_slot_status (pdn, PCI_BUS_RESET_WAIT_MSEC);
+	if ((rc == 4) && (function == EEH_THAW_MMIO))
+		return 0;
+
 	return rc;
 	return rc;
 }
 }
 
 

+ 5 - 1
arch/powerpc/platforms/pseries/eeh_driver.c

@@ -300,7 +300,7 @@ static int eeh_reset_device (struct pci_dn *pe_dn, struct pci_bus *bus)
 /* The longest amount of time to wait for a pci device
 /* The longest amount of time to wait for a pci device
  * to come back on line, in seconds.
  * to come back on line, in seconds.
  */
  */
-#define MAX_WAIT_FOR_RECOVERY 15
+#define MAX_WAIT_FOR_RECOVERY 150
 
 
 struct pci_dn * handle_eeh_events (struct eeh_event *event)
 struct pci_dn * handle_eeh_events (struct eeh_event *event)
 {
 {
@@ -393,6 +393,8 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
 	if (result == PCI_ERS_RESULT_CAN_RECOVER) {
 	if (result == PCI_ERS_RESULT_CAN_RECOVER) {
 		rc = rtas_pci_enable(frozen_pdn, EEH_THAW_MMIO);
 		rc = rtas_pci_enable(frozen_pdn, EEH_THAW_MMIO);
 
 
+		if (rc < 0)
+			goto hard_fail;
 		if (rc) {
 		if (rc) {
 			result = PCI_ERS_RESULT_NEED_RESET;
 			result = PCI_ERS_RESULT_NEED_RESET;
 		} else {
 		} else {
@@ -405,6 +407,8 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
 	if (result == PCI_ERS_RESULT_CAN_RECOVER) {
 	if (result == PCI_ERS_RESULT_CAN_RECOVER) {
 		rc = rtas_pci_enable(frozen_pdn, EEH_THAW_DMA);
 		rc = rtas_pci_enable(frozen_pdn, EEH_THAW_DMA);
 
 
+		if (rc < 0)
+			goto hard_fail;
 		if (rc)
 		if (rc)
 			result = PCI_ERS_RESULT_NEED_RESET;
 			result = PCI_ERS_RESULT_NEED_RESET;
 		else
 		else