All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: block: Fix CQE recovery reset success
@ 2022-05-31 17:19 Adrian Hunter
  2022-06-01 12:46 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Hunter @ 2022-05-31 17:19 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc

The intention of the use of mmc_blk_reset_success() in
mmc_blk_cqe_recovery() was to prevent repeated resets when retrying and
getting the same error. However, that may not be the case - any amount
of time and I/O may pass before another recovery is needed, in which
case there would be no reason to deny it the opportunity to recover via
a reset if necessary. CQE recovery is expected seldom and failure to
recover (if the clear tasks command fails), even more seldom, so it is
better to allow the reset always, which can be done by calling
mmc_blk_reset_success() always.

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

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 1259ca22d625..f4a1281658db 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1499,8 +1499,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq)
 	err = mmc_cqe_recovery(host);
 	if (err)
 		mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
-	else
-		mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
+	mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
 
 	pr_debug("%s: CQE recovery done\n", mmc_hostname(host));
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: block: Fix CQE recovery reset success
  2022-05-31 17:19 [PATCH] mmc: block: Fix CQE recovery reset success Adrian Hunter
@ 2022-06-01 12:46 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2022-06-01 12:46 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linux-mmc

On Tue, 31 May 2022 at 19:19, Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> The intention of the use of mmc_blk_reset_success() in
> mmc_blk_cqe_recovery() was to prevent repeated resets when retrying and
> getting the same error. However, that may not be the case - any amount
> of time and I/O may pass before another recovery is needed, in which
> case there would be no reason to deny it the opportunity to recover via
> a reset if necessary. CQE recovery is expected seldom and failure to
> recover (if the clear tasks command fails), even more seldom, so it is
> better to allow the reset always, which can be done by calling
> mmc_blk_reset_success() always.

Thanks for the explanation, this certainly makes sense to me too!

>
> Fixes: 1e8e55b67030c6 ("mmc: block: Add CQE support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>

Applied for fixes, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/core/block.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 1259ca22d625..f4a1281658db 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -1499,8 +1499,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq)
>         err = mmc_cqe_recovery(host);
>         if (err)
>                 mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
> -       else
> -               mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
> +       mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
>
>         pr_debug("%s: CQE recovery done\n", mmc_hostname(host));
>  }
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-01 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31 17:19 [PATCH] mmc: block: Fix CQE recovery reset success Adrian Hunter
2022-06-01 12:46 ` Ulf Hansson

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.