From: Greg KH <gregkh@linuxfoundation.org>
To: Stanislav Nijnikov <Stanislav.Nijnikov@wdc.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"jaegeuk@kernel.org" <jaegeuk@kernel.org>,
Alex Lemberg <Alex.Lemberg@wdc.com>
Subject: Re: [PATCH v4 01/10] ufs: sysfs: attribute group for existing sysfs entries.
Date: Sun, 4 Feb 2018 13:33:43 +0100 [thread overview]
Message-ID: <20180204123343.GA940@kroah.com> (raw)
In-Reply-To: <DM2PR0401MB097509D74E03449B0FA616249AFF0@DM2PR0401MB0975.namprd04.prod.outlook.com>
On Sun, Feb 04, 2018 at 12:29:06PM +0000, Stanislav Nijnikov wrote:
> > > + curr_len += snprintf((buf + curr_len), (PAGE_SIZE - curr_len),
> > > + "\nAll available Runtime PM levels info:\n");
> > > + for (lvl = UFS_PM_LVL_0; lvl < UFS_PM_LVL_MAX; lvl++)
> > > + curr_len += snprintf((buf + curr_len), (PAGE_SIZE - curr_len),
> > > + "\tRuntime PM level [%d] => dev_state
> > [%s] link_state [%s]\n",
> > > + lvl,
> > > + ufschd_ufs_dev_pwr_mode_to_string(
> > > + ufs_pm_lvl_states[lvl].dev_state),
> > > + ufschd_uic_link_state_to_string(
> > > + ufs_pm_lvl_states[lvl].link_state));
> > > +
> >
> > sysfs if "one value per file", not "random text that someone has to parse per
> > file" please.
> >
> > Huge hint, if you ever care about checking the size of the sysfs buffer you are
> > writing into, you are doing something really really wrong.
> >
> Hi Greg
> It's the existing code, added by:
> commit 09690d5a6ae1b7e4cb5ac429c311b99d09352c12
> Author: subhashj@codeaurora.org <subhashj@codeaurora.org>
> Date: Thu Dec 22 18:41:00 2016 -0800
>
> scsi: ufs: provide sysfs attribute to select the PM level
>
> This patch provides the sysfs attribute to choose the power management
> level for UFS runtime and system suspend.
>
> Reviewed-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
>
> I just moved it to an another file and changed the sysfs entries creation by
> Jaegeuk Kim' request. At the moment the entry shows the PM level, the device
> state, the link state and all possible PM levels. Do you want me to change it?
Ah, you are just moving this code around. Ok, that's fine for this
patch, but please fix it up as part of this patch series because this
isn't an acceptable sysfs file at all. If it were documented that would
be a lot more obvious as to just how wrong it was :(
And, as it wasn't documented, you can change it as it's obvious no one
used it :)
thanks,
greg k-h
next prev parent reply other threads:[~2018-02-04 12:33 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 16:15 [PATCH v4 00/10] ufs: sysfs: read-only access to device descriptors, attributes and flags Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 01/10] ufs: sysfs: attribute group for existing sysfs entries Stanislav Nijnikov
2018-02-01 16:59 ` Greg KH
2018-02-04 12:29 ` Stanislav Nijnikov
2018-02-04 12:33 ` Greg KH [this message]
2018-02-04 13:09 ` Stanislav Nijnikov
2018-02-04 13:15 ` Greg KH
2018-02-01 16:15 ` [PATCH v4 02/10] ufs: sysfs: device descriptor Stanislav Nijnikov
2018-02-01 17:00 ` Greg KH
2018-02-02 0:25 ` Bart Van Assche
2018-02-02 7:17 ` gregkh
2018-02-02 16:32 ` Bart Van Assche
2018-02-04 9:03 ` Stanislav Nijnikov
2018-02-04 10:44 ` gregkh
2018-02-02 0:29 ` Bart Van Assche
2018-02-01 16:15 ` [PATCH v4 03/10] ufs: sysfs: interconnect descriptor Stanislav Nijnikov
2018-02-01 17:01 ` Greg KH
2018-02-01 16:15 ` [PATCH v4 04/10] ufs: sysfs: geometry descriptor Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 05/10] ufs: sysfs: health descriptor Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 06/10] ufs: sysfs: power descriptor Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 07/10] ufs: sysfs: string descriptors Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 08/10] ufs: sysfs: unit descriptor Stanislav Nijnikov
2018-02-02 0:38 ` Bart Van Assche
2018-02-01 16:15 ` [PATCH v4 09/10] ufs: sysfs: flags Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 10/10] ufs: sysfs: attributes Stanislav Nijnikov
2018-02-01 17:03 ` Greg KH
2018-02-01 16:48 ` [PATCH v4 00/10] ufs: sysfs: read-only access to device descriptors, attributes and flags Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180204123343.GA940@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Alex.Lemberg@wdc.com \
--cc=Stanislav.Nijnikov@wdc.com \
--cc=jaegeuk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).