From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25BAD3D79 for ; Sun, 3 Dec 2023 12:54:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uq0CiR/t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E5FEC433C8; Sun, 3 Dec 2023 12:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1701608094; bh=IEV2jYJMCn90Z0Gaq4JR52RwhN5YJXBYGk6p9NLaJsw=; h=Subject:To:Cc:From:Date:From; b=uq0CiR/tptme9Xja8MVYL94On7XS/Iu7OsG87daeUw24TZv1waYzWytaCl17hbQXR D0eFUxK3/Af/nG0g43h7/UebhgcLOYjOS3YhUrfWkK0BnW+ItgOVdIonhFiXrDXcd2 Spj1QhmX8/KSnqym8QfjlrHu27uCtsmxWMHiwPkI= Subject: FAILED: patch "[PATCH] mmc: block: Retry commands in CQE error recovery" failed to apply to 5.4-stable tree To: adrian.hunter@intel.com,avri.altman@wdc.com,ulf.hansson@linaro.org Cc: From: Date: Sun, 03 Dec 2023 13:54:42 +0100 Message-ID: <2023120342-reason-dastardly-d7bf@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y git checkout FETCH_HEAD git cherry-pick -x 8155d1fa3a747baad5caff5f8303321d68ddd48c # git commit -s git send-email --to '' --in-reply-to '2023120342-reason-dastardly-d7bf@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^.. Possible dependencies: 8155d1fa3a74 ("mmc: block: Retry commands in CQE error recovery") 6b1dc6229aec ("mmc: core: convert comma to semicolon") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 8155d1fa3a747baad5caff5f8303321d68ddd48c Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Fri, 3 Nov 2023 10:47:18 +0200 Subject: [PATCH] mmc: block: Retry commands in CQE error recovery It is important that MMC_CMDQ_TASK_MGMT command to discard the queue is successful because otherwise a subsequent reset might fail to flush the cache first. Retry it and the previous STOP command. Fixes: 72a5af554df8 ("mmc: core: Add support for handling CQE requests") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Reviewed-by: Avri Altman Link: https://lore.kernel.org/r/20231103084720.6886-5-adrian.hunter@intel.com Signed-off-by: Ulf Hansson diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index befde2bd26d3..a8c17b4cd737 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -551,7 +551,7 @@ int mmc_cqe_recovery(struct mmc_host *host) cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; cmd.flags &= ~MMC_RSP_CRC; /* Ignore CRC */ cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT; - mmc_wait_for_cmd(host, &cmd, 0); + mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); mmc_poll_for_busy(host->card, MMC_CQE_RECOVERY_TIMEOUT, true, MMC_BUSY_IO); @@ -561,10 +561,13 @@ int mmc_cqe_recovery(struct mmc_host *host) cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; cmd.flags &= ~MMC_RSP_CRC; /* Ignore CRC */ cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT; - err = mmc_wait_for_cmd(host, &cmd, 0); + err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); host->cqe_ops->cqe_recovery_finish(host); + if (err) + err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); + mmc_retune_release(host); return err;