public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: Change the enhanced area related sysfs output format
@ 2016-06-14  8:33 Beata Baranowska
  2016-06-14 10:12 ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Beata Baranowska @ 2016-06-14  8:33 UTC (permalink / raw)
  To: ulf.hansson, adrian.hunter, aisheng.dong, wsa+renesas, gwendal,
	chaotian.jing, linux-mmc, linux-kernel
  Cc: sebastianx.jarosz, beatax.baranowska, Chuanxiao Dong

From: Chuanxiao Dong <chuanxiao.dong@intel.com>

When the enhanced area feature was not enabled, the related sysfs will 
have -EINVAL(-22) value, so change the sysfs output format to display 
the correct value.

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
---
 drivers/mmc/core/mmc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 5d438ad3ee32..cc55253a5d47 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -722,9 +722,10 @@ 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(serial, "0x%08x\n", card->cid.serial);
-MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
+MMC_DEV_ATTR(enhanced_area_offset, "%lld\n",
 		card->ext_csd.enhanced_area_offset);
-MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
+MMC_DEV_ATTR(enhanced_area_size, "%d KBytes\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);
 
-- 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: Change the enhanced area related sysfs output format
  2016-06-14  8:33 [PATCH] mmc: Change the enhanced area related sysfs output format Beata Baranowska
@ 2016-06-14 10:12 ` Wolfram Sang
  2016-06-14 10:36   ` Adrian Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2016-06-14 10:12 UTC (permalink / raw)
  To: Beata Baranowska
  Cc: ulf.hansson, adrian.hunter, aisheng.dong, wsa+renesas, gwendal,
	chaotian.jing, linux-mmc, linux-kernel, sebastianx.jarosz,
	Chuanxiao Dong

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

On Tue, Jun 14, 2016 at 10:33:06AM +0200, Beata Baranowska wrote:
> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
> 
> When the enhanced area feature was not enabled, the related sysfs will 
> have -EINVAL(-22) value, so change the sysfs output format to display 
> the correct value.
> 
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>

What about introducing attribute_group an use the is_visible callback
there, so they won't get displayed at all?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: Change the enhanced area related sysfs output format
  2016-06-14 10:12 ` Wolfram Sang
@ 2016-06-14 10:36   ` Adrian Hunter
  2016-06-14 12:41     ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2016-06-14 10:36 UTC (permalink / raw)
  To: Wolfram Sang, Beata Baranowska
  Cc: ulf.hansson, aisheng.dong, wsa+renesas, gwendal, chaotian.jing,
	linux-mmc, linux-kernel, sebastianx.jarosz, Chuanxiao Dong

On 14/06/16 13:12, Wolfram Sang wrote:
> On Tue, Jun 14, 2016 at 10:33:06AM +0200, Beata Baranowska wrote:
>> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
>>
>> When the enhanced area feature was not enabled, the related sysfs will 
>> have -EINVAL(-22) value, so change the sysfs output format to display 
>> the correct value.
>>
>> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> 
> What about introducing attribute_group an use the is_visible callback
> there, so they won't get displayed at all?
> 

Except that it is an ABI:

	Documentation/ABI/testing/sysfs-devices-mmc

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: Change the enhanced area related sysfs output format
  2016-06-14 10:36   ` Adrian Hunter
@ 2016-06-14 12:41     ` Wolfram Sang
  2016-06-20  9:25       ` Baranowska, BeataX
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2016-06-14 12:41 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Beata Baranowska, ulf.hansson, aisheng.dong, wsa+renesas, gwendal,
	chaotian.jing, linux-mmc, linux-kernel, sebastianx.jarosz,
	Chuanxiao Dong

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

On Tue, Jun 14, 2016 at 01:36:11PM +0300, Adrian Hunter wrote:
> On 14/06/16 13:12, Wolfram Sang wrote:
> > On Tue, Jun 14, 2016 at 10:33:06AM +0200, Beata Baranowska wrote:
> >> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
> >>
> >> When the enhanced area feature was not enabled, the related sysfs will 
> >> have -EINVAL(-22) value, so change the sysfs output format to display 
> >> the correct value.
> >>
> >> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> > 
> > What about introducing attribute_group an use the is_visible callback
> > there, so they won't get displayed at all?
> > 
> 
> Except that it is an ABI:
> 
> 	Documentation/ABI/testing/sysfs-devices-mmc

And broken ever since if this patch is needed... that being said, I
don't really have a strong opinion on my suggestion. I see the file is
out there for >5 years.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] mmc: Change the enhanced area related sysfs output format
  2016-06-14 12:41     ` Wolfram Sang
@ 2016-06-20  9:25       ` Baranowska, BeataX
  0 siblings, 0 replies; 5+ messages in thread
From: Baranowska, BeataX @ 2016-06-20  9:25 UTC (permalink / raw)
  To: Wolfram Sang, Hunter, Adrian
  Cc: ulf.hansson@linaro.org, aisheng.dong@nxp.com,
	wsa+renesas@sang-engineering.com, gwendal@chromium.org,
	chaotian.jing@mediatek.com, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jarosz, SebastianX, Dong, Chuanxiao

> -----Original Message-----
> From: Wolfram Sang [mailto:wsa@the-dreams.de]
> Sent: Tuesday, June 14, 2016 2:41 PM
> To: Hunter, Adrian <adrian.hunter@intel.com>
> Cc: Baranowska, BeataX <beatax.baranowska@intel.com>;
> ulf.hansson@linaro.org; aisheng.dong@nxp.com; wsa+renesas@sang-
> engineering.com; gwendal@chromium.org; chaotian.jing@mediatek.com;
> linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org; Jarosz,
> SebastianX <sebastianx.jarosz@intel.com>; Dong, Chuanxiao
> <chuanxiao.dong@intel.com>
> Subject: Re: [PATCH] mmc: Change the enhanced area related sysfs output
> format
> 
> On Tue, Jun 14, 2016 at 01:36:11PM +0300, Adrian Hunter wrote:
> > On 14/06/16 13:12, Wolfram Sang wrote:
> > > On Tue, Jun 14, 2016 at 10:33:06AM +0200, Beata Baranowska wrote:
> > >> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
> > >>
> > >> When the enhanced area feature was not enabled, the related sysfs
> > >> will have -EINVAL(-22) value, so change the sysfs output format to
> > >> display the correct value.
> > >>
> > >> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> > >
> > > What about introducing attribute_group an use the is_visible
> > > callback there, so they won't get displayed at all?
> > >
> >
> > Except that it is an ABI:
> >
> > 	Documentation/ABI/testing/sysfs-devices-mmc
> 
> And broken ever since if this patch is needed... that being said, I don't really
> have a strong opinion on my suggestion. I see the file is out there for >5
> years.

When functionality was implemented for situation when enhanced area is not enabled the value 0 was being used.
After someone's suggestion 0 was changed into -ENIVAL. Variables are still unsigned. 
This patch was to change displaying part from unsigned into signed but you are right it should be investigated.

I think we could:
- use 0 instead of -ENIVAL and then leave variables unsigned as it is,
- change variables and printfs into signed
- or leave it unchanged as the file is out there for >5

Please let me know your suggestions if the update of the patch is appreciated.

Beata

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-20  9:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-14  8:33 [PATCH] mmc: Change the enhanced area related sysfs output format Beata Baranowska
2016-06-14 10:12 ` Wolfram Sang
2016-06-14 10:36   ` Adrian Hunter
2016-06-14 12:41     ` Wolfram Sang
2016-06-20  9:25       ` Baranowska, BeataX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox