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 3/3] mmc: core: Default to generic_cmd6_time as timeout in __mmc_switch()
Date: Tue, 17 May 2022 11:32:07 -0700 [thread overview]
Message-ID: <20220517183207.258065-4-f.fainelli@gmail.com> (raw)
In-Reply-To: <20220517183207.258065-1-f.fainelli@gmail.com>
From: Ulf Hansson <ulf.hansson@linaro.org>
commit 533a6cfe08f96a7b5c65e06d20916d552c11b256 upstream
All callers of __mmc_switch() should now be specifying a valid timeout for
the CMD6 command. However, just to be sure, let's print a warning and
default to use the generic_cmd6_time in case the provided timeout_ms
argument is zero.
In this context, let's also simplify some of the corresponding code and
clarify some related comments.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20200122142747.5690-4-ulf.hansson@linaro.org
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
[kamal: Drop non-existent hunks in 4.9's __mmc_switch]
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/mmc/core/mmc_ops.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index ad6e9798e949..3d8907fc2a52 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -22,8 +22,6 @@
#include "host.h"
#include "mmc_ops.h"
-#define MMC_OPS_TIMEOUT_MS (10 * 60 * 1000) /* 10 minute timeout */
-
static const u8 tuning_blk_pattern_4bit[] = {
0xff, 0x0f, 0xff, 0x00, 0xff, 0xcc, 0xc3, 0xcc,
0xc3, 0x3c, 0xcc, 0xff, 0xfe, 0xff, 0xfe, 0xef,
@@ -530,8 +528,11 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
ignore_crc = false;
/* We have an unspecified cmd timeout, use the fallback value. */
- if (!timeout_ms)
- timeout_ms = MMC_OPS_TIMEOUT_MS;
+ if (!timeout_ms) {
+ pr_warn("%s: unspecified timeout for CMD6 - use generic\n",
+ mmc_hostname(host));
+ timeout_ms = card->ext_csd.generic_cmd6_time;
+ }
/* Must check status to be sure of no errors. */
timeout = jiffies + msecs_to_jiffies(timeout_ms) + 1;
--
2.25.1
prev parent 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 ` [PATCH stable 4.9 1/3] mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC Florian Fainelli
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 ` Florian Fainelli [this message]
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-4-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®