Skip to content

Commit 0363b12

Browse files
diandersUlf Hansson
authored andcommitted
mmc: dw_mmc: cancel the CTO timer after a voltage switch
When running with the commit 03de192 ("mmc: dw_mmc: introduce timer for broken command transfer over scheme") I found this message in the log: Unexpected command timeout, state 7 It turns out that we weren't properly cancelling the new CTO timer in the case that a voltage switch was done. Let's promote the cancel into the dw_mci_cmd_interrupt() function to fix this. Fixes: 03de192 ("mmc: dw_mmc: introduce timer for broken command transfer over scheme") Tested-by: Emil Renner Berthing <kernel@esmil.dk> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 48e1dc1 commit 0363b12

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/mmc/host/dw_mmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2570,6 +2570,8 @@ static void dw_mci_write_data_pio(struct dw_mci *host)
25702570

25712571
static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status)
25722572
{
2573+
del_timer(&host->cto_timer);
2574+
25732575
if (!host->cmd_status)
25742576
host->cmd_status = status;
25752577

@@ -2662,7 +2664,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
26622664
}
26632665

26642666
if (pending & SDMMC_INT_CMD_DONE) {
2665-
del_timer(&host->cto_timer);
26662667
mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE);
26672668
dw_mci_cmd_interrupt(host, pending);
26682669
}

0 commit comments

Comments
 (0)