All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: linux-mmc@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	Chaotian Jing <chaotian.jing@mediatek.com>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	mirq-linux@rere.qmqm.pl
Subject: [PATCH 2/3] mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD
Date: Wed, 22 Jan 2020 15:27:46 +0100	[thread overview]
Message-ID: <20200122142747.5690-3-ulf.hansson@linaro.org> (raw)
In-Reply-To: <20200122142747.5690-1-ulf.hansson@linaro.org>

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>
---
 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 95b41c0891d0..663d87924e5e 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1107,7 +1107,7 @@ static void mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
 					 card->erase_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, card->erase_arg);
@@ -1149,7 +1149,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;
 	}
@@ -1167,7 +1167,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.17.1


  parent reply	other threads:[~2020-01-22 14:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 14:27 [PATCH 0/3] mmc: core: Update timeouts for __mmc_switch() Ulf Hansson
2020-01-22 14:27 ` [PATCH 1/3] mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC Ulf Hansson
2020-01-22 14:27 ` Ulf Hansson [this message]
2020-01-22 14:27 ` [PATCH 3/3] mmc: core: Default to generic_cmd6_time as timeout in __mmc_switch() Ulf Hansson
2021-02-22 16:24   ` Paul Fertser
2021-02-22 20:12     ` Paul Fertser
2021-02-23  9:23       ` Ulf Hansson
2021-02-23  9:32         ` Paul Fertser
2021-02-23 10:44           ` Ulf Hansson
2021-02-23 11:01           ` Adrian Hunter
2021-02-23 11:19             ` Paul Fertser
2021-02-23 11:54               ` Ulf Hansson
2021-02-23 13:42                 ` Adrian Hunter
2021-02-24 11:09                   ` Ulf Hansson
2021-03-03  9:26                     ` [PATCH] mmc: mmc: Fix partition switch time Adrian Hunter
2021-03-04 13:50                       ` Ulf Hansson
2020-01-24 11:25 ` [PATCH 0/3] mmc: core: Update timeouts for __mmc_switch() Ulf Hansson

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=20200122142747.5690-3-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=shawn.lin@rock-chips.com \
    /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 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.