Skip to content

Commit 2a048a2

Browse files
Carlo Caionesashalevin
authored andcommitted
mmc: core: Enable tuning according to the actual timing
[ Upstream commit e10c321 ] While in sdhci_execute_tuning() the choice whether or not to enable the tuning is done on the actual timing, in the mmc_sdio_init_uhs_card() the check is done on the capability of the card. This difference is causing some issues with some SDIO cards in DDR50 mode where the CDM19 is wrongly issued. With this patch we modify the check in both mmc_(sd|sdio)_init_uhs_card() functions to take the proper decision only according to the actual timing specification. Cc: [email protected] Signed-off-by: Carlo Caione <[email protected]> Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 6e1e9bd commit 2a048a2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/mmc/core/sd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,9 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
661661
* SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
662662
*/
663663
if (!mmc_host_is_spi(card->host) &&
664-
(card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
665-
card->sd_bus_speed == UHS_DDR50_BUS_SPEED ||
666-
card->sd_bus_speed == UHS_SDR104_BUS_SPEED)) {
664+
(card->host->ios.timing == MMC_TIMING_UHS_SDR50 ||
665+
card->host->ios.timing == MMC_TIMING_UHS_DDR50 ||
666+
card->host->ios.timing == MMC_TIMING_UHS_SDR104)) {
667667
err = mmc_execute_tuning(card);
668668

669669
/*
@@ -673,7 +673,7 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
673673
* difference between v3.00 and 3.01 spec means that CMD19
674674
* tuning is also available for DDR50 mode.
675675
*/
676-
if (err && card->sd_bus_speed == UHS_DDR50_BUS_SPEED) {
676+
if (err && card->host->ios.timing == MMC_TIMING_UHS_DDR50) {
677677
pr_warn("%s: ddr50 tuning failed\n",
678678
mmc_hostname(card->host));
679679
err = 0;

drivers/mmc/core/sdio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card)
566566
* SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
567567
*/
568568
if (!mmc_host_is_spi(card->host) &&
569-
((card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR50) ||
570-
(card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR104)))
569+
((card->host->ios.timing == MMC_TIMING_UHS_SDR50) ||
570+
(card->host->ios.timing == MMC_TIMING_UHS_SDR104)))
571571
err = mmc_execute_tuning(card);
572572
out:
573573
return err;

0 commit comments

Comments
 (0)