All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: "Ulf Hansson" <ulf.hansson@linaro.org>,
	"Kornel Dulęba" <korneld@chromium.org>,
	"Radoslaw Biernacki" <biernacki@google.com>,
	"Gwendal Grignou" <gwendal@chromium.org>,
	"Ritesh Harjani" <riteshh@codeaurora.org>,
	"Asutosh Das" <quic_asutoshd@quicinc.com>
Cc: Chaotian Jing <chaotian.jing@mediatek.com>,
	Aswath Govindraju <a-govindraju@ti.com>,
	Bhavya Kapoor <b-kapoor@ti.com>,
	Kamal Dasu <kamal.dasu@broadcom.com>,
	Al Cooper <alcooperx@gmail.com>, Haibo Chen <haibo.chen@nxp.com>,
	Bhupesh Sharma <bhupesh.sharma@linaro.org>,
	Shaik Sajida Bhanu <quic_c_sbhanu@quicinc.com>,
	Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>,
	Swati Agarwal <swati.agarwal@amd.com>,
	Victor Shih <victor.shih@genesyslogic.com.tw>,
	Ben Chuang <ben.chuang@genesyslogic.com.tw>,
	Thierry Reding <thierry.reding@gmail.com>,
	Aniruddha Tvs Rao <anrao@nvidia.com>,
	Chun-Hung Wu <chun-hung.wu@mediatek.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] mmc: block: Do not lose cache flush during CQE error recovery
Date: Wed,  1 Nov 2023 09:38:23 +0200	[thread overview]
Message-ID: <20231101073827.4772-2-adrian.hunter@intel.com> (raw)
In-Reply-To: <20231101073827.4772-1-adrian.hunter@intel.com>

During CQE error recovery, error-free data commands get requeued if there
is any data left to transfer, but non-data commands are completed even
though they have not been processed.  Requeue them instead.

Note the only non-data command is cache flush, which would have resulted in
a cache flush being lost if it was queued at the time of CQE recovery.

Fixes: 1e8e55b67030 ("mmc: block: Add CQE support")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/core/block.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 3a8f27c3e310..4a32b756b7d8 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1482,6 +1482,8 @@ static void mmc_blk_cqe_complete_rq(struct mmc_queue *mq, struct request *req)
 			blk_mq_requeue_request(req, true);
 		else
 			__blk_mq_end_request(req, BLK_STS_OK);
+	} else if (mq->in_recovery) {
+		blk_mq_requeue_request(req, true);
 	} else {
 		blk_mq_end_request(req, BLK_STS_OK);
 	}
-- 
2.34.1


  reply	other threads:[~2023-11-01  7:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01  7:38 [PATCH 0/5] mmc: block: Fixes for CQE error recovery recovery Adrian Hunter
2023-11-01  7:38 ` Adrian Hunter [this message]
2023-11-01  7:38 ` [PATCH 2/5] mmc: cqhci: Increase recovery halt timeout Adrian Hunter
2023-11-01  7:38 ` [PATCH 3/5] mmc: block: Be sure to wait while busy in CQE error recovery Adrian Hunter
2023-11-01  7:38 ` [PATCH 4/5] mmc: block: Retry commands " Adrian Hunter
2023-11-01  7:38 ` [PATCH 5/5] mmc: cqhci: Warn of halt or task clear failure Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231101073827.4772-2-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=a-govindraju@ti.com \
    --cc=alcooperx@gmail.com \
    --cc=anrao@nvidia.com \
    --cc=b-kapoor@ti.com \
    --cc=ben.chuang@genesyslogic.com.tw \
    --cc=bhupesh.sharma@linaro.org \
    --cc=biernacki@google.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=gwendal@chromium.org \
    --cc=haibo.chen@nxp.com \
    --cc=kamal.dasu@broadcom.com \
    --cc=korneld@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=quic_asutoshd@quicinc.com \
    --cc=quic_c_sbhanu@quicinc.com \
    --cc=riteshh@codeaurora.org \
    --cc=sai.krishna.potthuri@amd.com \
    --cc=swati.agarwal@amd.com \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=victor.shih@genesyslogic.com.tw \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.