linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: core: Fix WRITE_ZEROES CQE handling
@ 2022-10-20 13:01 Vincent Whitchurch
  2022-10-20 13:03 ` Avri Altman
  2022-10-24 17:15 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Vincent Whitchurch @ 2022-10-20 13:01 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: kernel, Vincent Whitchurch, Jon Hunter, Avri Altman, linux-mmc,
	linux-kernel

WRITE_ZEROES requests use TRIM, so mark them as needing to be issued
synchronously even when a CQE is being used.  Without this,
mmc_blk_mq_issue_rq() triggers a WARN_ON_ONCE() and fails the request
since we don't have any handling for issuing this asynchronously.

Fixes: f7b6fc327327 ("mmc: core: Support zeroout using TRIM for eMMC")
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---
 drivers/mmc/core/queue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index fefaa901b50f..3661ba0bbc87 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -48,6 +48,7 @@ static enum mmc_issue_type mmc_cqe_issue_type(struct mmc_host *host,
 	case REQ_OP_DRV_OUT:
 	case REQ_OP_DISCARD:
 	case REQ_OP_SECURE_ERASE:
+	case REQ_OP_WRITE_ZEROES:
 		return MMC_ISSUE_SYNC;
 	case REQ_OP_FLUSH:
 		return mmc_cqe_can_dcmd(host) ? MMC_ISSUE_DCMD : MMC_ISSUE_SYNC;
-- 
2.28.0


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

* RE: [PATCH] mmc: core: Fix WRITE_ZEROES CQE handling
  2022-10-20 13:01 [PATCH] mmc: core: Fix WRITE_ZEROES CQE handling Vincent Whitchurch
@ 2022-10-20 13:03 ` Avri Altman
  2022-10-24 17:15 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Avri Altman @ 2022-10-20 13:03 UTC (permalink / raw)
  To: Vincent Whitchurch, Ulf Hansson
  Cc: kernel, Jon Hunter, linux-mmc, linux-kernel

> WRITE_ZEROES requests use TRIM, so mark them as needing to be issued
> synchronously even when a CQE is being used.  Without this,
> mmc_blk_mq_issue_rq() triggers a WARN_ON_ONCE() and fails the request
> since we don't have any handling for issuing this asynchronously.
> 
> Fixes: f7b6fc327327 ("mmc: core: Support zeroout using TRIM for eMMC")
> Reported-by: Jon Hunter <jonathanh@nvidia.com>
> Tested-by: Jon Hunter <jonathanh@nvidia.com>
> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>

> ---
>  drivers/mmc/core/queue.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index
> fefaa901b50f..3661ba0bbc87 100644
> --- a/drivers/mmc/core/queue.c
> +++ b/drivers/mmc/core/queue.c
> @@ -48,6 +48,7 @@ static enum mmc_issue_type
> mmc_cqe_issue_type(struct mmc_host *host,
>         case REQ_OP_DRV_OUT:
>         case REQ_OP_DISCARD:
>         case REQ_OP_SECURE_ERASE:
> +       case REQ_OP_WRITE_ZEROES:
>                 return MMC_ISSUE_SYNC;
>         case REQ_OP_FLUSH:
>                 return mmc_cqe_can_dcmd(host) ? MMC_ISSUE_DCMD :
> MMC_ISSUE_SYNC;
> --
> 2.28.0


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

* Re: [PATCH] mmc: core: Fix WRITE_ZEROES CQE handling
  2022-10-20 13:01 [PATCH] mmc: core: Fix WRITE_ZEROES CQE handling Vincent Whitchurch
  2022-10-20 13:03 ` Avri Altman
@ 2022-10-24 17:15 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2022-10-24 17:15 UTC (permalink / raw)
  To: Vincent Whitchurch
  Cc: kernel, Jon Hunter, Avri Altman, linux-mmc, linux-kernel

On Thu, 20 Oct 2022 at 15:01, Vincent Whitchurch
<vincent.whitchurch@axis.com> wrote:
>
> WRITE_ZEROES requests use TRIM, so mark them as needing to be issued
> synchronously even when a CQE is being used.  Without this,
> mmc_blk_mq_issue_rq() triggers a WARN_ON_ONCE() and fails the request
> since we don't have any handling for issuing this asynchronously.
>
> Fixes: f7b6fc327327 ("mmc: core: Support zeroout using TRIM for eMMC")
> Reported-by: Jon Hunter <jonathanh@nvidia.com>
> Tested-by: Jon Hunter <jonathanh@nvidia.com>
> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe

> ---
>  drivers/mmc/core/queue.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
> index fefaa901b50f..3661ba0bbc87 100644
> --- a/drivers/mmc/core/queue.c
> +++ b/drivers/mmc/core/queue.c
> @@ -48,6 +48,7 @@ static enum mmc_issue_type mmc_cqe_issue_type(struct mmc_host *host,
>         case REQ_OP_DRV_OUT:
>         case REQ_OP_DISCARD:
>         case REQ_OP_SECURE_ERASE:
> +       case REQ_OP_WRITE_ZEROES:
>                 return MMC_ISSUE_SYNC;
>         case REQ_OP_FLUSH:
>                 return mmc_cqe_can_dcmd(host) ? MMC_ISSUE_DCMD : MMC_ISSUE_SYNC;
> --
> 2.28.0
>

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

end of thread, other threads:[~2022-10-24 18:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 13:01 [PATCH] mmc: core: Fix WRITE_ZEROES CQE handling Vincent Whitchurch
2022-10-20 13:03 ` Avri Altman
2022-10-24 17:15 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).