aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2014-06-12 09:01:57 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-08-11 04:24:15 -0400
commitad82bfea44835da9633548e2031a1af4a9965c14 (patch)
tree83e7246c20e4c6fdcd1e76af9415c2216cc0e267
parent1cb9da502835dad73dda772b20c1e792f4e71589 (diff)
mmc: mmci: Move all CMD irq handling to mmci_cmd_irq()
This patch won't change the behavior of how mmci deals with CMD irqs. By moving code from mmci_irq() to mmci_cmd_irq(), we getter a better overview of what going on. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: John Stultz <john.stultz@linaro.org> Cc: Russell King <linux@arm.linux.org.uk> Tested-by: Kees Cook <keescook@chromium.org> Tested-by: John Stultz <john.stultz@linaro.org> Cc: <stable@vger.kernel.org> # v3.15+ Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/mmci.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index a723ed2883f9..5d20bfba3e49 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -960,9 +960,17 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
960 unsigned int status) 960 unsigned int status)
961{ 961{
962 void __iomem *base = host->base; 962 void __iomem *base = host->base;
963 bool sbc = (cmd == host->mrq->sbc); 963 bool sbc, busy_resp;
964 bool busy_resp = host->variant->busy_detect && 964
965 (cmd->flags & MMC_RSP_BUSY); 965 if (!cmd)
966 return;
967
968 sbc = (cmd == host->mrq->sbc);
969 busy_resp = host->variant->busy_detect && (cmd->flags & MMC_RSP_BUSY);
970
971 if (!((status|host->busy_status) & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT|
972 MCI_CMDSENT|MCI_CMDRESPEND)))
973 return;
966 974
967 /* Check if we need to wait for busy completion. */ 975 /* Check if we need to wait for busy completion. */
968 if (host->busy_status && (status & MCI_ST_CARDBUSY)) 976 if (host->busy_status && (status & MCI_ST_CARDBUSY))
@@ -1209,8 +1217,6 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
1209 spin_lock(&host->lock); 1217 spin_lock(&host->lock);
1210 1218
1211 do { 1219 do {
1212 struct mmc_command *cmd;
1213
1214 status = readl(host->base + MMCISTATUS); 1220 status = readl(host->base + MMCISTATUS);
1215 1221
1216 if (host->singleirq) { 1222 if (host->singleirq) {
@@ -1230,11 +1236,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
1230 1236
1231 dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status); 1237 dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status);
1232 1238
1233 cmd = host->cmd; 1239 mmci_cmd_irq(host, host->cmd, status);
1234 if ((status|host->busy_status) & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT|
1235 MCI_CMDSENT|MCI_CMDRESPEND) && cmd)
1236 mmci_cmd_irq(host, cmd, status);
1237
1238 mmci_data_irq(host, host->data, status); 1240 mmci_data_irq(host, host->data, status);
1239 1241
1240 /* Don't poll for busy completion in irq context. */ 1242 /* Don't poll for busy completion in irq context. */