]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00220342 mmc: sdhci:reform fix for dat1 glitch causes system panic
authorJianzheng Zhou <jianzheng.zhou@freescale.com>
Mon, 24 Sep 2012 01:50:59 +0000 (09:50 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:26 +0000 (08:35 +0200)
refix this bug, sdhci_init should be done before request_irq to
clear those wild interrupts.
Former fix commit is 4e3a2b40a16b8d5065b680ab86df288515cdea9c.

Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci.c

index e1736869034d327a05d49ec80c9b0fd5e330b1a4..39eb287d638b4dd1b0e6b3b4508b8953c9aacc6f 100644 (file)
@@ -869,19 +869,6 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
        reg = readl(host->ioaddr + SDHCI_MIX_CTRL);
        reg &= ~SDHCI_MIX_CTRL_DDREN;
        writel(reg, host->ioaddr + SDHCI_MIX_CTRL);
-       /* 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 (boarddata) {
                /* Device is always present, e.x, populated emmc device */
index 123459dee6ed63c9a1fdb8b1d3c9447088d43679..d642020810b10a64cc25e15df98f9bf1b87b1b91 100755 (executable)
@@ -2889,11 +2889,6 @@ int sdhci_add_host(struct sdhci_host *host)
                host->tuning_timer.function = sdhci_tuning_timer;
        }
 
-       ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED,
-               mmc_hostname(mmc), host);
-       if (ret)
-               goto untasklet;
-
        host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
        if (IS_ERR(host->vmmc)) {
                printk(KERN_INFO "%s: no vmmc regulator found\n", mmc_hostname(mmc));
@@ -2904,6 +2899,11 @@ int sdhci_add_host(struct sdhci_host *host)
 
        sdhci_init(host, 0);
 
+       ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED,
+               mmc_hostname(mmc), host);
+       if (ret)
+               goto untasklet;
+
 #ifdef CONFIG_MMC_DEBUG
        sdhci_dumpregs(host);
 #endif