Linux Power Management development
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Chanwoo Choi <cw00.choi@samsung.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	rafael.j.wysocki@intel.com, myungjoo.ham@samsung.com,
	kyungmin.park@samsung.com, chanwoo@kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v3] PM / devfreq: Add new name attribute for sysfs
Date: Mon, 25 Nov 2019 09:50:39 +0100	[thread overview]
Message-ID: <20191125085039.GA2301674@kroah.com> (raw)
In-Reply-To: <20191125010357.27153-1-cw00.choi@samsung.com>

On Mon, Nov 25, 2019 at 10:03:57AM +0900, Chanwoo Choi wrote:
> The commit 4585fbcb5331 ("PM / devfreq: Modify the device name as devfreq(X) for
> sysfs") changed the node name to devfreq(x). After this commit, it is not
> possible to get the device name through /sys/class/devfreq/devfreq(X)/*.
> 
> Add new name attribute in order to get device name.
> 
> Cc: stable@vger.kernel.org
> Fixes: 4585fbcb5331 ("PM / devfreq: Modify the device name as devfreq(X) for sysfs")
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  Changes from v2:
> - Change the order of name_show() according to the sequence in devfreq_attrs[]
> 
> Changes from v1:
> - Update sysfs-class-devfreq documentation
> - Show device name directly from 'devfreq->dev.parent'
> 

Shouldn't you just revert the original patch here?  Why did the sysfs
file change?

> Documentation/ABI/testing/sysfs-class-devfreq | 7 +++++++
>  drivers/devfreq/devfreq.c                     | 9 +++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-devfreq b/Documentation/ABI/testing/sysfs-class-devfreq
> index 01196e19afca..75897e2fde43 100644
> --- a/Documentation/ABI/testing/sysfs-class-devfreq
> +++ b/Documentation/ABI/testing/sysfs-class-devfreq
> @@ -7,6 +7,13 @@ Description:
>  		The name of devfreq object denoted as ... is same as the
>  		name of device using devfreq.
>  
> +What:		/sys/class/devfreq/.../name
> +Date:		November 2019
> +Contact:	Chanwoo Choi <cw00.choi@samsung.com>
> +Description:
> +		The /sys/class/devfreq/.../name shows the name of device
> +		of the corresponding devfreq object.
> +
>  What:		/sys/class/devfreq/.../governor
>  Date:		September 2011
>  Contact:	MyungJoo Ham <myungjoo.ham@samsung.com>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 65a4b6cf3fa5..6f4d93d2a651 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -1169,6 +1169,14 @@ int devfreq_remove_governor(struct devfreq_governor *governor)
>  }
>  EXPORT_SYMBOL(devfreq_remove_governor);
>  
> +static ssize_t name_show(struct device *dev,
> +			struct device_attribute *attr, char *buf)
> +{
> +	struct devfreq *devfreq = to_devfreq(dev);
> +	return sprintf(buf, "%s\n", dev_name(devfreq->dev.parent));

Why is the parent's name being set here, and not the device name?

The device name should be the name of the directory, and the parent's
name is the name of the parent directory, why is a sysfs attribute for a
name needed at all?

confused,

greg k-h

  reply	other threads:[~2019-11-25  8:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20191125005755epcas1p2404d0f095e6ce543d36e55e2427282f8@epcas1p2.samsung.com>
2019-11-25  1:03 ` [PATCH v3] PM / devfreq: Add new name attribute for sysfs Chanwoo Choi
2019-11-25  8:50   ` Greg KH [this message]
2019-11-26  3:08     ` Chanwoo Choi
2019-11-26  7:53       ` Greg KH
2019-11-26  8:35         ` Chanwoo Choi
2019-11-26  9:15           ` Greg KH
2019-11-26  9:37             ` Chanwoo Choi

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=20191125085039.GA2301674@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=chanwoo@kernel.org \
    --cc=cw00.choi@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stable@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