]>
Commit | Line | Data |
---|---|---|
37554d48 SL |
1 | From fa04a59ef7e1378f96e374774f381523d96c92a4 Mon Sep 17 00:00:00 2001 |
2 | From: Ludovic Barre <ludovic.barre@st.com> | |
3 | Date: Fri, 26 Apr 2019 09:46:35 +0200 | |
4 | Subject: mmc: mmci: Prevent polling for busy detection in IRQ context | |
5 | ||
6 | [ Upstream commit 8520ce1e17799b220ff421d4f39438c9c572ade3 ] | |
7 | ||
8 | The IRQ handler, mmci_irq(), loops until all status bits have been cleared. | |
9 | However, the status bit signaling busy in variant->busy_detect_flag, may be | |
10 | set even if busy detection isn't monitored for the current request. | |
11 | ||
12 | This may be the case for the CMD11 when switching the I/O voltage, which | |
13 | leads to that mmci_irq() busy loops in IRQ context. Fix this problem, by | |
14 | clearing the status bit for busy, before continuing to validate the | |
15 | condition for the loop. This is safe, because the busy status detection has | |
16 | already been taken care of by mmci_cmd_irq(). | |
17 | ||
18 | Signed-off-by: Ludovic Barre <ludovic.barre@st.com> | |
19 | Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> | |
20 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
21 | --- | |
22 | drivers/mmc/host/mmci.c | 5 +++-- | |
23 | 1 file changed, 3 insertions(+), 2 deletions(-) | |
24 | ||
25 | diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c | |
26 | index 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 | -- | |
43 | 2.20.1 | |
44 |