From 5580a7e6f3c01bebe23f68dfd4c71c175b254caf Mon Sep 17 00:00:00 2001 From: Yifeng Zhao Date: Fri, 9 Jun 2023 10:01:47 +0800 Subject: [PATCH] mmc: dw_mmc-rockchip: fix v2 tuning defect The v2 tuning has a defect, When tuning again, it is possible to choose the phase that was previously selected which cannot work stable. Signed-off-by: Yifeng Zhao Change-Id: I0dcc83bb35567278e8a10f1964f4636573b165ec --- drivers/mmc/host/dw_mmc-rockchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index cdc97f85333e..d87ceb85c3ac 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -166,7 +166,7 @@ static int dw_mci_v2_execute_tuning(struct dw_mci_slot *slot, u32 opcode) * It's impossible all 4 fixed phase won't be able to work. */ for (i = 0; i < ARRAY_SIZE(degrees); i++) { - degree = degrees[i] + priv->last_degree; + degree = degrees[i] + priv->last_degree + 90; degree = degree % 360; clk_set_phase(priv->sample_clk, degree); if (!mmc_send_tuning(mmc, opcode, NULL)) @@ -179,7 +179,7 @@ static int dw_mci_v2_execute_tuning(struct dw_mci_slot *slot, u32 opcode) } done: - dev_info(host->dev, "Successfully tuned phase to %d\n", degrees[i]); + dev_info(host->dev, "Successfully tuned phase to %d\n", degree); priv->last_degree = degree; return 0; }