A few small fixes and improvements
ChangeLog:
v2 Resend:
* rebase to devfreq-next
* drop original patch 1 & 5.
Patch 5 will be re-sent later when dependent patches merged.
v1->v2:
* squash a few patches
* rebase to devfreq-testing
Dong Aisheng (4):
PM / devfreq: Use more accurate returned new_freq as resume_freq
PM / devfreq: Remove the invalid description for get_target_freq
PM / devfreq: bail out early if no freq changes in devfreq_set_target
PM / devfreq: imx8m-ddrc: remove imx8m_ddrc_get_dev_status
Documentation/ABI/testing/sysfs-class-devfreq | 5 +----
drivers/devfreq/devfreq.c | 11 +++++++----
drivers/devfreq/governor.h | 2 --
drivers/devfreq/imx8m-ddrc.c | 14 --------------
4 files changed, 8 insertions(+), 24 deletions(-)
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
First of all, no_central_polling was removed since
commit 7e6fdd4bad03 ("PM / devfreq: Core updates to support devices
which can idle")
Secondly, get_target_freq() is not only called only with update_devfreq()
notified by OPP now, but also min/max freq qos notifier.
So remove this invalid description now to avoid confusing.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
Documentation/ABI/testing/sysfs-class-devfreq | 5 +----
drivers/devfreq/governor.h | 2 --
2 files changed, 1 insertion(+), 6 deletions(-)
@@ -97,10 +97,7 @@ Description: object. The values are represented in ms. If the value is less than 1 jiffy, it is considered to be 0, which means no polling. This value is meaningless if the governor is- not polling; thus. If the governor is not using- devfreq-provided central polling- (/sys/class/devfreq/.../central_polling is 0), this value- may be useless.+ not polling. A list of governors that support the node: - simple_ondmenad
First of all, no_central_polling was removed since
commit 7e6fdd4bad03 ("PM / devfreq: Core updates to support devices
which can idle")
Secondly, get_target_freq() is not only called only with update_devfreq()
notified by OPP now, but also min/max freq qos notifier.
So remove this invalid description now to avoid confusing.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
Documentation/ABI/testing/sysfs-class-devfreq | 5 +----
drivers/devfreq/governor.h | 2 --
2 files changed, 1 insertion(+), 6 deletions(-)
@@ -97,10 +97,7 @@ Description: object. The values are represented in ms. If the value is less than 1 jiffy, it is considered to be 0, which means no polling. This value is meaningless if the governor is- not polling; thus. If the governor is not using- devfreq-provided central polling- (/sys/class/devfreq/.../central_polling is 0), this value- may be useless.+ not polling. A list of governors that support the node: - simple_ondmenad
Use the more accurate returned new_freq as resume_freq.
It's the same as how devfreq->previous_freq was updated.
Fixes: 83f8ca45afbf0 ("PM / devfreq: add support for suspend/resume of a
devfreq device")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/devfreq/devfreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Use the more accurate returned new_freq as resume_freq.
It's the same as how devfreq->previous_freq was updated.
Fixes: 83f8ca45afbf0 ("PM / devfreq: add support for suspend/resume of a
devfreq device")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/devfreq/devfreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
It's unnecessary to set the same freq again and run notifier calls.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/devfreq/devfreq.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
It's unnecessary to set the same freq again and run notifier calls.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/devfreq/devfreq.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
@@ -352,13 +352,16 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq,{structdevfreq_freqsfreqs;unsignedlongcur_freq;-interr=0;+interr;if(devfreq->profile->get_cur_freq)devfreq->profile->get_cur_freq(devfreq->dev.parent,&cur_freq);elsecur_freq=devfreq->previous_freq;+if(new_freq==cur_freq)+return0;
cur_freq is one of the OPP frequencies. But, new_freq is calculated from
governor algorithm. It means that new_freq is not one of the
frequencies. Actually, it is not efficient.
After devfreq->profile->target() which almost uses
devfreq_recommended_opp(), new_freq is one of OPP frequencies.
@@ -375,7 +378,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, * and DEVFREQ_POSTCHANGE because for showing the correct frequency * change order of between devfreq device and passive devfreq device. */- if (trace_devfreq_frequency_enabled() && new_freq != cur_freq)+ if (trace_devfreq_frequency_enabled()) trace_devfreq_frequency(devfreq, new_freq, cur_freq); freqs.new = new_freq;
@@ -390,7 +393,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, if (devfreq->suspend_freq) devfreq->resume_freq = new_freq;- return err;+ return 0; } /**
On Tue, Mar 23, 2021 at 11:01 PM Chanwoo Choi [off-list ref] wrote:
On 21. 3. 23. 오후 4:20, Dong Aisheng wrote:
quoted
It's unnecessary to set the same freq again and run notifier calls.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/devfreq/devfreq.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
@@ -352,13 +352,16 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq,{structdevfreq_freqsfreqs;unsignedlongcur_freq;-interr=0;+interr;if(devfreq->profile->get_cur_freq)devfreq->profile->get_cur_freq(devfreq->dev.parent,&cur_freq);elsecur_freq=devfreq->previous_freq;+if(new_freq==cur_freq)+return0;
cur_freq is one of the OPP frequencies. But, new_freq is calculated from
governor algorithm. It means that new_freq is not one of the
frequencies. Actually, it is not efficient.
After devfreq->profile->target() which almost uses
devfreq_recommended_opp(), new_freq is one of OPP frequencies.
Yes, but i feel at least when the desired new_freq is equal to cur_freq
which is the last successfully set rate, it is sufficient to bail out early as
it's meaningless to re-set the same rate as the last one and notify the
an unchanged rate transition in HW.
Does that make sense?
Regards
Aisheng
@@ -375,7 +378,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, * and DEVFREQ_POSTCHANGE because for showing the correct frequency * change order of between devfreq device and passive devfreq device. */- if (trace_devfreq_frequency_enabled() && new_freq != cur_freq)+ if (trace_devfreq_frequency_enabled()) trace_devfreq_frequency(devfreq, new_freq, cur_freq); freqs.new = new_freq;
@@ -390,7 +393,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, if (devfreq->suspend_freq) devfreq->resume_freq = new_freq;- return err;+ return 0; } /**
Current driver actually does not support simple ondemand governor
as it's unable to provide device load information. So removing
the unnecessary callback to avoid confusing.
Right now the driver is using userspace governor by default.
polling_ms was also dropped as it's not needed for non-ondemand
governor.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/devfreq/imx8m-ddrc.c | 14 --------------
1 file changed, 14 deletions(-)
Current driver actually does not support simple ondemand governor
as it's unable to provide device load information. So removing
the unnecessary callback to avoid confusing.
Right now the driver is using userspace governor by default.
polling_ms was also dropped as it's not needed for non-ondemand
governor.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/devfreq/imx8m-ddrc.c | 14 --------------
1 file changed, 14 deletions(-)