Skip to contentSkip to conversation

drivers/{mmc,misc}: handle PCI errors on resume

PATCH NAK Jeff Garzik 3 participants 3 messages Oct 11, 2006 – Oct 21, 2006

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

PATCH 1/1 drivers/{mmc,misc}: handle PCI errors on resume

Since pci_enable_device() is one of the first things called in the resume step, take the minimalist approach and return immediately, if pci_enable_device() fails during resume.

Also, in sdhci: don't check for impossible condition (chip==NULL)

---

 drivers/misc/tifm_7xx1.c      |    7 ++++++-
 drivers/mmc/sdhci.c           |   11 +++++------
drivers/misc/tifm_7xx1.c +6 -1
index 1ba8754..03988b9 100644
@@ -273,9 +273,14 @@ static int tifm_7xx1_resume(struct pci_d
 {
 	struct tifm_adapter *fm = pci_get_drvdata(dev);
 	unsigned long flags;
+	int rc;
 
 	pci_restore_state(dev);
-        pci_enable_device(dev);
+
+	rc = pci_enable_device(dev);
+	if (rc)
+		return rc;
+
         pci_set_power_state(dev, PCI_D0);
         pci_set_master(dev);
 
drivers/mmc/sdhci.c +5 -6
index 9a7d39b..b27fff9 100644
@@ -1090,18 +1090,17 @@ static int sdhci_suspend (struct pci_dev
 
 static int sdhci_resume (struct pci_dev *pdev)
 {
-	struct sdhci_chip *chip;
+	struct sdhci_chip *chip = pci_get_drvdata(pdev);
 	int i, ret;
 
-	chip = pci_get_drvdata(pdev);
-	if (!chip)
-		return 0;
-
 	DBG("Resuming...\n");
 
 	pci_set_power_state(pdev, PCI_D0);
 	pci_restore_state(pdev);
-	pci_enable_device(pdev);
+
+	ret = pci_enable_device(pdev);
+	if (ret)
+		return ret;
 
 	for (i = 0;i < chip->num_slots;i++) {
 		if (!chip->hosts[i])
#1 lore raw
Quoted 3 lines · Jeff Garzik

Since pci_enable_device() is one of the first things called in the resume step, take the minimalist approach and return immediately, if pci_enable_device() fails during resume.

NAK, for the same reason as for drivers/serial.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
#2 lore raw
Quoted 7 lines · Russell King
Quoted 3 lines · Jeff Garzik

Since pci_enable_device() is one of the first things called in the resume step, take the minimalist approach and return immediately, if pci_enable_device() fails during resume.

NAK, for the same reason as for drivers/serial.

So what would be the prudent course of action in this case?

Rgds

Signature · 5 lines
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org