mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: core: fix host controller programming for fixed driver type
@ 2026-04-17 21:02 Kamal Dasu
  2026-04-21  2:02 ` Shawn Lin
  0 siblings, 1 reply; 2+ messages in thread
From: Kamal Dasu @ 2026-04-17 21:02 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Wolfram Sang, Avri Altman, Florian Fainelli,
	bcm-kernel-feedback-list, linux-mmc, linux-kernel, 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.

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")
Signed-off-by: Kamal Dasu <kamal.dasu@broadcom.com>
---
 drivers/mmc/core/mmc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 8846550a8892..3507a8d8610a 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1371,8 +1371,12 @@ static void mmc_select_driver_type(struct mmc_card *card)
 
 	card->drive_strength = drive_strength;
 
-	if (drv_type)
+	if (fixed_drv_type >= 0) {
+		if (drive_strength)
+			mmc_set_driver_type(card->host, drive_strength);
+	} else if (drv_type) {
 		mmc_set_driver_type(card->host, drv_type);
+	}
 }
 
 static int mmc_select_hs400es(struct mmc_card *card)
-- 
2.34.1


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

end of thread, other threads:[~2026-04-21  2:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-17 21:02 [PATCH] mmc: core: fix host controller programming for fixed driver type Kamal Dasu
2026-04-21  2:02 ` Shawn Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®