Skip to contentSkip to conversation

mmc: core: fix host controller programming for fixed driver type

PATCH In review Kamal Dasu 2 participants 2 messages Apr 23 – May 11 MMC, SD and SDIO

lore
Share & tools
lore

Kamal Dasu

author
#0 lore raw

PATCH v2 1/1 mmc: core: fix host controller programming for fixed driver type

When using the fixed-emmc-driver-type device tree property, the MMC core correctly selects the driver strength for the card but fails to program the host controller accordingly. This causes a mismatch where the card uses the specified driver type while the host controller defaults to Type B (since ios->drv_type remains zero).

Split the driver type programming logic to handle both fixed and dynamic driver type selection paths. For fixed driver types, program the host controller with the selected drive_strength value. For dynamic selection, use the existing drv_type as before.

This ensures both the eMMC device and host controller use matching driver strengths, preventing potential signal integrity issues.

Fixes 6186d06c519e ("mmc: parse new binding for eMMC fixed driver type")
---
 drivers/mmc/core/mmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/core/mmc.c +3 -1
index 8846550a8892..05444ecf3909 100644
@@ -1371,7 +1371,9 @@ static void mmc_select_driver_type(struct mmc_card *card)
 
 	card->drive_strength = drive_strength;
 
-	if (drv_type)
+	if (fixed_drv_type >= 0 && drive_strength)
+		mmc_set_driver_type(card->host, drive_strength);
+	else if (drv_type)
 		mmc_set_driver_type(card->host, drv_type);
 }
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 12 lines · Kamal Dasu

When using the fixed-emmc-driver-type device tree property, the MMC core correctly selects the driver strength for the card but fails to program the host controller accordingly. This causes a mismatch where the card uses the specified driver type while the host controller defaults to Type B (since ios->drv_type remains zero).

Split the driver type programming logic to handle both fixed and dynamic driver type selection paths. For fixed driver types, program the host controller with the selected drive_strength value. For dynamic selection, use the existing drv_type as before.

Quoted 6 lines

This ensures both the eMMC device and host controller use matching driver strengths, preventing potential signal integrity issues.

Fixes 6186d06c519e ("mmc: parse new binding for eMMC fixed driver type")

Applied for fixes and by adding stable tag, thanks!

Kind regards
Uffe

Quoted 22 lines
---
 drivers/mmc/core/mmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/core/mmc.c +3 -2
index 8846550a8892..05444ecf3909 100644
@@ -1371,7 +1371,9 @@ static void mmc_select_driver_type(struct mmc_card *card)
 
        card->drive_strength = drive_strength;
 
-       if (drv_type)
+       if (fixed_drv_type >= 0 && drive_strength)
+               mmc_set_driver_type(card->host, drive_strength);
+       else if (drv_type)
                mmc_set_driver_type(card->host, drv_type);
 }
 
--

2.34.1