mmc: dw_mmc-rockchip: fix tuning return incorrect value in certain situations

When V2 tuning returns an error, it is necessary to reset
the ret to 0, otherwise the incorrect value will be returned.

log:
[    4.935664] mmc0: tuning execution failed: -5

Fixes: 795e052cc8 ("mmc: dw_mmc-rockchip: add v2 tuning support")
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I54a77e02255d88114191e8abc434856b34768715
This commit is contained in:
Yifeng Zhao
2023-08-16 09:46:33 +08:00
committed by Tao Huang
parent 0b2afcfc6d
commit 53d54c4a71

View File

@@ -174,7 +174,7 @@ static int dw_mci_v2_execute_tuning(struct dw_mci_slot *slot, u32 opcode)
}
if (i == ARRAY_SIZE(degrees)) {
dev_warn(host->dev, "All phases bad!");
dev_warn(host->dev, "V2 All phases bad!");
return -EIO;
}
@@ -208,8 +208,7 @@ static int dw_mci_rk3288_execute_tuning(struct dw_mci_slot *slot, u32 opcode)
}
if (priv->use_v2_tuning) {
ret = dw_mci_v2_execute_tuning(slot, opcode);
if (!ret)
if (!dw_mci_v2_execute_tuning(slot, opcode))
return 0;
/* Otherwise we continue using fine tuning */
}