* [PATCH] mmc: dw_mmc: Read clk-phase DT settings earlier
@ 2026-11-12 16:16 Brandt, Oliver - Lenze
0 siblings, 0 replies; only message in thread
From: Brandt, Oliver - Lenze @ 2026-11-12 16:16 UTC (permalink / raw)
To: linux-mmc; +Cc: ulfh, jh80.chung, shawn.lin, linux-kernel
With a kernel 7.3.3 we saw the following on a SoCFPGA (Cyclone 5) based
board during initialization when using a high-speed SD-card:
dw_mmc ff704000.mmc: DW MMC controller at irq 53,32 bit host data width,1024 deep fifo
dw_mmc ff704000.mmc: Got CD GPIO
dw_mmc ff704000.mmc: Got WP GPIO
mmc_host mmc0: Bus speed = 50000000Hz (req 400000Hz, actual 396825HZ div = 63)
mmc_host mmc0: Bus speed = 50000000Hz (req 50000000Hz, actual 50000000HZ div = 0)
mmc0: error -110 whilst initialising SD card
mmc_host mmc0: Bus speed = 50000000Hz (req 300000Hz, actual 297619HZ div = 84)
mmc_host mmc0: Bus speed = 50000000Hz (req 50000000Hz, actual 50000000HZ div = 0)
mmc0: error -110 whilst initialising SD card
mmc_host mmc0: Bus speed = 50000000Hz (req 200000Hz, actual 200000HZ div = 125)
mmc_host mmc0: Bus speed = 50000000Hz (req 50000000Hz, actual 50000000HZ div = 0)
mmc0: error -110 whilst initialising SD card
mmc_host mmc0: Bus speed = 50000000Hz (req 100000Hz, actual 100000HZ div = 250)
mmc_host mmc0: Bus speed = 50000000Hz (req 50000000Hz, actual 50000000HZ div = 0)
mmc0: error -110 whilst initialising SD card
The SD-card was not usable in the following.
Reason: Since commit 3f1628baa51e ("mmc: dw_mmc-pltfm: Use phase_map for
SoCFPGA clock phase configuration") host->phase_map is used in order to
get the phase settings for MMC_TIMING_SD_HS. This is done in drv_data->init
(dw_mci_socfpga_priv_init()) which is called before dw_mci_init_host(). As
host->phase_map will be initialized only during dw_mci_init_host(), we'll
call dw_mci_socfpga_priv_init() without the needed data.
Calling mmc_of_parse_clk_phase() from dw_mci_parse_dt() instead of
dw_mci_init_host() ensures that we have valid data when calling
dw_mci_socfpga_priv_init()
Fixes: 3f1628baa51e ("mmc: dw_mmc-pltfm: Use phase_map for SoCFPGA clock phase configuration")
Fixes: 0d944576c99e ("mmc: dw_mmc: Add parsing mmc_clk_phase_map support")
Cc: stable@vger.kernel.org
Signed-off-by: Oliver Brandt <oliver.brandt@lenze.com>
---
- Replacement for obsolete patch; Sashiko has found a much simpler and
cleaner solution.
- Link to obsolete patch: https://lore.kernel.org/linux-mmc/140317dff0feb9d62b580b1e3170ccb10b8af181.camel@lenze.com/
drivers/mmc/host/dw_mmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index cf5cecc5491d5..cd44898d44f3c 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2850,8 +2850,6 @@ static int dw_mci_init_host(struct dw_mci *host)
if (ret)
return ret;
- mmc_of_parse_clk_phase(host->dev, &host->phase_map);
-
ret = dw_mci_init_host_caps(host);
if (ret)
return ret;
@@ -3143,6 +3141,8 @@ static int dw_mci_parse_dt(struct dw_mci *host)
if (!host->bus_hz && !device_property_read_u32(dev, "clock-frequency", &clock_frequency))
host->bus_hz = clock_frequency;
+ mmc_of_parse_clk_phase(host->dev, &host->phase_map);
+
if (drv_data && drv_data->parse_dt) {
ret = drv_data->parse_dt(host);
if (ret)
--
2.47.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-12 16:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 16:16 [PATCH] mmc: dw_mmc: Read clk-phase DT settings earlier Brandt, Oliver - Lenze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®