* [PATCH] mmc: core: Extend sysfs with OCR register
@ 2016-07-04 11:56 Bojan Prtvar
2016-07-04 14:13 ` Wolfram Sang
2016-07-06 16:21 ` Ulf Hansson
0 siblings, 2 replies; 7+ messages in thread
From: Bojan Prtvar @ 2016-07-04 11:56 UTC (permalink / raw)
To: linux-mmc
Cc: Jonathan Corbet, Ulf Hansson, Linus Walleij, Adrian Hunter,
Dong Aisheng, Wolfram Sang, Gwendal Grignou, Chaotian Jing,
linux-doc, linux-kernel
Make operation conditions register (OCR) easily accessible from user space.
Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
---
Documentation/mmc/mmc-dev-attrs.txt | 1 +
drivers/mmc/core/mmc.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/Documentation/mmc/mmc-dev-attrs.txt b/Documentation/mmc/mmc-dev-attrs.txt
index caa5557..8163eca 100644
--- a/Documentation/mmc/mmc-dev-attrs.txt
+++ b/Documentation/mmc/mmc-dev-attrs.txt
@@ -28,6 +28,7 @@ All attributes are read-only.
preferred_erase_size Preferred erase size
raw_rpmb_size_mult RPMB partition size
rel_sectors Reliable write sector count
+ ocr Operation Conditions Register
Note on Erase Size and Preferred Erase Size:
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 5d438ad..1848334 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -727,6 +727,7 @@ MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
+MMC_DEV_ATTR(ocr, "%08x\n", card->ocr);
static ssize_t mmc_fwrev_show(struct device *dev,
struct device_attribute *attr,
@@ -762,6 +763,7 @@ static struct attribute *mmc_std_attrs[] = {
&dev_attr_enhanced_area_size.attr,
&dev_attr_raw_rpmb_size_mult.attr,
&dev_attr_rel_sectors.attr,
+ &dev_attr_ocr.attr,
NULL,
};
ATTRIBUTE_GROUPS(mmc_std);
--
2.8.0.GIT
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] mmc: core: Extend sysfs with OCR register
2016-07-04 11:56 [PATCH] mmc: core: Extend sysfs with OCR register Bojan Prtvar
@ 2016-07-04 14:13 ` Wolfram Sang
2016-07-04 14:34 ` bojan prtvar
2016-07-06 16:21 ` Ulf Hansson
1 sibling, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2016-07-04 14:13 UTC (permalink / raw)
To: Bojan Prtvar
Cc: linux-mmc, Jonathan Corbet, Ulf Hansson, Linus Walleij,
Adrian Hunter, Dong Aisheng, Wolfram Sang, Gwendal Grignou,
Chaotian Jing, linux-doc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 293 bytes --]
Bojan,
On Mon, Jul 04, 2016 at 01:56:55PM +0200, Bojan Prtvar wrote:
> Make operation conditions register (OCR) easily accessible from user space.
>
> Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
You described "what" above. Can you add the "why", too?
Regards,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mmc: core: Extend sysfs with OCR register
2016-07-04 14:13 ` Wolfram Sang
@ 2016-07-04 14:34 ` bojan prtvar
2016-07-04 14:40 ` Wolfram Sang
0 siblings, 1 reply; 7+ messages in thread
From: bojan prtvar @ 2016-07-04 14:34 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-mmc, Jonathan Corbet, Ulf Hansson, Linus Walleij,
Adrian Hunter, Dong Aisheng, Wolfram Sang, Gwendal Grignou,
Chaotian Jing, linux-doc, open list
Hi,
On Mon, Jul 4, 2016 at 4:13 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>> Make operation conditions register (OCR) easily accessible from user space.
>>
> You described "what" above. Can you add the "why", too?
>
According to JEDEC v5.0 chapter 7 the OCR, CID and CSD registers carry
the Device/content specific information.
Registers CID and CSD are already exported through sysfs so let's make
this interface complete by adding missing OCR register.
Do I need to send v2 with updated change log?
Regards,
Bojan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mmc: core: Extend sysfs with OCR register
2016-07-04 14:34 ` bojan prtvar
@ 2016-07-04 14:40 ` Wolfram Sang
0 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2016-07-04 14:40 UTC (permalink / raw)
To: bojan prtvar
Cc: linux-mmc, Jonathan Corbet, Ulf Hansson, Linus Walleij,
Adrian Hunter, Dong Aisheng, Wolfram Sang, Gwendal Grignou,
Chaotian Jing, linux-doc, open list
[-- Attachment #1: Type: text/plain, Size: 244 bytes --]
> Registers CID and CSD are already exported through sysfs so let's make
> this interface complete by adding missing OCR register.
This sentence was missing for me, thanks.
> Do I need to send v2 with updated change log?
Ulf will tell us.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mmc: core: Extend sysfs with OCR register
2016-07-04 11:56 [PATCH] mmc: core: Extend sysfs with OCR register Bojan Prtvar
2016-07-04 14:13 ` Wolfram Sang
@ 2016-07-06 16:21 ` Ulf Hansson
2016-07-12 9:53 ` Ulf Hansson
1 sibling, 1 reply; 7+ messages in thread
From: Ulf Hansson @ 2016-07-06 16:21 UTC (permalink / raw)
To: Bojan Prtvar
Cc: linux-mmc, Jonathan Corbet, Linus Walleij, Adrian Hunter,
Dong Aisheng, Wolfram Sang, Gwendal Grignou, Chaotian Jing,
linux-doc, linux-kernel
On 4 July 2016 at 13:56, Bojan Prtvar <prtvar.b@gmail.com> wrote:
> Make operation conditions register (OCR) easily accessible from user space.
>
> Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
Thanks, applied for next! Amended the changelog with the explanation
why this change is wanted.
Kind regards
Uffe
> ---
> Documentation/mmc/mmc-dev-attrs.txt | 1 +
> drivers/mmc/core/mmc.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/Documentation/mmc/mmc-dev-attrs.txt b/Documentation/mmc/mmc-dev-attrs.txt
> index caa5557..8163eca 100644
> --- a/Documentation/mmc/mmc-dev-attrs.txt
> +++ b/Documentation/mmc/mmc-dev-attrs.txt
> @@ -28,6 +28,7 @@ All attributes are read-only.
> preferred_erase_size Preferred erase size
> raw_rpmb_size_mult RPMB partition size
> rel_sectors Reliable write sector count
> + ocr Operation Conditions Register
>
> Note on Erase Size and Preferred Erase Size:
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 5d438ad..1848334 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -727,6 +727,7 @@ MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
> MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
> MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
> MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
> +MMC_DEV_ATTR(ocr, "%08x\n", card->ocr);
>
> static ssize_t mmc_fwrev_show(struct device *dev,
> struct device_attribute *attr,
> @@ -762,6 +763,7 @@ static struct attribute *mmc_std_attrs[] = {
> &dev_attr_enhanced_area_size.attr,
> &dev_attr_raw_rpmb_size_mult.attr,
> &dev_attr_rel_sectors.attr,
> + &dev_attr_ocr.attr,
> NULL,
> };
> ATTRIBUTE_GROUPS(mmc_std);
> --
> 2.8.0.GIT
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mmc: core: Extend sysfs with OCR register
2016-07-06 16:21 ` Ulf Hansson
@ 2016-07-12 9:53 ` Ulf Hansson
2016-07-12 12:04 ` bojan prtvar
0 siblings, 1 reply; 7+ messages in thread
From: Ulf Hansson @ 2016-07-12 9:53 UTC (permalink / raw)
To: Bojan Prtvar
Cc: linux-mmc, Jonathan Corbet, Linus Walleij, Adrian Hunter,
Dong Aisheng, Wolfram Sang, Gwendal Grignou, Chaotian Jing,
linux-doc, linux-kernel
On 6 July 2016 at 18:21, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 4 July 2016 at 13:56, Bojan Prtvar <prtvar.b@gmail.com> wrote:
>> Make operation conditions register (OCR) easily accessible from user space.
>>
>> Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
>
> Thanks, applied for next! Amended the changelog with the explanation
> why this change is wanted.
I just realized that the OCR register is also available for SD cards.
Could you perhaps cook a patch which adds this to sysfs for SD cards as well!?
Kind regards
Uffe
>
> Kind regards
> Uffe
>
>> ---
>> Documentation/mmc/mmc-dev-attrs.txt | 1 +
>> drivers/mmc/core/mmc.c | 2 ++
>> 2 files changed, 3 insertions(+)
>>
>> diff --git a/Documentation/mmc/mmc-dev-attrs.txt b/Documentation/mmc/mmc-dev-attrs.txt
>> index caa5557..8163eca 100644
>> --- a/Documentation/mmc/mmc-dev-attrs.txt
>> +++ b/Documentation/mmc/mmc-dev-attrs.txt
>> @@ -28,6 +28,7 @@ All attributes are read-only.
>> preferred_erase_size Preferred erase size
>> raw_rpmb_size_mult RPMB partition size
>> rel_sectors Reliable write sector count
>> + ocr Operation Conditions Register
>>
>> Note on Erase Size and Preferred Erase Size:
>>
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 5d438ad..1848334 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -727,6 +727,7 @@ MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
>> MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
>> MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
>> MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
>> +MMC_DEV_ATTR(ocr, "%08x\n", card->ocr);
>>
>> static ssize_t mmc_fwrev_show(struct device *dev,
>> struct device_attribute *attr,
>> @@ -762,6 +763,7 @@ static struct attribute *mmc_std_attrs[] = {
>> &dev_attr_enhanced_area_size.attr,
>> &dev_attr_raw_rpmb_size_mult.attr,
>> &dev_attr_rel_sectors.attr,
>> + &dev_attr_ocr.attr,
>> NULL,
>> };
>> ATTRIBUTE_GROUPS(mmc_std);
>> --
>> 2.8.0.GIT
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mmc: core: Extend sysfs with OCR register
2016-07-12 9:53 ` Ulf Hansson
@ 2016-07-12 12:04 ` bojan prtvar
0 siblings, 0 replies; 7+ messages in thread
From: bojan prtvar @ 2016-07-12 12:04 UTC (permalink / raw)
To: Ulf Hansson
Cc: linux-mmc, Jonathan Corbet, Linus Walleij, Adrian Hunter,
Dong Aisheng, Wolfram Sang, Gwendal Grignou, Chaotian Jing,
linux-doc, linux-kernel
Hi Ulf,
On Tue, Jul 12, 2016 at 11:53 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> I just realized that the OCR register is also available for SD cards.
>
> Could you perhaps cook a patch which adds this to sysfs for SD cards as well!?
>
Sure. I'll do it tomorrow.
Regards,
Bojan
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-07-12 12:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-04 11:56 [PATCH] mmc: core: Extend sysfs with OCR register Bojan Prtvar
2016-07-04 14:13 ` Wolfram Sang
2016-07-04 14:34 ` bojan prtvar
2016-07-04 14:40 ` Wolfram Sang
2016-07-06 16:21 ` Ulf Hansson
2016-07-12 9:53 ` Ulf Hansson
2016-07-12 12:04 ` bojan prtvar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.