From 8d0e8827901af29b61547b1c6d4daa590399ac1e Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Wed, 27 Oct 2021 09:50:53 +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 cc7cd5e7fd21..acf10c4ffea1 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -215,6 +215,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));