Skip to contentSkip to conversation

mmc: core: export emmc revision via sysfs

PATCH Superseded Jin Qian 2 participants 3 messages Mar 21, 2017 – Mar 23, 2017 MMC, SD and SDIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jin Qian

author
#0 lore raw

PATCH 1/1 mmc: core: export emmc revision via sysfs

Extend sysfs to access ext_csd revision information.

---
 drivers/mmc/core/mmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/core/mmc.c +2 -0
index 7fd722868875..08c62c9bec48 100644
@@ -779,6 +779,7 @@ MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid);
 MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name);
 MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
 MMC_DEV_ATTR(prv, "0x%x\n", card->cid.prv);
+MMC_DEV_ATTR(rev, "0x%x\n", card->ext_csd.rev);
 MMC_DEV_ATTR(pre_eol_info, "%02x\n", card->ext_csd.pre_eol_info);
 MMC_DEV_ATTR(life_time, "0x%02x 0x%02x\n",
 	card->ext_csd.device_life_time_est_typ_a,
@@ -836,6 +837,7 @@ static struct attribute *mmc_std_attrs[] = {
 	&dev_attr_name.attr,
 	&dev_attr_oemid.attr,
 	&dev_attr_prv.attr,
+	&dev_attr_rev.attr,
 	&dev_attr_pre_eol_info.attr,
 	&dev_attr_life_time.attr,
 	&dev_attr_serial.attr,
Signature · 1 line
2.12.1.500.gab5fba24ee-goog
#1 lore raw

Hi,

Quoted 4 lines · Jin Qian

Extend sysfs to access ext_csd revision information.

I think you can choose one of them for signed-off tag.

drivers/mmc/core/mmc.c MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid); · line 782

Quoted 13 lines
---
 drivers/mmc/core/mmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/core/mmc.c +1 -0
index 7fd722868875..08c62c9bec48 100644
@@ -779,6 +779,7 @@ MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid);
 MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name);
 MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
 MMC_DEV_ATTR(prv, "0x%x\n", card->cid.prv);
+MMC_DEV_ATTR(rev, "0x%x\n", card->ext_csd.rev);

I'm not sure but if someone want to know ext_csd revision information, attribute name might be more clearly. e,g) ext_csd_rev?

It's my preference. :)

Best Regards,
Jaehoon Chung

Quoted 12 lines
drivers/mmc/core/mmc.c +1 -0
 MMC_DEV_ATTR(pre_eol_info, "%02x\n", card->ext_csd.pre_eol_info);
 MMC_DEV_ATTR(life_time, "0x%02x 0x%02x\n",
 	card->ext_csd.device_life_time_est_typ_a,
@@ -836,6 +837,7 @@ static struct attribute *mmc_std_attrs[] = {
 	&dev_attr_name.attr,
 	&dev_attr_oemid.attr,
 	&dev_attr_prv.attr,
+	&dev_attr_rev.attr,
 	&dev_attr_pre_eol_info.attr,
 	&dev_attr_life_time.attr,
 	&dev_attr_serial.attr,
author
#2 lore raw

Removed redundant signoff.

export rev to collect some statistics on how many devices are running with which mmc revision.

Other attr name seems follow cid.<name> or ext_csd.<name>.

Thanks,
jin

Quoted 45 lines · Jaehoon Chung

Hi,

Quoted 4 lines · Jin Qian

Extend sysfs to access ext_csd revision information.

I think you can choose one of them for signed-off tag.

drivers/mmc/core/mmc.c MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid); · line 782

Quoted 13 lines
---
 drivers/mmc/core/mmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/core/mmc.c +1 -0
index 7fd722868875..08c62c9bec48 100644
@@ -779,6 +779,7 @@ MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid);
 MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name);
 MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
 MMC_DEV_ATTR(prv, "0x%x\n", card->cid.prv);
+MMC_DEV_ATTR(rev, "0x%x\n", card->ext_csd.rev);

I'm not sure but if someone want to know ext_csd revision information, attribute name might be more clearly. e,g) ext_csd_rev?

It's my preference. :)

Best Regards,
Jaehoon Chung

Quoted 12 lines
drivers/mmc/core/mmc.c +1 -0
 MMC_DEV_ATTR(pre_eol_info, "%02x\n", card->ext_csd.pre_eol_info);
 MMC_DEV_ATTR(life_time, "0x%02x 0x%02x\n",
      card->ext_csd.device_life_time_est_typ_a,
@@ -836,6 +837,7 @@ static struct attribute *mmc_std_attrs[] = {
      &dev_attr_name.attr,
      &dev_attr_oemid.attr,
      &dev_attr_prv.attr,
+     &dev_attr_rev.attr,
      &dev_attr_pre_eol_info.attr,
      &dev_attr_life_time.attr,
      &dev_attr_serial.attr,