Skip to contentSkip to conversation

MPT fusion: handle PCI layer error on resume

PATCH New Jeff Garzik 1 participant 1 message Oct 11, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MPT fusion: handle PCI layer error on resume

In the unlikely event of pci_enable_device() failure during resume, we do the minimalist solution and simply exit, rather than continuing to enable the hardware.

---

 drivers/message/fusion/mptbase.c |   10 ++++++++--
drivers/message/fusion/mptbase.c +8 -2
index e5c7271..f183b83 100644
@@ -1515,7 +1515,7 @@ mpt_resume(struct pci_dev *pdev)
 {
 	MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
 	u32 device_state = pdev->current_state;
-	int recovery_state;
+	int recovery_state, rc;
 
 	printk(MYIOC_s_INFO_FMT
 	"pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
@@ -1523,7 +1523,13 @@ mpt_resume(struct pci_dev *pdev)
 
 	pci_set_power_state(pdev, 0);
 	pci_restore_state(pdev);
-	pci_enable_device(pdev);
+
+	rc = pci_enable_device(pdev);
+	if (rc) {
+		printk(MYIOC_s_INFO_FMT
+			"pci-resume: device enable failed\n", ioc->name);
+		return rc;
+	}
 
 	/* enable interrupts */
 	CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM);