From: Lukasz Majewski Date: Thu, 21 Feb 2013 18:21:15 +0100 Subject: [U-Boot] [PATCH] mmc:sdhci:fix: Change default interrupts enabled at SDHCI initialization In-Reply-To: <20130211095059.7b70a599@amdc308.digital.local> References: <1357916934-11340-1-git-send-email-l.majewski@samsung.com> <20130129154743.6e104850@amdc308.digital.local> <20130211095059.7b70a599@amdc308.digital.local> Message-ID: <20130221182115.6bf338fa@amdc308.digital.local> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear All, I'd like to kindly ask for any feedback on this patch. It is now more than month on the u-boot mailing list... > Dear All, > > Any feedback about this patch? > > It has been on the list for quite long time..... > > > > Dear All, > > > > Any feedback about this patch? > > > > > 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 > > > Signed-off-by: Kyungmin Park > > > Cc: Lei Wen > > > Cc: Andy Fleming > > > --- > > > drivers/mmc/sdhci.c | 8 +++++--- > > > 1 files changed, 5 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c > > > index 0fd1337..76c14fb 100644 > > > --- a/drivers/mmc/sdhci.c > > > +++ b/drivers/mmc/sdhci.c > > > @@ -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; > > > } > > > > > > > > > -- Best regards, Lukasz Majewski Samsung R&D Poland (SRPOL) | Linux Platform Group