mmc: tmio: always flag retune when resetting and a card is present
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 16 Mar 2021 08:57:17 +0000 (09:57 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 30 Mar 2021 09:42:06 +0000 (11:42 +0200)
After reset, we manually flagged retune in runtime resume, but missed it
in the workqueue. To fix that and avoid the problem in the future, let's
flag retune in the reset handler directly whenever a card is present.

Reported-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20210316085717.7276-3-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/tmio_mmc_core.c

index 3755f606b8db090dc5706450e580d97571be1453..0c474d78b1867eb3c95ce98849527ed86a9f2116 100644 (file)
@@ -198,6 +198,9 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host)
                sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, host->sdio_irq_mask);
                sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);
        }
+
+       if (host->mmc->card)
+               mmc_retune_needed(host->mmc);
 }
 
 static void tmio_mmc_reset_work(struct work_struct *work)
@@ -1290,8 +1293,6 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
 
        tmio_mmc_enable_dma(host, true);
 
-       mmc_retune_needed(host->mmc);
-
        return 0;
 }
 EXPORT_SYMBOL_GPL(tmio_mmc_host_runtime_resume);