Skip to content

Commit e10c321

Browse files
Carlo Caionestorulf
authored andcommitted
mmc: core: Enable tuning according to the actual timing
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]>
1 parent f5abc76 commit e10c321

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
@@ -638,9 +638,9 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
638638
* SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
639639
*/
640640
if (!mmc_host_is_spi(card->host) &&
641-
(card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
642-
card->sd_bus_speed == UHS_DDR50_BUS_SPEED ||
643-
card->sd_bus_speed == UHS_SDR104_BUS_SPEED)) {
641+
(card->host->ios.timing == MMC_TIMING_UHS_SDR50 ||
642+
card->host->ios.timing == MMC_TIMING_UHS_DDR50 ||
643+
card->host->ios.timing == MMC_TIMING_UHS_SDR104)) {
644644
err = mmc_execute_tuning(card);
645645

646646
/*
@@ -650,7 +650,7 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
650650
* difference between v3.00 and 3.01 spec means that CMD19
651651
* tuning is also available for DDR50 mode.
652652
*/
653-
if (err && card->sd_bus_speed == UHS_DDR50_BUS_SPEED) {
653+
if (err && card->host->ios.timing == MMC_TIMING_UHS_DDR50) {
654654
pr_warn("%s: ddr50 tuning failed\n",
655655
mmc_hostname(card->host));
656656
err = 0;

drivers/mmc/core/sdio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card)
535535
* SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
536536
*/
537537
if (!mmc_host_is_spi(card->host) &&
538-
((card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR50) ||
539-
(card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR104)))
538+
((card->host->ios.timing == MMC_TIMING_UHS_SDR50) ||
539+
(card->host->ios.timing == MMC_TIMING_UHS_SDR104)))
540540
err = mmc_execute_tuning(card);
541541
out:
542542
return err;

0 commit comments

Comments
 (0)