From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
Chaotian Jing <chaotian.jing@mediatek.com>,
Kyungmin Seo <kyungmin.seo@intel.com>
Cc: linux-mmc <linux-mmc@vger.kernel.org>
Subject: [PATCH RFC 3/3] mmc: core: Do not change frequency before switch from HS400
Date: Thu, 12 Mar 2020 16:25:01 +0200 [thread overview]
Message-ID: <20200312142501.9868-4-adrian.hunter@intel.com> (raw)
In-Reply-To: <20200312142501.9868-1-adrian.hunter@intel.com>
Do not change frequency before switch from HS400 but in case of error
try again after frequency change.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/core/mmc.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 3e2ad728b55e..e2b3d7505d6c 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1235,20 +1235,27 @@ int mmc_hs400_to_hs200(struct mmc_card *card)
int err;
u8 val;
- /* Reduce frequency to HS */
- max_dtr = card->ext_csd.hs_max_dtr;
- mmc_set_clock(host, max_dtr);
-
/* Switch HS400 to HS DDR */
val = EXT_CSD_TIMING_HS;
err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING,
val, card->ext_csd.generic_cmd6_time, 0,
false, true, true);
- if (err)
- goto out_err;
mmc_set_timing(host, MMC_TIMING_MMC_DDR52);
+ /* Reduce frequency to HS */
+ max_dtr = card->ext_csd.hs_max_dtr;
+ mmc_set_clock(host, max_dtr);
+
+ if (err) {
+ err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+ EXT_CSD_HS_TIMING, val,
+ card->ext_csd.generic_cmd6_time, 0, false,
+ true, true);
+ }
+ if (err)
+ goto out_err;
+
err = mmc_switch_status(card, true);
if (err)
goto out_err;
--
2.17.1
next prev parent reply other threads:[~2020-03-12 14:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-12 14:24 [PATCH RFC 0/3] mmc: core: Do not change frequency before switch from HS400 Adrian Hunter
2020-03-12 14:24 ` [PATCH RFC 1/3] mmc: core: Try harder if transfer mode switch fails Adrian Hunter
2020-03-12 15:45 ` Ulf Hansson
2020-03-13 9:52 ` Adrian Hunter
2020-03-13 10:40 ` Ulf Hansson
2020-03-13 14:07 ` Adrian Hunter
2020-03-12 14:25 ` [PATCH RFC 2/3] mmc: core: Do not check CRC response for switch from HS400 to HS200 Adrian Hunter
2020-03-12 16:02 ` Ulf Hansson
2020-03-12 14:25 ` Adrian Hunter [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-03-12 14:24 [PATCH RFC 0/3] mmc: core: Do not change frequency before switch from HS400 Adrian Hunter
2020-03-12 14:24 ` [PATCH RFC 3/3] " Adrian Hunter
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=20200312142501.9868-4-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--cc=chaotian.jing@mediatek.com \
--cc=kyungmin.seo@intel.com \
--cc=linux-mmc@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 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.