From: Linus Walleij Date: Fri, 16 Jun 2023 20:42:19 +0000 (+0200) Subject: mmc: mmci: Clear busy_status when starting command X-Git-Tag: block-6.5-2023-07-03~6^2~20 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=2673493fdfe78a1a8df1f802755cc2448ca98df6;p=linux-block.git mmc: mmci: Clear busy_status when starting command If we are starting a command which can generate a busy response, then clear the variable host->busy_status if the variant is using a ->busy_complete callback. We are lucky that the member is zero by default and hopefully always gets cleared in the ->busy_complete callback even on errors, but it's just fragile so make sure it is always initialized to zero. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-1-69a7164f2a61@linaro.org Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index f724bd0d2a61..267f88d9daec 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1238,6 +1238,7 @@ mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c) c |= host->variant->cmdreg_srsp; } + host->busy_status = 0; if (host->variant->busy_timeout && cmd->flags & MMC_RSP_BUSY) { if (!cmd->busy_timeout) cmd->busy_timeout = 10 * MSEC_PER_SEC;