[PATCH] mmc: dw_mmc-rockchip: fix training on devices with internal phases
Alexis Bauvin
alexis at bauvin.com
Sat Nov 14 03:40:03 PST 2026
> Le 14/11/2026 10:09 CET, Shawn Lin <shawn.lin at rock-chips.com> a écrit :
>
>
> Hi
>
> 在 2026/11/11 星期三 4:00, Alexis Bauvin 写道:
> > Controllers with internal phases don't need the "ciu-drive" and
> > "ciu-sample" clocks, and recent versions don't have them at all. Tuning
> > expects those clocks to be filled when it is not necessary, and fails on
> > devices which don't need them.
> >
> > Fixes eMMC training on such device by not requiring the clocks when they
> > are internal to the controller, as they are not populated anymore on
> > devices using the RK3576 compatible strings.
> >
> > This has been tested on an RK3506 on the 6.12 branch from
> > linux-rockchip.
> >
>
> I don't know for which tree this patch will be applied? 6.12 stable?
> For now, sample_clk and drv_clk are NULL in such case, so IS_ERR check
> failed.
Thanks for looking more into this. And, indeed, those are both NULL. Somehow,
when doing my kernel upgrades from 6.1 to 6.12, I ended up with those
containing an error value.
I rebuilt everything fresh and this patch is in fact not needed. I must have
had a stale device tree somewhere pointing at the 3288 DT parsing.
Sorry for the noise, and thanks for your time!
Regards,
Alexis
> > Fixes: 73abb1f16e ("mmc: dw_mmc-rockchip: Add support for rk3576 SoCs")
> > Signed-off-by: Alexis Bauvin <alexis at bauvin.com>
> > ---
> > drivers/mmc/host/dw_mmc-rockchip.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
> > index a134be59601d..d3158ab05aa1 100644
> > --- a/drivers/mmc/host/dw_mmc-rockchip.c
> > +++ b/drivers/mmc/host/dw_mmc-rockchip.c
> > @@ -354,7 +354,7 @@ static int dw_mci_rk3288_execute_tuning(struct dw_mci_slot *slot, u32 opcode)
> > int middle_phase;
> > int phase;
> >
> > - if (IS_ERR(priv->sample_clk)) {
> > + if (IS_ERR(priv->sample_clk) && !priv->internal_phase) {
> > dev_err(host->dev, "Tuning clock (sample_clk) not defined.\n");
> > return -EIO;
> > }
More information about the Linux-rockchip
mailing list