[PATCH 20/133] [Jaunty SRU] ARM.imx51 Freescale:ENGR00109285 SD/MMC: The SD card interrupt can't be detected after system resume

Brad Figg brad.figg at canonical.com
Thu Jul 9 16:48:10 UTC 2009


From: Wallace Wang <r59996 at freescale.com>

The suspend/resume sequence is class.suspend/bus.suspend/disable_irq/
bus.suspend_late -> ...-> bus.resume_early/enable_irq/bus.resume/
class.resume
MX35 platform: SD card interrupt is pseudo irq generated by mcu while mcu
is controlled through I2C interface. Now I2C suspend is before disable_irq
and I2C resume is after enable_irq. When SD card is inserted in suspend state,
after system resume, the card detect interrupt will be handled by mcu interrupt
handler before I2C driver resume. That will cause i2c error and can't get
correct card status.
Changing I2C driver suspend/resume to suspend_late/resume_early can
make I2C resume before enable_irq.
Remove ENGR00098769 fix, That card detection issue is also caused by
missed interrupt

Signed-off-by: Wallace Wang <r59996 at freescale.com>
Signed-off-by: Brad Figg <brad.figg at canonical.com>
---
 drivers/i2c/busses/mxc_i2c.c |    6 +++---
 drivers/mmc/host/mx_sdhci.c  |    9 ---------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/i2c/busses/mxc_i2c.c b/drivers/i2c/busses/mxc_i2c.c
index fe5c29e..54dd0f1 100644
--- a/drivers/i2c/busses/mxc_i2c.c
+++ b/drivers/i2c/busses/mxc_i2c.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
  */
 
 /*
@@ -758,8 +758,8 @@ static struct platform_driver mxci2c_driver = {
 		   },
 	.probe = mxci2c_probe,
 	.remove = mxci2c_remove,
-	.suspend = mxci2c_suspend,
-	.resume = mxci2c_resume,
+	.suspend_late = mxci2c_suspend,
+	.resume_early = mxci2c_resume,
 };
 
 /*!
diff --git a/drivers/mmc/host/mx_sdhci.c b/drivers/mmc/host/mx_sdhci.c
index 74dde11..2d95201 100644
--- a/drivers/mmc/host/mx_sdhci.c
+++ b/drivers/mmc/host/mx_sdhci.c
@@ -1582,7 +1582,6 @@ static int sdhci_resume(struct platform_device *pdev)
 {
 	struct sdhci_chip *chip;
 	int i, ret;
-	unsigned int cd_status = 0;
 
 	chip = dev_get_drvdata(&pdev->dev);
 	if (!chip)
@@ -1603,14 +1602,6 @@ static int sdhci_resume(struct platform_device *pdev)
 			return ret;
 		sdhci_init(chip->hosts[i]);
 		mmiowb();
-
-		cd_status = chip->hosts[i]->plat_data->status(chip->hosts[i]->
-							      mmc->parent);
-		if (cd_status)
-			chip->hosts[i]->flags &= ~SDHCI_CD_PRESENT;
-		else
-			chip->hosts[i]->flags |= SDHCI_CD_PRESENT;
-
 		ret = mmc_resume_host(chip->hosts[i]->mmc);
 		if (ret)
 			return ret;
-- 
1.6.0.4





More information about the kernel-team mailing list