linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: mmc: Fix the timing for clock changing in mmc
@ 2020-02-12  2:42 Kyungmin Seo
  2020-03-04 11:08 ` Ulf Hansson
  0 siblings, 1 reply; 13+ messages in thread
From: Kyungmin Seo @ 2020-02-12  2:42 UTC (permalink / raw)
  To: ulf.hansson, kyungmin.seo; +Cc: linux-mmc, linux-kernel

The clock has to be changed after sending CMD6 for HS mode selection in
mmc_hs400_to_hs200() function.

The JEDEC 5.0 and 5.1 said that "High-speed" mode selection has to
enable the the high speed mode timing in the Device, before chaning the
clock frequency to a frequency between 26MHz and 52MHz.

Signed-off-by: Kyungmin Seo <kyungmin.seo@intel.com>
---
 drivers/mmc/core/mmc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 3486bc7fbb64..98640b51c73e 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1196,10 +1196,6 @@ 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,
@@ -1210,6 +1206,10 @@ int mmc_hs400_to_hs200(struct mmc_card *card)
 
 	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);
+
 	err = mmc_switch_status(card);
 	if (err)
 		goto out_err;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-03-11 14:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12  2:42 [PATCH] mmc: mmc: Fix the timing for clock changing in mmc Kyungmin Seo
2020-03-04 11:08 ` Ulf Hansson
2020-03-05  8:57   ` Seo, Kyungmin
2020-03-05 15:17     ` Ulf Hansson
2020-03-10  4:27       ` Seo, Kyungmin
2020-03-10  9:05         ` Ulf Hansson
2020-03-10 10:44           ` Adrian Hunter
2020-03-10 15:41             ` Ulf Hansson
2020-03-11  2:13               ` Chaotian Jing
2020-03-11  8:57                 ` Ulf Hansson
2020-03-11  9:59                   ` Adrian Hunter
2020-03-11 14:06                     ` Ulf Hansson
2020-03-11 14:43                       ` Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).