summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLudovic Barre <ludovic.barre@st.com>2019-04-26 09:46:35 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-15 11:54:05 +0200
commit217ec4a6e4ef075a784957b1adcb5c1e3283e911 (patch)
treed916382727759e1fe608688bbe02841185819efb /drivers/mmc
parent06382ad6cf31fe628eae072e65b61a8b767b7828 (diff)
downloadlinux-stable-217ec4a6e4ef075a784957b1adcb5c1e3283e911.tar.gz
linux-stable-217ec4a6e4ef075a784957b1adcb5c1e3283e911.tar.bz2
linux-stable-217ec4a6e4ef075a784957b1adcb5c1e3283e911.zip
mmc: mmci: Prevent polling for busy detection in IRQ context
[ Upstream commit 8520ce1e17799b220ff421d4f39438c9c572ade3 ] The IRQ handler, mmci_irq(), loops until all status bits have been cleared. However, the status bit signaling busy in variant->busy_detect_flag, may be set even if busy detection isn't monitored for the current request. This may be the case for the CMD11 when switching the I/O voltage, which leads to that mmci_irq() busy loops in IRQ context. Fix this problem, by clearing the status bit for busy, before continuing to validate the condition for the loop. This is safe, because the busy status detection has already been taken care of by mmci_cmd_irq(). Signed-off-by: Ludovic Barre <ludovic.barre@st.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 1841d250e9e2..eb1a65cb878f 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1295,9 +1295,10 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
}
/*
- * Don't poll for busy completion in irq context.
+ * Busy detection has been handled by mmci_cmd_irq() above.
+ * Clear the status bit to prevent polling in IRQ context.
*/
- if (host->variant->busy_detect && host->busy_status)
+ if (host->variant->busy_detect_flag)
status &= ~host->variant->busy_detect_flag;
ret = 1;