mmc: mmci_sdmmc: Fix clear busyd0end irq flag
authorLudovic Barre <ludovic.barre@st.com>
Wed, 25 Mar 2020 14:34:08 +0000 (15:34 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 26 Mar 2020 13:59:31 +0000 (14:59 +0100)
The busyd0 line transition can be very fast. The busy request may be
completed by busy_d0end, without waiting for the busy_d0 steps. Therefore,
clear the busyd0end irq flag, even if no busy_status.

Fixes: 0e68de6aa7b1 ("mmc: mmci: sdmmc: add busy_complete callback")
Cc: stable@vger.kernel.org
Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
Link: https://lore.kernel.org/r/20200325143409.13005-2-ludovic.barre@st.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mmci_stm32_sdmmc.c

index f76e82f..d33e62b 100644 (file)
@@ -358,11 +358,11 @@ complete:
        if (host->busy_status) {
                writel_relaxed(mask & ~host->variant->busy_detect_mask,
                               base + MMCIMASK0);
-               writel_relaxed(host->variant->busy_detect_mask,
-                              base + MMCICLEAR);
                host->busy_status = 0;
        }
 
+       writel_relaxed(host->variant->busy_detect_mask, base + MMCICLEAR);
+
        return true;
 }