Skip to contentSkip to conversation

mmc: export sd3_bus_mode to user space

PATCH In review Yangbo Lu 2 participants 4 messages Nov 2, 2020 – Nov 17, 2020 MMC, SD and SDIO

lore
Share & tools
lore

Yangbo Lu

author
#0 lore raw

PATCH 1/1 mmc: export sd3_bus_mode to user space

There was no way for user to know what UHS-I modes the SD card supporting. We might not know, even the highest speed mode failed to use and fell back to a lower speed mode.

This patch is to export sd3_bus_mode to user space to check.

---
 drivers/mmc/core/sd.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/core/sd.c +2 -0
index 6f054c4..13409c2 100644
@@ -689,6 +689,7 @@ MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
 MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
 MMC_DEV_ATTR(ocr, "0x%08x\n", card->ocr);
 MMC_DEV_ATTR(rca, "0x%04x\n", card->rca);
+MMC_DEV_ATTR(sd3_bus_mode, "0x%08x\n", card->sw_caps.sd3_bus_mode);
 
 
 static ssize_t mmc_dsr_show(struct device *dev,
@@ -753,6 +754,7 @@ static struct attribute *sd_std_attrs[] = {
 	&dev_attr_ocr.attr,
 	&dev_attr_rca.attr,
 	&dev_attr_dsr.attr,
+	&dev_attr_sd3_bus_mode.attr,
 	NULL,
 };
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · Yangbo Lu

There was no way for user to know what UHS-I modes the SD card supporting. We might not know, even the highest speed mode failed to use and fell back to a lower speed mode.

This patch is to export sd3_bus_mode to user space to check.

Well, even if the user would know, what can it do about it?

Sound like you are looking for some debugging feature instead?

Kind regards
Uffe

Quoted 29 lines
---
 drivers/mmc/core/sd.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/core/sd.c +2 -1
index 6f054c4..13409c2 100644
@@ -689,6 +689,7 @@ MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
 MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
 MMC_DEV_ATTR(ocr, "0x%08x\n", card->ocr);
 MMC_DEV_ATTR(rca, "0x%04x\n", card->rca);
+MMC_DEV_ATTR(sd3_bus_mode, "0x%08x\n", card->sw_caps.sd3_bus_mode);
 
 
 static ssize_t mmc_dsr_show(struct device *dev,
@@ -753,6 +754,7 @@ static struct attribute *sd_std_attrs[] = {
        &dev_attr_ocr.attr,
        &dev_attr_rca.attr,
        &dev_attr_dsr.attr,
+       &dev_attr_sd3_bus_mode.attr,
        NULL,
 };
 
--

2.7.4

author
#2 lore raw

Hi Uffe,

Quoted 9 lines

-----Original Message-----
From: Ulf Hansson <[email protected]>
Sent: Monday, November 16, 2020 7:27 PM
To: Y.b. Lu <[email protected]>
Cc: [email protected]; Adrian Hunter <[email protected]>
Subject: Re: [PATCH] mmc: export sd3_bus_mode to user space

Quoted 1 line · Yangbo Lu
Quoted 7 lines
Quoted 5 lines

There was no way for user to know what UHS-I modes the SD card supporting. We might not know, even the highest speed mode failed to use and fell back to a lower speed mode.

This patch is to export sd3_bus_mode to user space to check.

Well, even if the user would know, what can it do about it?

For user, they can check the card speed modes capability, if they want to know.
For developer, they can know whether card is working on highest speed mode as expect. If not, they know there is issue needed checking.

Quoted 2 lines

Sound like you are looking for some debugging feature instead?

Yes. I think we may need a way to know whether SD card is working on the highest speed mode as expect. Otherwise, we are not able to realize issue if card just fall back to a lower speed mode to work. Any suggestion on this?

Thanks a lot.

Quoted 35 lines

Kind regards
Uffe

drivers/mmc/core/sd.c MMC_DEV_ATTR(oemid, "0x%04x\n",

Quoted 11 lines
---
 drivers/mmc/core/sd.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/core/sd.c +0 -0
index 6f054c4..13409c2 100644
@@ -689,6 +689,7 @@ MMC_DEV_ATTR(oemid, "0x%04x\n",

card->cid.oemid);

drivers/mmc/core/sd.c MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);

Quoted 4 lines
drivers/mmc/core/sd.c +1 -0
 MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
 MMC_DEV_ATTR(ocr, "0x%08x\n", card->ocr);
 MMC_DEV_ATTR(rca, "0x%04x\n", card->rca);
+MMC_DEV_ATTR(sd3_bus_mode, "0x%08x\n",

card->sw_caps.sd3_bus_mode);

Quoted 14 lines
drivers/mmc/core/sd.c +1 -1
 static ssize_t mmc_dsr_show(struct device *dev,
@@ -753,6 +754,7 @@ static struct attribute *sd_std_attrs[] = {
        &dev_attr_ocr.attr,
        &dev_attr_rca.attr,
        &dev_attr_dsr.attr,
+       &dev_attr_sd3_bus_mode.attr,
        NULL,
 };
 
--

2.7.4

#3 lore raw
Quoted 24 lines · Y.b. Lu

Hi Uffe,

Quoted 9 lines

-----Original Message-----
From: Ulf Hansson <[email protected]>
Sent: Monday, November 16, 2020 7:27 PM
To: Y.b. Lu <[email protected]>
Cc: [email protected]; Adrian Hunter <[email protected]>
Subject: Re: [PATCH] mmc: export sd3_bus_mode to user space

Quoted 1 line · Yangbo Lu
Quoted 7 lines
Quoted 5 lines

There was no way for user to know what UHS-I modes the SD card supporting. We might not know, even the highest speed mode failed to use and fell back to a lower speed mode.

This patch is to export sd3_bus_mode to user space to check.

Well, even if the user would know, what can it do about it?

For user, they can check the card speed modes capability, if they want to know.
For developer, they can know whether card is working on highest speed mode as expect. If not, they know there is issue needed checking.

Quoted 1 line
Quoted 7 lines
Quoted 1 line

Sound like you are looking for some debugging feature instead?

Yes. I think we may need a way to know whether SD card is working on the highest speed mode as expect. Otherwise, we are not able to realize issue if card just fall back to a lower speed mode to work. Any suggestion on this?

Thanks a lot.

Well, perhaps we should look into extending the debugfs node for the card. See mmc_add_card_debugfs().

[...]

Kind regards
Uffe