Skip to contentSkip to conversation

mmc: Update the value of ios.drv_type at the location where fixed_drv_type is used

PATCH New baozhu.liu 1 participant 2 messages Jun 2 – Jun 3 MMC, SD and SDIO

lore
Share & tools
lore

baozhu.liu

author
#0 lore raw

PATCH 1/1 mmc: Update the value of ios.drv_type at the location where fixed_drv_type is used

Modify the value of "fixed-emmc-driver-type" in the device tree, but when checking "cat /sys/kernel/debug/mmc/ios",
it is found that the driver type has not changed.
So, update the value of ios.drv_type at the location where fixed_drv_type is used.

---
 drivers/mmc/core/mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mmc/core/mmc.c +4 -3
index 05444ecf3909..773d496b856a 100644
@@ -1361,14 +1361,15 @@ static void mmc_select_driver_type(struct mmc_card *card)
 	card_drv_type = card->ext_csd.raw_driver_strength |
 			mmc_driver_type_mask(0);
 
-	if (fixed_drv_type >= 0)
+	if (fixed_drv_type >= 0) {
 		drive_strength = card_drv_type & mmc_driver_type_mask(fixed_drv_type)
 				 ? fixed_drv_type : 0;
-	else
+		card->host->ios.drv_type = drive_strength;
+	} else {
 		drive_strength = mmc_select_drive_strength(card,
 							   card->ext_csd.hs200_max_dtr,
 							   card_drv_type, &drv_type);
-
+	}
 	card->drive_strength = drive_strength;
 
 	if (fixed_drv_type >= 0 && drive_strength)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 mmc: Update the value of ios.drv_type at the location where fixed_drv_type is used

Due to the failure of the previous email transmission, I am forwarding it again.

-----邮件原件-----
发件人: baozhu.liu <[email protected]>
发送时间: 2026年6月2日 14:10
收件人: [email protected]
抄送: [email protected]; [email protected]; Liu Lucas/刘保柱 <[email protected]> 主题: [PATCH] mmc: Update the value of ios.drv_type at the location where fixed_drv_type is used

Modify the value of "fixed-emmc-driver-type" in the device tree, but when checking "cat /sys/kernel/debug/mmc/ios", it is found that the driver type has not changed. So, update the value of ios.drv_type at the location where fixed_drv_type is used.

---
 drivers/mmc/core/mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mmc/core/mmc.c +4 -3
@@ -1361,14 +1361,15 @@ static void mmc_select_driver_type(struct mmc_card *card)
 	card_drv_type = card->ext_csd.raw_driver_strength |
 			mmc_driver_type_mask(0);
 
-	if (fixed_drv_type >= 0)
+	if (fixed_drv_type >= 0) {
 		drive_strength = card_drv_type & mmc_driver_type_mask(fixed_drv_type)
 				 ? fixed_drv_type : 0;
-	else
+		card->host->ios.drv_type = drive_strength;
+	} else {
 		drive_strength = mmc_select_drive_strength(card,
 							   card->ext_csd.hs200_max_dtr,
 							   card_drv_type, &drv_type);
-
+	}
 	card->drive_strength = drive_strength;
 
 	if (fixed_drv_type >= 0 && drive_strength)

--
2.34.1