[PATCH] mmc: dw_mmc-rockchip: fix training on devices with internal phases
Shawn Lin
shawn.lin at rock-chips.com
Sat Nov 14 01:09:02 PST 2026
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.
> 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