summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHai Pham <hai.pham.ud@renesas.com>2023-06-20 01:38:25 +0300
committerJaehoon Chung <jh80.chung@samsung.com>2023-07-18 03:17:23 +0300
commit99ab3d8dc45c184dcec692fd7130f8732e8c25e4 (patch)
tree3dabdcd51ff0a6a5ab14b513504c0a1d861e36d7 /drivers
parent0ac2cca3a447cbc59d714b1b35425b54283d153a (diff)
downloadu-boot-99ab3d8dc45c184dcec692fd7130f8732e8c25e4.tar.xz
mmc: renesas-sdhi: Send stop when MMC tuning command fails
When tuning command (CMD21) fails with command error, call mmc_send_stop_transmission() to send stop command (CMD12). Reviewed-by: Takeshi Kihara <takeshi.kihara.df@renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> [Marek: Add dev_dbg() message in case tuning abort fails Move tuning opcode check from mmc_abort_tuning()] Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/renesas-sdhi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c
index 280d96dbc2..8e716f7449 100644
--- a/drivers/mmc/renesas-sdhi.c
+++ b/drivers/mmc/renesas-sdhi.c
@@ -611,6 +611,17 @@ int renesas_sdhi_execute_tuning(struct udevice *dev, uint opcode)
priv->smpcmp |= BIT(i);
mdelay(1);
+
+ /*
+ * eMMC specification specifies that CMD12 can be used to stop a tuning
+ * command, but SD specification does not, so do nothing unless it is
+ * eMMC.
+ */
+ if (ret && (opcode == MMC_CMD_SEND_TUNING_BLOCK_HS200)) {
+ ret = mmc_send_stop_transmission(mmc, false);
+ if (ret < 0)
+ dev_dbg(dev, "Tuning abort fail (%d)\n", ret);
+ }
}
ret = renesas_sdhi_select_tuning(priv, taps);