“6ab3d5624e172c553004ecc862bfeac16d9d68b7”上不存在“arch/x86/mach-voyager/voyager_thread.c”
提交 5b4f1f6c 编写于 作者: R Russell King 提交者: Chris Ball

mmc: sdhci: plug hole in disabling card detection interrupts

When we disable card detection interrupts, we should disable both the
insert and remove interrupts irrespective of the current state - this
avoids races between the hardware card detect changing state before
we've read that updated state and altered the interrupt mask.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
Tested-by: NMarkus Pargmann <mpa@pengutronix.de>
Tested-by: NStephen Warren <swarren@nvidia.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NChris Ball <chris@printf.net>
上级 b537f94c
...@@ -133,20 +133,21 @@ static void sdhci_dumpregs(struct sdhci_host *host) ...@@ -133,20 +133,21 @@ static void sdhci_dumpregs(struct sdhci_host *host)
static void sdhci_set_card_detection(struct sdhci_host *host, bool enable) static void sdhci_set_card_detection(struct sdhci_host *host, bool enable)
{ {
u32 present, irqs; u32 present;
if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) || if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
(host->mmc->caps & MMC_CAP_NONREMOVABLE)) (host->mmc->caps & MMC_CAP_NONREMOVABLE))
return; return;
present = sdhci_readl(host, SDHCI_PRESENT_STATE) & if (enable) {
SDHCI_CARD_PRESENT; present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
irqs = present ? SDHCI_INT_CARD_REMOVE : SDHCI_INT_CARD_INSERT; SDHCI_CARD_PRESENT;
if (enable) host->ier |= present ? SDHCI_INT_CARD_REMOVE :
host->ier |= irqs; SDHCI_INT_CARD_INSERT;
else } else {
host->ier &= ~irqs; host->ier &= ~(SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT);
}
sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册