From: Marek Vasut Date: Thu, 14 Jul 2022 23:58:24 +0000 (+0200) Subject: mmc: Do not send status of send_status is false X-Git-Tag: baikal/mips/sdk5.8.2~5^2~255^2~10 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=39f74a37848621b25ee55787f6d80feb8868a5a8;p=uboot.git mmc: Do not send status of send_status is false Commit d8fefc8a1fd ("mmc: Fix mmc_switch excessive timeout") introduced a side effect where CMD13 SEND_STATUS is issued in case mmc_wait_dat0() does not return -ENOSYS and $send_status is not set. This happens on all hardware which does implement .mmc_wait_dat0 callback, e.g. i.MX8M . This leads to lengthy timeout before booting OS in case of eMMC in one of the HS200/HS400 modes, since the card cannot respond to CMD13 while downgrading from HS200/HS400 to regular HS mode. Fix this by adding the missing conditional. Fixes: d8fefc8a1fd ("mmc: Fix mmc_switch excessive timeout") Signed-off-by: Marek Vasut Cc: Jaehoon Chung Cc: Kirill Kapranov Cc: Marek BehĂșn Cc: Pantelis Antoniou Cc: Ye Li Reviewed-by: Jaehoon Chung --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 8efee9977e..0b7c0be8cb 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -831,6 +831,9 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value, return 0; } + if (!send_status) + return 0; + /* Finally wait until the card is ready or indicates a failure * to switch. It doesn't hurt to use CMD13 here even if send_status * is false, because by now (after 'timeout_ms' ms) the bus should be