mmc: export sd3_bus_mode to user space
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
@@ -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
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_modeto 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
Signed-off-by Yangbo Lu <[email protected]>--- drivers/mmc/core/sd.c | 2 ++ 1 file changed, 2 insertions(+)drivers/mmc/core/sd.c +2
-1@@ -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
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: exportsd3_bus_modeto user spaceQuoted 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_modeto 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
Uffedrivers/mmc/core/sd.c MMC_DEV_ATTR(oemid, "0x%04x\n",
Quoted 11 lines
Signed-off-by Yangbo Lu <[email protected]>--- drivers/mmc/core/sd.c | 2 ++ 1 file changed, 2 insertions(+)drivers/mmc/core/sd.c +0
-0@@ -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
-0MMC_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
-1static 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
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: exportsd3_bus_modeto user spaceQuoted 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_modeto 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