linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] PM / devfreq: Update the devfreq and devfreq-event device
       [not found] <CGME20170116122609epcas5p34b6109202b5bc05f13325318d0f2dbe3@epcas5p3.samsung.com>
@ 2017-01-16 12:26 ` Chanwoo Choi
       [not found]   ` <CGME20170116122609epcas5p3268841ebbf85523a32297bba7b6c321f@epcas5p3.samsung.com>
                     ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Chanwoo Choi @ 2017-01-16 12:26 UTC (permalink / raw)
  To: linux-pm; +Cc: myungjoo.ham, kyungmin.park, cw00.choi, rjw, linux-kernel

This patches update the devfreq and devfreq-event device. I add the summary
of each patch as following.
- Patch1 fixes the wrong description of governor_userspace.c.
- Patch2 show the information of registered PPMU devices.
- Patch3/4 modify the name of sysfs entry for devfreq/devfreq-event device

Changes from v2:
(https://lkml.org/lkml/2016/12/28/102)
- On v2 patchset, patch1/2/3/5 were merged on devfreq git repo.
- Remain the warning message for exynos-ppmu.c when failed to get the clock of ppmu
- Rebase these patches on devfreq git repo[1].

Changes from v1:
- Rebase these patches on v4.10-rc1.
- Include the separate patch[2] in these patches.

[1] https://git.kernel.org/cgit/linux/kernel/git/mzx/devfreq.git/ (branch: for-4.10-rc)
[2] https://lkml.org/lkml/2016/12/16/7
- [PATCH] PM / devfreq: Fix the wrong description for userspace governor

Chanwoo Choi (4):
  PM / devfreq: Fix the wrong description for userspace governor
  PM / devfreq: exynos-ppmu: Show the registred device for ppmu device
  PM / devfreq: Simplify the sysfs name of devfreq-event device
  PM / devfreq: Modify the device name as devfreq[X] for sysfs

 drivers/devfreq/devfreq-event.c      | 2 +-
 drivers/devfreq/devfreq.c            | 4 +++-
 drivers/devfreq/event/exynos-ppmu.c  | 3 +++
 drivers/devfreq/governor_userspace.c | 3 +--
 4 files changed, 8 insertions(+), 4 deletions(-)

-- 
1.9.1

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

* [PATCH v3 1/4] PM / devfreq: Fix the wrong description for userspace governor
       [not found]   ` <CGME20170116122609epcas5p3268841ebbf85523a32297bba7b6c321f@epcas5p3.samsung.com>
@ 2017-01-16 12:26     ` Chanwoo Choi
  0 siblings, 0 replies; 8+ messages in thread
From: Chanwoo Choi @ 2017-01-16 12:26 UTC (permalink / raw)
  To: linux-pm; +Cc: myungjoo.ham, kyungmin.park, cw00.choi, rjw, linux-kernel

This patch fixes the wrong description of governor_userspace.c
and removes the unneeded blank line.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/governor_userspace.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c
index 9db4d6f2006a..176976068bcd 100644
--- a/drivers/devfreq/governor_userspace.c
+++ b/drivers/devfreq/governor_userspace.c
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/devfreq/governor_simpleondemand.c
+ *  linux/drivers/devfreq/governor_userspace.c
  *
  *  Copyright (C) 2011 Samsung Electronics
  *	MyungJoo Ham <myungjoo.ham@samsung.com>
@@ -50,7 +50,6 @@ static ssize_t store_freq(struct device *dev, struct device_attribute *attr,
 	unsigned long wanted;
 	int err = 0;
 
-
 	mutex_lock(&devfreq->lock);
 	data = devfreq->data;
 
-- 
1.9.1

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

* [PATCH v3 2/4] PM / devfreq: exynos-ppmu: Show the registred device for ppmu device
       [not found]   ` <CGME20170116122609epcas5p37255926620af7c0db7373bb8d08a756c@epcas5p3.samsung.com>
@ 2017-01-16 12:26     ` Chanwoo Choi
  0 siblings, 0 replies; 8+ messages in thread
From: Chanwoo Choi @ 2017-01-16 12:26 UTC (permalink / raw)
  To: linux-pm
  Cc: myungjoo.ham, kyungmin.park, cw00.choi, rjw, linux-kernel,
	Kukjin Kim, Krzysztof Kozlowski, Javier Martinez Canillas,
	linux-arm-kernel, linux-samsung-soc

This patch just adds the simple log to show the PPMU device's registration
during the kernel booting.

Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/event/exynos-ppmu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
index fb3706faf5bd..9b7350935b73 100644
--- a/drivers/devfreq/event/exynos-ppmu.c
+++ b/drivers/devfreq/event/exynos-ppmu.c
@@ -643,6 +643,9 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
 				"failed to add devfreq-event device\n");
 			return PTR_ERR(edev[i]);
 		}
+
+		pr_info("exynos-ppmu: new PPMU device registered %s (%s)\n",
+			dev_name(&pdev->dev), desc[i].name);
 	}
 
 	clk_prepare_enable(info->ppmu.clk);
-- 
1.9.1

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

* [PATCH v3 3/4] PM / devfreq: Simplify the sysfs name of devfreq-event device
       [not found]   ` <CGME20170116122609epcas5p38432c9aea262e5abab608b4896c94ae2@epcas5p3.samsung.com>
@ 2017-01-16 12:26     ` Chanwoo Choi
  0 siblings, 0 replies; 8+ messages in thread
From: Chanwoo Choi @ 2017-01-16 12:26 UTC (permalink / raw)
  To: linux-pm; +Cc: myungjoo.ham, kyungmin.park, cw00.choi, rjw, linux-kernel

This patch just removes '.' character from the sysfs name of devfreq-event
device as following. Usually, the subsystem uses the similiar naming style
such as {framework name}{Number}.
- old : /sys/class/devfreq-event/event.X
- new : /sys/class/devfreq-event/eventX

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq-event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index 9aea2c7ecbe6..39f8704ad664 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -329,7 +329,7 @@ struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev,
 	edev->dev.class = devfreq_event_class;
 	edev->dev.release = devfreq_event_release_edev;
 
-	dev_set_name(&edev->dev, "event.%d", atomic_inc_return(&event_no) - 1);
+	dev_set_name(&edev->dev, "event%d", atomic_inc_return(&event_no) - 1);
 	ret = device_register(&edev->dev);
 	if (ret < 0) {
 		put_device(&edev->dev);
-- 
1.9.1

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

* [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs
       [not found]   ` <CGME20170116122609epcas5p3e9f106e6d097613cd866107bc0e065c7@epcas5p3.samsung.com>
@ 2017-01-16 12:26     ` Chanwoo Choi
  2017-01-23  2:19     ` MyungJoo Ham
  1 sibling, 0 replies; 8+ messages in thread
From: Chanwoo Choi @ 2017-01-16 12:26 UTC (permalink / raw)
  To: linux-pm; +Cc: myungjoo.ham, kyungmin.park, cw00.choi, rjw, linux-kernel

This patch modifies the device name as devfreq[X] for sysfs by using the 'devfreq'
prefix word instead of separate device name. On user-space aspect, user would
find the some devfreq drvier with 'devfreq[X]' pattern. So, this patch modify the
device name as following:
- /sys/class/devfreq/[non-standard device name] -> /sys/class/devfreq/devfreq[X]

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 8e5938c9c7d6..4bd7a8f71b07 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -527,6 +527,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
 {
 	struct devfreq *devfreq;
 	struct devfreq_governor *governor;
+	static atomic_t devfreq_no = ATOMIC_INIT(-1);
 	int err = 0;
 
 	if (!dev || !profile || !governor_name) {
@@ -568,7 +569,8 @@ struct devfreq *devfreq_add_device(struct device *dev,
 		mutex_lock(&devfreq->lock);
 	}
 
-	dev_set_name(&devfreq->dev, "%s", dev_name(dev));
+	dev_set_name(&devfreq->dev, "devfreq%lu",
+			(unsigned long)atomic_inc_return(&devfreq_no));
 	err = device_register(&devfreq->dev);
 	if (err) {
 		mutex_unlock(&devfreq->lock);
-- 
1.9.1

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

* Re: [PATCH v3 0/4] PM / devfreq: Update the devfreq and devfreq-event device
  2017-01-16 12:26 ` [PATCH v3 0/4] PM / devfreq: Update the devfreq and devfreq-event device Chanwoo Choi
                     ` (3 preceding siblings ...)
       [not found]   ` <CGME20170116122609epcas5p3e9f106e6d097613cd866107bc0e065c7@epcas5p3.samsung.com>
@ 2017-01-23  0:29   ` Chanwoo Choi
  4 siblings, 0 replies; 8+ messages in thread
From: Chanwoo Choi @ 2017-01-23  0:29 UTC (permalink / raw)
  To: myungjoo.ham; +Cc: linux-pm, kyungmin.park, rjw, linux-kernel

Ping. Hi Myungjoo,

Could you apply these patches if there is no any comment?


On 2017년 01월 16일 21:26, Chanwoo Choi wrote:
> This patches update the devfreq and devfreq-event device. I add the summary
> of each patch as following.
> - Patch1 fixes the wrong description of governor_userspace.c.
> - Patch2 show the information of registered PPMU devices.
> - Patch3/4 modify the name of sysfs entry for devfreq/devfreq-event device
> 
> Changes from v2:
> (https://lkml.org/lkml/2016/12/28/102)
> - On v2 patchset, patch1/2/3/5 were merged on devfreq git repo.
> - Remain the warning message for exynos-ppmu.c when failed to get the clock of ppmu
> - Rebase these patches on devfreq git repo[1].
> 
> Changes from v1:
> - Rebase these patches on v4.10-rc1.
> - Include the separate patch[2] in these patches.
> 
> [1] https://git.kernel.org/cgit/linux/kernel/git/mzx/devfreq.git/ (branch: for-4.10-rc)
> [2] https://lkml.org/lkml/2016/12/16/7
> - [PATCH] PM / devfreq: Fix the wrong description for userspace governor
> 
> Chanwoo Choi (4):
>   PM / devfreq: Fix the wrong description for userspace governor
>   PM / devfreq: exynos-ppmu: Show the registred device for ppmu device
>   PM / devfreq: Simplify the sysfs name of devfreq-event device
>   PM / devfreq: Modify the device name as devfreq[X] for sysfs
> 
>  drivers/devfreq/devfreq-event.c      | 2 +-
>  drivers/devfreq/devfreq.c            | 4 +++-
>  drivers/devfreq/event/exynos-ppmu.c  | 3 +++
>  drivers/devfreq/governor_userspace.c | 3 +--
>  4 files changed, 8 insertions(+), 4 deletions(-)
> 


-- 
Best Regards,
Chanwoo Choi
S/W R&D Center
Samsung Electronics

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

* RE: [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs
       [not found]   ` <CGME20170116122609epcas5p3e9f106e6d097613cd866107bc0e065c7@epcas5p3.samsung.com>
  2017-01-16 12:26     ` [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs Chanwoo Choi
@ 2017-01-23  2:19     ` MyungJoo Ham
  2017-01-23  3:25       ` Chanwoo Choi
  1 sibling, 1 reply; 8+ messages in thread
From: MyungJoo Ham @ 2017-01-23  2:19 UTC (permalink / raw)
  To: Chanwoo Choi, linux-pm; +Cc: Kyungmin Park, rjw, linux-kernel

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

>  	if (!dev || !profile || !governor_name) {
> @@ -568,7 +569,8 @@ struct devfreq *devfreq_add_device(struct device *dev,
>  		mutex_lock(&devfreq->lock);
>  	}
>  
> -	dev_set_name(&devfreq->dev, "%s", dev_name(dev));
> +	dev_set_name(&devfreq->dev, "devfreq%lu",
> +			(unsigned long)atomic_inc_return(&devfreq_no));

Do you have any specific reason to use "unsigned long" here?
(atomic_t has 32bit int).

>  	err = device_register(&devfreq->dev);
>  	if (err) {
>  		mutex_unlock(&devfreq->lock);
> -- 
> 1.9.1

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

* Re: [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs
  2017-01-23  2:19     ` MyungJoo Ham
@ 2017-01-23  3:25       ` Chanwoo Choi
  0 siblings, 0 replies; 8+ messages in thread
From: Chanwoo Choi @ 2017-01-23  3:25 UTC (permalink / raw)
  To: myungjoo.ham, linux-pm; +Cc: Kyungmin Park, rjw, linux-kernel

On 2017년 01월 23일 11:19, MyungJoo Ham wrote:
>>  	if (!dev || !profile || !governor_name) {
>> @@ -568,7 +569,8 @@ struct devfreq *devfreq_add_device(struct device *dev,
>>  		mutex_lock(&devfreq->lock);
>>  	}
>>  
>> -	dev_set_name(&devfreq->dev, "%s", dev_name(dev));
>> +	dev_set_name(&devfreq->dev, "devfreq%lu",
>> +			(unsigned long)atomic_inc_return(&devfreq_no));
> 
> Do you have any specific reason to use "unsigned long" here?
> (atomic_t has 32bit int).

There is no any reason. I'll change to use the integer value as following:

	dev_set_name(&devfreq->dev, "devfreq%d", atomic_inc_return(&devfreq_no));


> 
>>  	err = device_register(&devfreq->dev);
>>  	if (err) {
>>  		mutex_unlock(&devfreq->lock);
>> -- 
>> 1.9.1


-- 
Best Regards,
Chanwoo Choi
S/W R&D Center
Samsung Electronics

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

end of thread, other threads:[~2017-01-23  3:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170116122609epcas5p34b6109202b5bc05f13325318d0f2dbe3@epcas5p3.samsung.com>
2017-01-16 12:26 ` [PATCH v3 0/4] PM / devfreq: Update the devfreq and devfreq-event device Chanwoo Choi
     [not found]   ` <CGME20170116122609epcas5p3268841ebbf85523a32297bba7b6c321f@epcas5p3.samsung.com>
2017-01-16 12:26     ` [PATCH v3 1/4] PM / devfreq: Fix the wrong description for userspace governor Chanwoo Choi
     [not found]   ` <CGME20170116122609epcas5p37255926620af7c0db7373bb8d08a756c@epcas5p3.samsung.com>
2017-01-16 12:26     ` [PATCH v3 2/4] PM / devfreq: exynos-ppmu: Show the registred device for ppmu device Chanwoo Choi
     [not found]   ` <CGME20170116122609epcas5p38432c9aea262e5abab608b4896c94ae2@epcas5p3.samsung.com>
2017-01-16 12:26     ` [PATCH v3 3/4] PM / devfreq: Simplify the sysfs name of devfreq-event device Chanwoo Choi
     [not found]   ` <CGME20170116122609epcas5p3e9f106e6d097613cd866107bc0e065c7@epcas5p3.samsung.com>
2017-01-16 12:26     ` [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs Chanwoo Choi
2017-01-23  2:19     ` MyungJoo Ham
2017-01-23  3:25       ` Chanwoo Choi
2017-01-23  0:29   ` [PATCH v3 0/4] PM / devfreq: Update the devfreq and devfreq-event device Chanwoo Choi

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).