aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichardZhu <richard.zhu@linaro.org>2011-11-16 13:14:31 +0800
committerEric Miao <eric.miao@canonical.com>2011-12-05 16:49:54 +0800
commit18d2eb7446898373cdb729bee60b202a786d9aef (patch)
treefc9c368b7170ec1faa1c9ff8db547e3c79688a38
parent160b58a2ebc8b0dabb19c71d5e43a7331bacde7d (diff)
downloadlinux-linaro-18d2eb7446898373cdb729bee60b202a786d9aef.tar.gz
mmc: sdhci-esdhc-imx: sd dat1 glitch causes system panic
some sd cards insertion will cause a glitch on sd dat1 which is also a card interrupt signal. Thus the wrongly generated card interrupt will make system panic because there's no registered sdio interrupt handler. the patch fixes this issue. Signed-off-by: Tony Lin <tony.lin@freescale.com> Signed-off-by: RichardZhu <richard.zhu@linaro.org>
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index a3dd778ab0a..bd1cb7910e4 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -452,6 +452,7 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev)
struct clk *clk;
int err;
struct pltfm_imx_data *imx_data;
+ u32 reg;
host = sdhci_pltfm_init(pdev, &sdhci_esdhc_imx_pdata);
if (IS_ERR(host))
@@ -479,6 +480,20 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev)
clk_enable(clk);
pltfm_host->clk = clk;
+ /* disable card interrupt enable bit, and clear status bit
+ * the default value of this enable bit is 1, but it should
+ * be 0 regarding to standard host controller spec 2.1.3.
+ * if this bit is 1, it may cause some problems.
+ * there's dat1 glitch when some cards inserting into the slot,
+ * thus wrongly generate a card interrupt that will cause
+ * system panic because it lacks of sdio handler
+ * following code will solve the problem.
+ */
+ reg = sdhci_readl(host, SDHCI_INT_ENABLE);
+ reg &= ~SDHCI_INT_CARD_INT;
+ sdhci_writel(host, reg, SDHCI_INT_ENABLE);
+ sdhci_writel(host, SDHCI_INT_CARD_INT, SDHCI_INT_STATUS);
+
if (!is_imx25_esdhc(imx_data))
host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;