diff mbox

mmc: clear all interrupt in suspend before free_irq

Message ID AANLkTikkj=tcCTHgT=fbvS=nOtMP+V3brjtReUNCiHu5@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhangfei Gao Jan. 24, 2011, 8:33 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index aacd78c..a813b8b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1684,8 +1684,12 @@  out:
 	/*
 	 * We have to delay this as it calls back into the driver.
 	 */
-	if (cardint)
-		mmc_signal_sdio_irq(host->mmc);
+	if (cardint) {
+		if(host->suspended)
+			sdhci_enable_sdio_irq(host->mmc, 0);
+		else
+			mmc_signal_sdio_irq(host->mmc);
+	}

 	return result;
 }
@@ -1709,6 +1713,7 @@  int sdhci_suspend_host(struct sdhci_host *host,
pm_message_t state)
 		return ret;

 	free_irq(host->irq, host);
+	host->suspended = true;

 	if (host->vmmc)
 		ret = regulator_disable(host->vmmc);
@@ -1742,6 +1747,7 @@  int sdhci_resume_host(struct sdhci_host *host)
 	sdhci_init(host, (host->mmc->pm_flags & MMC_PM_KEEP_POWER));
 	mmiowb();

+	host->suspended = false;
 	ret = mmc_resume_host(host->mmc);
 	sdhci_enable_card_detection(host);

diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 83bd9f7..764666a 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -140,6 +140,7 @@  struct sdhci_host {
 	struct timer_list timer;	/* Timer for timeouts */

 	unsigned int caps;	/* Alternative capabilities */
+	bool suspended;

 	unsigned int            ocr_avail_sdio;	/* OCR bit masks */
 	unsigned int            ocr_avail_sd;