]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.51/mmc-mmci-prevent-polling-for-busy-detection-in-irq-c.patch
Linux 4.19.51
[thirdparty/kernel/stable-queue.git] / releases / 4.19.51 / mmc-mmci-prevent-polling-for-busy-detection-in-irq-c.patch
CommitLineData
37554d48
SL
1From fa04a59ef7e1378f96e374774f381523d96c92a4 Mon Sep 17 00:00:00 2001
2From: Ludovic Barre <ludovic.barre@st.com>
3Date: Fri, 26 Apr 2019 09:46:35 +0200
4Subject: mmc: mmci: Prevent polling for busy detection in IRQ context
5
6[ Upstream commit 8520ce1e17799b220ff421d4f39438c9c572ade3 ]
7
8The IRQ handler, mmci_irq(), loops until all status bits have been cleared.
9However, the status bit signaling busy in variant->busy_detect_flag, may be
10set even if busy detection isn't monitored for the current request.
11
12This may be the case for the CMD11 when switching the I/O voltage, which
13leads to that mmci_irq() busy loops in IRQ context. Fix this problem, by
14clearing the status bit for busy, before continuing to validate the
15condition for the loop. This is safe, because the busy status detection has
16already been taken care of by mmci_cmd_irq().
17
18Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
19Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
20Signed-off-by: Sasha Levin <sashal@kernel.org>
21---
22 drivers/mmc/host/mmci.c | 5 +++--
23 1 file changed, 3 insertions(+), 2 deletions(-)
24
25diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
26index 1841d250e9e2..eb1a65cb878f 100644
27--- a/drivers/mmc/host/mmci.c
28+++ b/drivers/mmc/host/mmci.c
29@@ -1295,9 +1295,10 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
30 }
31
32 /*
33- * Don't poll for busy completion in irq context.
34+ * Busy detection has been handled by mmci_cmd_irq() above.
35+ * Clear the status bit to prevent polling in IRQ context.
36 */
37- if (host->variant->busy_detect && host->busy_status)
38+ if (host->variant->busy_detect_flag)
39 status &= ~host->variant->busy_detect_flag;
40
41 ret = 1;
42--
432.20.1
44