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

baozhu.liu posted 1 patch 5 days, 21 hours ago
drivers/mmc/core/mmc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[PATCH] mmc: Update the value of ios.drv_type at the location where fixed_drv_type is used
Posted by baozhu.liu 5 days, 21 hours ago
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.

Signed-off-by: baozhu.liu <lucas.liu@siengine.com>
---
 drivers/mmc/core/mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 05444ecf3909..773d496b856a 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -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
转发: [PATCH] mmc: Update the value of ios.drv_type at the location where fixed_drv_type is used
Posted by Liu Lucas/刘保柱 5 days, 2 hours ago
Due to the failure of the previous email transmission, I am forwarding it again.

-----邮件原件-----
发件人: baozhu.liu <lucas.liu@siengine.com> 
发送时间: 2026年6月2日 14:10
收件人: ulfh@kernel.org
抄送: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org; Liu Lucas/刘保柱 <lucas.liu@siengine.com>
主题: [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.

Signed-off-by: baozhu.liu <lucas.liu@siengine.com>
---
 drivers/mmc/core/mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 05444ecf3909..773d496b856a 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -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