summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorUlf Hansson2017-04-19 21:52:29 +0200
committerUlf Hansson2017-06-20 10:30:10 +0200
commite3a84267ab3184656929b4cbf03fca4d446125dd (patch)
tree8edaeabf0c241e2735e79a525df4b0e2078a86ad /drivers/mmc
parentmmc: core: Don't do eMMC HW reset when resuming the eMMC card (diff)
downloadkernel-qcow2-linux-e3a84267ab3184656929b4cbf03fca4d446125dd.tar.gz
kernel-qcow2-linux-e3a84267ab3184656929b4cbf03fca4d446125dd.tar.xz
kernel-qcow2-linux-e3a84267ab3184656929b4cbf03fca4d446125dd.zip
mmc: core: Prevent processing SDIO IRQs when none is claimed
In cases when MMC_CAP2_SDIO_IRQ_NOTHREAD is set, there is a minor window for when the mmc host could call sdio_run_irqs(), while in fact an SDIO func driver could have decided to released the SDIO IRQ via a call to sdio_release_irq(). In this scenario, processing of the SDIO IRQs are done even if there is none IRQ claimed, which is not what we want. To prevent this from happen, close the window by validating that at least one SDIO IRQs is claimed, before deciding to process them. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/sdio_irq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index 6d4b72080d51..44d9c86bd2d4 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -95,8 +95,10 @@ static int process_sdio_pending_irqs(struct mmc_host *host)
void sdio_run_irqs(struct mmc_host *host)
{
mmc_claim_host(host);
- host->sdio_irq_pending = true;
- process_sdio_pending_irqs(host);
+ if (host->sdio_irqs) {
+ host->sdio_irq_pending = true;
+ process_sdio_pending_irqs(host);
+ }
mmc_release_host(host);
}
EXPORT_SYMBOL_GPL(sdio_run_irqs);