diff mbox series

[V2,1/6] mmc: block: Do not lose cache flush during CQE error recovery

Message ID 20231103084720.6886-2-adrian.hunter@intel.com (mailing list archive)
State New
Headers show
Series mmc: block: Fixes for CQE error recovery recovery | expand

Commit Message

Adrian Hunter Nov. 3, 2023, 8:47 a.m. UTC
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(+)

Comments

Avri Altman Nov. 3, 2023, 10:18 a.m. UTC | #1
> 
> 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>
Reviewed-by: Avri Altman <avri.altman@wdc.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
diff mbox series

Patch

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);
 	}