All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 10/30] MPT fusion: handle PCI layer error on resume
@ 2007-02-16  9:46 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2007-02-16  9:46 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, jeff, Eric.Moore

From: Jeff Garzik <jeff@garzik.org>

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.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Cc: "Moore, Eric Dean" <Eric.Moore@lsil.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/message/fusion/mptbase.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff -puN drivers/message/fusion/mptbase.c~mpt-fusion-handle-pci-layer-error-on-resume drivers/message/fusion/mptbase.c
--- a/drivers/message/fusion/mptbase.c~mpt-fusion-handle-pci-layer-error-on-resume
+++ a/drivers/message/fusion/mptbase.c
@@ -1530,7 +1530,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",
@@ -1538,7 +1538,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);
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-16  9:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-16  9:46 [patch 10/30] MPT fusion: handle PCI layer error on resume akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.