mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: stable@vger.kernel.org
Cc: "Ulf Hansson" <ulf.hansson@linaro.org>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Avri Altman" <avri.altman@wdc.com>,
	"Bean Huo" <beanhuo@micron.com>,
	"Nishad Kamdar" <nishadkamdar@gmail.com>,
	"Christian Löhle" <CLoehle@hyperstone.com>,
	linux-mmc@vger.kernel.org (open list:MULTIMEDIA CARD (MMC),
	SECURE DIGITAL (SD) AND...),
	linux-kernel@vger.kernel.org (open list),
	alcooperx@gmail.com, kdasu.kdev@gmail.com
Subject: [PATCH stable 4.19 2/3] mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD
Date: Tue, 17 May 2022 11:22:10 -0700	[thread overview]
Message-ID: <20220517182211.249775-3-f.fainelli@gmail.com> (raw)
In-Reply-To: <20220517182211.249775-1-f.fainelli@gmail.com>

From: Ulf Hansson <ulf.hansson@linaro.org>

commit ad91619aa9d78ab1c6d4a969c3db68bc331ae76c upstream

The INAND_CMD38_ARG_EXT_CSD is a vendor specific EXT_CSD register, which is
used to prepare an erase/trim operation. However, it doesn't make sense to
use a timeout of 10 minutes while updating the register, which becomes the
case when the timeout_ms argument for mmc_switch() is set to zero.

Instead, let's use the generic_cmd6_time, as that seems like a reasonable
timeout to use for these cases.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20200122142747.5690-3-ulf.hansson@linaro.org
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/mmc/core/block.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 630f3bcba56d..f7379c3473e1 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1133,7 +1133,7 @@ static void mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
 					 arg == MMC_TRIM_ARG ?
 					 INAND_CMD38_ARG_TRIM :
 					 INAND_CMD38_ARG_ERASE,
-					 0);
+					 card->ext_csd.generic_cmd6_time);
 		}
 		if (!err)
 			err = mmc_erase(card, from, nr, arg);
@@ -1175,7 +1175,7 @@ static void mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
 				 arg == MMC_SECURE_TRIM1_ARG ?
 				 INAND_CMD38_ARG_SECTRIM1 :
 				 INAND_CMD38_ARG_SECERASE,
-				 0);
+				 card->ext_csd.generic_cmd6_time);
 		if (err)
 			goto out_retry;
 	}
@@ -1193,7 +1193,7 @@ static void mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
 			err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
 					 INAND_CMD38_ARG_EXT_CSD,
 					 INAND_CMD38_ARG_SECTRIM2,
-					 0);
+					 card->ext_csd.generic_cmd6_time);
 			if (err)
 				goto out_retry;
 		}
-- 
2.25.1


  parent reply	other threads:[~2022-05-17 18:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 18:22 [PATCH stable 4.19 0/3] MMC timeout back ports Florian Fainelli
2022-05-17 18:22 ` [PATCH stable 4.19 1/3] mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC Florian Fainelli
2022-05-17 18:22 ` Florian Fainelli [this message]
2022-05-17 18:22 ` [PATCH stable 4.19 3/3] mmc: core: Default to generic_cmd6_time as timeout in __mmc_switch() Florian Fainelli
2022-05-19 17:38 ` [PATCH stable 4.19 0/3] MMC timeout back ports Florian Fainelli
2022-05-19 19:04   ` Florian Fainelli
2022-05-21 14:40     ` Greg Kroah-Hartman

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=20220517182211.249775-3-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=CLoehle@hyperstone.com \
    --cc=adrian.hunter@intel.com \
    --cc=alcooperx@gmail.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kdasu.kdev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=nishadkamdar@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®