mmc: meson-gx: fix irq ack
authorJerome Brunet <jbrunet@baylibre.com>
Thu, 23 May 2019 14:59:50 +0000 (16:59 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 28 May 2019 08:23:26 +0000 (10:23 +0200)
While cleaning the ISR of the meson-gx and acking only raised irqs,
the ack of the irq was moved at the very last stage of the function.

This was stable during the initial tests but it triggered issues with
hs200, under specific loads (like booting android). Acking the irqs
after calling the mmc_request_done() causes the problem.

Moving the ack back to the original place solves the issue. Since the
irq is edge triggered, it does not hurt to ack irq even earlier, so
let's do it early in the ISR.

Fixes: 9c5fdb07a28d ("mmc: meson-gx: ack only raised irq")
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Tested-by: Brad Harper <bjharper@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/meson-gx-mmc.c

index c5a8af4..5582561 100644 (file)
@@ -859,6 +859,9 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
        if (WARN_ON(!host) || WARN_ON(!host->cmd))
                return IRQ_NONE;
 
+       /* ack all raised interrupts */
+       writel(status, host->regs + SD_EMMC_STATUS);
+
        cmd = host->cmd;
        data = cmd->data;
        cmd->error = 0;
@@ -905,9 +908,6 @@ out:
        if (ret == IRQ_HANDLED)
                meson_mmc_request_done(host->mmc, cmd->mrq);
 
-       /* ack all raised interrupts */
-       writel(status, host->regs + SD_EMMC_STATUS);
-
        return ret;
 }