Browse Source

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  mmc: sdio: fix SDIO suspend/resume regression
Linus Torvalds 14 years ago
parent
commit
5a2b3ef455
1 changed files with 13 additions and 0 deletions
  1. 13 0
      drivers/mmc/core/core.c

+ 13 - 0
drivers/mmc/core/core.c

@@ -1631,6 +1631,19 @@ int mmc_suspend_host(struct mmc_host *host)
 	if (host->bus_ops && !host->bus_dead) {
 	if (host->bus_ops && !host->bus_dead) {
 		if (host->bus_ops->suspend)
 		if (host->bus_ops->suspend)
 			err = host->bus_ops->suspend(host);
 			err = host->bus_ops->suspend(host);
+		if (err == -ENOSYS || !host->bus_ops->resume) {
+			/*
+			 * We simply "remove" the card in this case.
+			 * It will be redetected on resume.
+			 */
+			if (host->bus_ops->remove)
+				host->bus_ops->remove(host);
+			mmc_claim_host(host);
+			mmc_detach_bus(host);
+			mmc_release_host(host);
+			host->pm_flags = 0;
+			err = 0;
+		}
 	}
 	}
 	mmc_bus_put(host);
 	mmc_bus_put(host);