Message ID | 20221020130123.4033218-1-vincent.whitchurch@axis.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp100103wrr; Thu, 20 Oct 2022 06:07:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5cyfz3r4OZBIsY4I5V5WbI5/TPgO/pPTWzRKxj7RzI857G+Bq4YLmep6BXNXJOpx4Qd4tX X-Received: by 2002:a17:907:2cca:b0:78d:ec48:ac29 with SMTP id hg10-20020a1709072cca00b0078dec48ac29mr10804591ejc.114.1666271278322; Thu, 20 Oct 2022 06:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666271278; cv=none; d=google.com; s=arc-20160816; b=q9Uef76wySSMjUQUZO8UKXY7Psdi7g/GGRIxC4nmhJ5x5PMTjISD56sW+Kg0Bec0f2 ZsCnwTG8PnpQjEarfkGXyNFK5JsUbz8rV2PtfO5e1lUDcIQge5xpnC98wlDfX03zJJCe ogjvmmoz86yw6prvxi4P3YYFh6D09O6+OQPP4mfqeCFtb/kYKMr3dGkyoiv+PnUypv61 Kt67NZJnOphcJOoY0fFbiQjL/ZYzQfrhD/ZPa7OSfF22Fdasb1hwbu346YTTZR6A0brg oz/lyEyIbTtiXpMIDP5b0rTdwLm+j6Ks8hR6C2ikKzzjjmYT6Y5VJm4wxYqsVsU7XZeK xlOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=yo6MjNIJsfBLy9yLm4TRzVtf2ChkEovWkPmV7TU4lco=; b=PlaaEvPGKPdp8NaF1yyJUOBdXVOTfuSrwySC75tLhRSMZ2cBxMZKv23/yx527o5eQd ozJ6mUgvlOpXN77bZeQpZllglMvyzgYZRaL7zVzLTRSpPW683eeHL5FHXX7HrtaYM90z WuvRWUWdv+w46aQtlUb4CRrfh9GusIDAB4Fw1NsDOe6lDG1+SaZc3fz/7+r5JMpsSh4A aeMdGKo7FK/Xwed2gYXUQhnK3o1sPimA/KRD9e6XAqk1dDuTWfPuehz2BsiZyY5tbUEh uRzBT/e+De9xaF3MbYx+kZed42NXYveHancgn98834ED9RQ7qgx1+vIpez8lXNQ3LE+K hPyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=XwSVqdy3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp18-20020a170906c15200b0078bec673145si16761016ejc.519.2022.10.20.06.07.30; Thu, 20 Oct 2022 06:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=XwSVqdy3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbiJTNBh (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Thu, 20 Oct 2022 09:01:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbiJTNBf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 20 Oct 2022 09:01:35 -0400 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 552224A81F; Thu, 20 Oct 2022 06:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1666270893; x=1697806893; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yo6MjNIJsfBLy9yLm4TRzVtf2ChkEovWkPmV7TU4lco=; b=XwSVqdy34S+YlO2GRtDLW1+5/2xsx/EWSG2ZRp1a+KA0vc3IVqmZ1u/u ThS2v1H2qD1/gaNUlWNm7I1PmHHXYoQHUXPqNeD1YGm9QatLlFoGgJ8xJ 6lHxXUoRMcWplY0VuW2LgyHxXslC2+DoDEhmkkUAVHk/kk0qp8N52t97i vbJudE2bi4wnFNSRcBx++Siu4S1TVoTurvPdNmLd6i4y3g5dQd9AUjiz5 6qVpKEp4d2zLxOjAtG5N9c6WUxtJ0kDfkO+t8p8uDIt4s2Uh6U2i/DSWh 5+PBZjCkO+qFrThK1nob6LSx2ssTOje/ec6luzlYWGcqYg5UNvnfZl+Xw g==; From: Vincent Whitchurch <vincent.whitchurch@axis.com> To: Ulf Hansson <ulf.hansson@linaro.org> CC: <kernel@axis.com>, Vincent Whitchurch <vincent.whitchurch@axis.com>, Jon Hunter <jonathanh@nvidia.com>, Avri Altman <Avri.Altman@wdc.com>, <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH] mmc: core: Fix WRITE_ZEROES CQE handling Date: Thu, 20 Oct 2022 15:01:23 +0200 Message-ID: <20221020130123.4033218-1-vincent.whitchurch@axis.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747212071895777671?= X-GMAIL-MSGID: =?utf-8?q?1747212071895777671?= |
Series |
mmc: core: Fix WRITE_ZEROES CQE handling
|
|
Commit Message
Vincent Whitchurch
Oct. 20, 2022, 1:01 p.m. UTC
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(+)
Comments
> 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
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 >
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;