]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mmc:sdhci:fix: Change default interrupts enabled at SDHCI initialization
authorŁukasz Majewski <l.majewski@samsung.com>
Fri, 11 Jan 2013 05:08:54 +0000 (05:08 +0000)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 12 Mar 2013 10:50:49 +0000 (19:50 +0900)
This patch changes sdhci_init()'s behavior to NOT enable all interrupt
sources by default. Moreover interrupt signaling has been disabled.

This patch do not enable interrupts which aren't served in u-boot
(they are defined at sdhci.h but NOT used elsewhere):
- SDHCI_INT_CARD_INSERT, SDHCI_INT_CARD_REMOVE, SDHCI_BUS_POWER,
  SDHCI_INT_CARD_REMOVE, SDHCI_INT_CARD_INT

Special care shall be put on SDHCI_INT_CARD_INT, which indicates
interrupt generated by SD card.
According to "SD Host Controller Simplified Spec. ver 3.00" when bit 8
(Card Interrupt Status Enable) at "Normal Interrupt Status Enable
Register" (offset 0x34) is set, the card interrupt detection is started.
Then eMMC card may cause the SD controller to set this bit and then this
interrupt is passed to booted OS and might cause kernel crash.

To sum up:
- Only enable interrupts, which are served at u-boot
- This cleanup as a side effect fixes SDHCI's CARD INTERRUPT problem at
  Linux kernel (versions 3.6+, sdhci controller)
- Keep masked bits at "Normal Interrupt Signal Enable Register" (0x38h)

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Lei Wen <leiwen@marvell.com>
Cc: Andy Fleming <afleming@freescale.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/mmc/sdhci.c

index b9cbe34f1f12f728471514ceac568576fe696b9c..551b4232c8ef3c0434715816f1c2ae51a2d9dfe3 100644 (file)
@@ -412,9 +412,11 @@ int sdhci_init(struct mmc *mmc)
                        status = sdhci_readl(host, SDHCI_PRESENT_STATE);
        }
 
-       /* Eable all state */
-       sdhci_writel(host, SDHCI_INT_ALL_MASK, SDHCI_INT_ENABLE);
-       sdhci_writel(host, SDHCI_INT_ALL_MASK, SDHCI_SIGNAL_ENABLE);
+       /* Enable only interrupts served by the SD controller */
+       sdhci_writel(host, SDHCI_INT_DATA_MASK | SDHCI_INT_CMD_MASK
+                    , SDHCI_INT_ENABLE);
+       /* Mask all sdhci interrupt sources */
+       sdhci_writel(host, 0x0, SDHCI_SIGNAL_ENABLE);
 
        return 0;
 }