From 2a53aab5cfa43065b2e979959d727332a8a03c03 Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Wed, 27 Oct 2021 09:55:12 +0800 Subject: [PATCH] mmc: dw_mmc-rockchip: Skip all phases bigger than 270 degrees Per design recommendation, it'd better not try to use any phase which is bigger than 270. Let's officially follow this. Change-Id: I8dee3eb648d321cc86e0926844cde528dbb5bd95 Signed-off-by: Shawn Lin --- drivers/mmc/host/dw_mmc-rockchip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index 265a1d7426a7..e04b90430211 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -211,6 +211,9 @@ static int dw_mci_rk3288_execute_tuning(struct dw_mci_slot *slot, u32 opcode) /* Try each phase and extract good ranges */ for (i = 0; i < priv->num_phases; ) { + /* Cannot guarantee any phases larger than 270 would work well */ + if (TUNING_ITERATION_TO_PHASE(i, priv->num_phases) > 270) + break; clk_set_phase(priv->sample_clk, TUNING_ITERATION_TO_PHASE(i, priv->num_phases));