]> Git Repo - J-linux.git/commitdiff
mmc: mmci: stm32: clear DLYB_CR after sending tuning command
authorYann Gautier <[email protected]>
Wed, 15 Dec 2021 14:17:26 +0000 (15:17 +0100)
committerUlf Hansson <[email protected]>
Tue, 21 Dec 2021 12:03:51 +0000 (13:03 +0100)
During test campaign, and especially after several unbind/bind sequences,
it has been seen that the SD-card on SDMMC1 thread could freeze.
The freeze always appear on a CMD23 following a CMD19.
Checking SDMMC internal registers shows that the tuning command (CMD19)
has failed.
The freeze is then due to the delay block involved in the tuning sequence.
To correct this, clear the delay block register DLYB_CR register after
the tuning commands.

Signed-off-by: Christophe Kerello <[email protected]>
Signed-off-by: Yann Gautier <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Fixes: 1103f807a3b9 ("mmc: mmci_sdmmc: Add execute tuning with delay block")
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ulf Hansson <[email protected]>
drivers/mmc/host/mmci_stm32_sdmmc.c

index fdaa11f92fe6f5c31901f85128d5b60c2191f3a5..a75d3dd34d18cb41f24f4f201613916a3110fb09 100644 (file)
@@ -441,6 +441,8 @@ static int sdmmc_dlyb_phase_tuning(struct mmci_host *host, u32 opcode)
                return -EINVAL;
        }
 
+       writel_relaxed(0, dlyb->base + DLYB_CR);
+
        phase = end_of_len - max_len / 2;
        sdmmc_dlyb_set_cfgr(dlyb, dlyb->unit, phase, false);
 
This page took 0.059804 seconds and 4 git commands to generate.