From d0a0916a6d3999828e5afe50be4f3411c7fe94d0 Mon Sep 17 00:00:00 2001 From: Chuanxiao Dong Date: Mon, 20 Feb 2012 14:27:39 +0800 Subject: [PATCH] mmc: add a sysfs entry to show write reliability BZ: 24365 add a sysfs rel_set in /sys/block/mmcblk0/device/ to show the write reliability. If bit0 of rel_set is 1, then write reliability for user data area is enabled. Change-Id: I02700b7597499d5660b4ee46a781f6c2bb002b88 Signed-off-by: Chuanxiao Dong Reviewed-on: http://android.intel.com:8080/35851 Reviewed-by: Tang, Richard Tested-by: Sun, Jianhua Reviewed-by: buildbot Tested-by: buildbot --- drivers/mmc/core/mmc.c | 3 +++ include/linux/mmc/card.h | 1 + include/linux/mmc/mmc.h | 1 + 3 files changed, 5 insertions(+) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 5860e40..118ddd6 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -430,6 +430,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) ext_csd[EXT_CSD_BKOPS_EN]; } + card->ext_csd.rel_set = ext_csd[EXT_CSD_WR_REL_SET]; card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM]; card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; } @@ -521,6 +522,7 @@ out: return err; } +MMC_DEV_ATTR(rel_set, "0x%x\n", card->ext_csd.rel_set); MMC_DEV_ATTR(cid, "%08x%08x%08x%08x\n", card->raw_cid[0], card->raw_cid[1], card->raw_cid[2], card->raw_cid[3]); MMC_DEV_ATTR(csd, "%08x%08x%08x%08x\n", card->raw_csd[0], card->raw_csd[1], @@ -550,6 +552,7 @@ MMC_DEV_ATTR(sec_trim_mult, "%d\n", card->ext_csd.sec_trim_mult); MMC_DEV_ATTR(erase_group_def, "%d\n", card->ext_csd.erase_group_def); static struct attribute *mmc_std_attrs[] = { + &dev_attr_rel_set.attr, &dev_attr_cid.attr, &dev_attr_csd.attr, &dev_attr_date.attr, diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index aefb8c0..28c04cd 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -49,6 +49,7 @@ struct mmc_ext_csd { u8 sec_feature_support; u8 rel_sectors; u8 rel_param; + u8 rel_set; u8 part_config; u8 rst_n_function; unsigned int part_time; /* Units: ms */ diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index df088a1..c39cfd9 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h @@ -279,6 +279,7 @@ struct _mmc_csd { #define EXT_CSD_BKOPS_EN 163 /* R/W */ #define EXT_CSD_BKOPS_START 164 /* W */ #define EXT_CSD_WR_REL_PARAM 166 /* RO */ +#define EXT_CSD_WR_REL_SET 167 /* R/W */ #define EXT_CSD_RPMB_SIZE_MULT 168 /* R */ #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ #define EXT_CSD_PART_CONFIG 179 /* R/W */ -- 2.7.4