Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1272919 > unrolled thread
| Started by | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| First post | 2015-11-19 09:20 +0100 |
| Last post | 2015-11-19 09:30 +0100 |
| Articles | 4 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/6] PM / devfreq: Clean code and add set the freq_table array Chanwoo Choi <cw00.choi@samsung.com> - 2015-11-19 09:20 +0100
[PATCH 5/6] PM / devfreq: Modify the indentation of trans_stat sysfs for readability Chanwoo Choi <cw00.choi@samsung.com> - 2015-11-19 09:20 +0100
[PATCH 6/6] PM / devfreq: Set the min_freq and max_freq of devfreq device Chanwoo Choi <cw00.choi@samsung.com> - 2015-11-19 09:20 +0100
[PATCH 2/6] PM / devfreq: event: Fix the error and warning from script/checkpatch.pl Chanwoo Choi <cw00.choi@samsung.com> - 2015-11-19 09:30 +0100
| From | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| Date | 2015-11-19 09:20 +0100 |
| Subject | [PATCH 0/6] PM / devfreq: Clean code and add set the freq_table array |
| Message-ID | <qwsBI-6MQ-5@gated-at.bofh.it> |
This patch-set clean the code for both devfreq and devfreq-event framework and add the 'freq_table' for devfreq device. After initializing the 'freq_table', the 'trans_stat' sysfs provide the appropriate information. Chanwoo Choi (6): PM / devfreq: event: Remove the error log of devfreq_event_get_edev_by_phandle() PM / devfreq: event: Fix the error and warning from script/checkpatch.pl PM / devfreq: Add show_one macro to delete the duplicate code PM / devfreq: Set the freq_table of devfreq device PM / devfreq: Modify the indentation of trans_stat sysfs for readability PM / devfreq: Set the min_freq and max_freq of devfreq device drivers/devfreq/devfreq-event.c | 16 +++----- drivers/devfreq/devfreq.c | 81 ++++++++++++++++++++++++++++++++--------- include/linux/devfreq.h | 4 +- 3 files changed, 71 insertions(+), 30 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| Date | 2015-11-19 09:20 +0100 |
| Subject | [PATCH 5/6] PM / devfreq: Modify the indentation of trans_stat sysfs for readability |
| Message-ID | <qwsBJ-6MQ-23@gated-at.bofh.it> |
| In reply to | #1272919 |
This patch modifies the indentation of 'trans_stat' sysfs to improve readability.
The 1GHz is 1000,000,000. So it needs the least 10 position to show the GHz unit.
- Before apply this patch,
-sh-3.2# cat trans_stat
From : To
:50000000100000000133000000200000000400000000 time(ms)
*50000000: 0 0 0 0 7 1817635
100000000: 4 0 0 0 4 1590
133000000: 1 4 0 0 7 975
200000000: 2 2 7 0 1 2655
400000000: 0 2 5 12 0 1860
Total transition : 58
- After apply this patch,
-sh-3.2# cat trans_stat
From : To
: 50000000 100000000 133000000 200000000 400000000 time(ms)
* 50000000: 0 0 0 0 7 14405
100000000: 4 0 0 0 3 2015
133000000: 2 3 0 0 7 1020
200000000: 1 2 7 0 0 2970
400000000: 0 2 5 10 0 1575
Total transition : 53
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/devfreq/devfreq.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 761e46a95c4b..c292ceb7ff19 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -1048,10 +1048,10 @@ static ssize_t trans_stat_show(struct device *dev,
devfreq_update_status(devfreq, devfreq->previous_freq))
return 0;
- len = sprintf(buf, " From : To\n");
- len += sprintf(buf + len, " :");
+ len = sprintf(buf, " From : To\n");
+ len += sprintf(buf + len, " :");
for (i = 0; i < max_state; i++)
- len += sprintf(buf + len, "%8ld",
+ len += sprintf(buf + len, "%10ld",
devfreq->profile->freq_table[i]);
len += sprintf(buf + len, " time(ms)\n");
@@ -1063,10 +1063,10 @@ static ssize_t trans_stat_show(struct device *dev,
} else {
len += sprintf(buf + len, " ");
}
- len += sprintf(buf + len, "%8ld:",
+ len += sprintf(buf + len, "%10ld:",
devfreq->profile->freq_table[i]);
for (j = 0; j < max_state; j++)
- len += sprintf(buf + len, "%8u",
+ len += sprintf(buf + len, "%10u",
devfreq->trans_table[(i * max_state) + j]);
len += sprintf(buf + len, "%10u\n",
jiffies_to_msecs(devfreq->time_in_state[i]));
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| Date | 2015-11-19 09:20 +0100 |
| Subject | [PATCH 6/6] PM / devfreq: Set the min_freq and max_freq of devfreq device |
| Message-ID | <qwsBJ-6MQ-25@gated-at.bofh.it> |
| In reply to | #1272919 |
After probing the devfreq device driver, the value of both min_freq and max_freq are zero(0). So, this patch initializes the 'min_freq' and 'max_freq' field of devfreq device by using the freq_table array. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> --- drivers/devfreq/devfreq.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index c292ceb7ff19..0b24ae7b7a48 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -121,6 +121,11 @@ static void devfreq_set_freq_table(struct devfreq *devfreq) profile->freq_table[i] = freq; } rcu_read_unlock(); + + mutex_lock(&devfreq->lock); + devfreq->min_freq = profile->freq_table[0]; + devfreq->max_freq = profile->freq_table[profile->max_state - 1]; + mutex_unlock(&devfreq->lock); } /** -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| Date | 2015-11-19 09:30 +0100 |
| Subject | [PATCH 2/6] PM / devfreq: event: Fix the error and warning from script/checkpatch.pl |
| Message-ID | <qwsLn-6Qc-5@gated-at.bofh.it> |
| In reply to | #1272919 |
This patch just fixes following error and warning by using
scripts/checkpatch.pl.
- Follwoing issue from checkpatch.pl:
ERROR: space prohibited before that close parenthesis ')'
+ if (count < 0 ) {
WARNING: line over 80 characters
+ ptr = devres_alloc(devm_devfreq_event_release, sizeof(*ptr), GFP_KERNEL);
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/devfreq/devfreq-event.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index f51de879b2be..38bf144ca147 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -270,7 +270,7 @@ int devfreq_event_get_edev_count(struct device *dev)
count = of_property_count_elems_of_size(dev->of_node, "devfreq-events",
sizeof(u32));
- if (count < 0 ) {
+ if (count < 0) {
dev_err(dev,
"failed to get the count of devfreq-event in %s node\n",
dev->of_node->full_name);
@@ -395,7 +395,8 @@ struct devfreq_event_dev *devm_devfreq_event_add_edev(struct device *dev,
{
struct devfreq_event_dev **ptr, *edev;
- ptr = devres_alloc(devm_devfreq_event_release, sizeof(*ptr), GFP_KERNEL);
+ ptr = devres_alloc(devm_devfreq_event_release, sizeof(*ptr),
+ GFP_KERNEL);
if (!ptr)
return ERR_PTR(-ENOMEM);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web