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>,
	"Kamal Dasu" <kdasu.kdev@gmail.com>,
	"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
Subject: [PATCH stable 4.9 1/3] mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC
Date: Tue, 17 May 2022 11:32:05 -0700	[thread overview]
Message-ID: <20220517183207.258065-2-f.fainelli@gmail.com> (raw)
In-Reply-To: <20220517183207.258065-1-f.fainelli@gmail.com>

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

commit 24ed3bd01d6a844fd5e8a75f48d0a3d10ed71bf9 upstream

The timeout values used while waiting for a CMD6 for BKOPS or a CACHE_FLUSH
to complete, are not defined by the eMMC spec. However, a timeout of 10
minutes as is currently being used, is just silly for both of these cases.
Instead, let's specify more reasonable timeouts, 120s for BKOPS and 30s for
CACHE_FLUSH.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20200122142747.5690-2-ulf.hansson@linaro.org
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
[kamal: Drop mmc_run_bkops hunk, non-existent]
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/mmc/core/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index f0fa6a799f7c..dfe55e9d729f 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -61,6 +61,8 @@
 /* The max erase timeout, used when host->max_busy_timeout isn't specified */
 #define MMC_ERASE_TIMEOUT_MS	(60 * 1000) /* 60 s */
 
+#define MMC_CACHE_FLUSH_TIMEOUT_MS     (30 * 1000) /* 30s */
+
 static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
 
 /*
@@ -2936,7 +2938,8 @@ int mmc_flush_cache(struct mmc_card *card)
 			(card->ext_csd.cache_size > 0) &&
 			(card->ext_csd.cache_ctrl & 1)) {
 		err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
-				EXT_CSD_FLUSH_CACHE, 1, 0);
+				EXT_CSD_FLUSH_CACHE, 1,
+				 MMC_CACHE_FLUSH_TIMEOUT_MS);
 		if (err)
 			pr_err("%s: cache flush error %d\n",
 					mmc_hostname(card->host), err);
-- 
2.25.1


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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 18:32 [PATCH stable 4.9 0/3] MMC timeout back ports Florian Fainelli
2022-05-17 18:32 ` Florian Fainelli [this message]
2022-05-17 18:32 ` [PATCH stable 4.9 2/3] mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD Florian Fainelli
2022-05-17 18:32 ` [PATCH stable 4.9 3/3] mmc: core: Default to generic_cmd6_time as timeout in __mmc_switch() Florian Fainelli

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=20220517183207.258065-2-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®