* [PATCH] devfreq: simple_ondemand: Update devfreq stats when governor started
@ 2017-07-18 10:02 ` Jeffy Chen
2017-07-18 10:35 ` MyungJoo Ham
0 siblings, 1 reply; 4+ messages in thread
From: Jeffy Chen @ 2017-07-18 10:02 UTC (permalink / raw)
To: linux-kernel
Cc: rui.zhang, briannorris, javi.merino, dianders, lukasz.luba,
Jeffy Chen, Chanwoo Choi, Kyungmin Park, MyungJoo Ham, linux-pm
If governor suspends soon after started, it may not have the chance to
update devfreq stats, which leaves devfreq stats' current frequence be
zero.
So when the thermal core tries to throttle the power, it would failed
to get the correct static power of current frequence and print these
warnings:
[ 2.024735] core: dev_pm_opp_get_voltage: Invalid parameters
[ 2.024743] mali ff9a0000.gpu: Failed to get voltage for frequency 0:
-34
...
[ 2.026320] core: dev_pm_opp_get_voltage: Invalid parameters
[ 2.026327] mali ff9a0000.gpu: Failed to get voltage for frequency 0:
-34
Update devfreq stats when governor started to avoid that.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
drivers/devfreq/governor_simpleondemand.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c
index ae72ba5..26e0e58 100644
--- a/drivers/devfreq/governor_simpleondemand.c
+++ b/drivers/devfreq/governor_simpleondemand.c
@@ -98,6 +98,7 @@ static int devfreq_simple_ondemand_handler(struct devfreq *devfreq,
{
switch (event) {
case DEVFREQ_GOV_START:
+ devfreq_update_stats(devfreq);
devfreq_monitor_start(devfreq);
break;
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH] devfreq: simple_ondemand: Update devfreq stats when governor started
2017-07-18 10:02 ` [PATCH] devfreq: simple_ondemand: Update devfreq stats when governor started Jeffy Chen
@ 2017-07-18 10:35 ` MyungJoo Ham
2017-07-18 11:27 ` jeffy
0 siblings, 1 reply; 4+ messages in thread
From: MyungJoo Ham @ 2017-07-18 10:35 UTC (permalink / raw)
To: linux-kernel@vger.kernel.org
Cc: rui.zhang@intel.com, briannorris@chromium.org,
javi.merino@kernel.org, dianders@chromium.org,
lukasz.luba@arm.com, Jeffy Chen, Chanwoo Choi, Kyungmin Park,
linux-pm@vger.kernel.org
> If governor suspends soon after started, it may not have the chance to
> update devfreq stats, which leaves devfreq stats' current frequence be
> zero.
>
> So when the thermal core tries to throttle the power, it would failed
> to get the correct static power of current frequence and print these
> warnings:
> [ 2.024735] core: dev_pm_opp_get_voltage: Invalid parameters
> [ 2.024743] mali ff9a0000.gpu: Failed to get voltage for frequency 0:
> -34
> ...
> [ 2.026320] core: dev_pm_opp_get_voltage: Invalid parameters
> [ 2.026327] mali ff9a0000.gpu: Failed to get voltage for frequency 0:
> -34
>
> Update devfreq stats when governor started to avoid that.
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
How are you calling suspend/resume routins in the mali drivers?
It appears that your mali device driver's suspend/resume routines are
accessing "struct devfreq_dev_status" directly. Is this correct?
Plus, for MALI (if that assumption is correct), this issue might occur
with other governors.
If so, would it be better to put the first initializing call of
devfreq_update_stats() at devfreq_add_device()?
Cheers,
MyungJoo
ps. Where can I look at the mali-devfreq device driver? (I couldn't find it)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] devfreq: simple_ondemand: Update devfreq stats when governor started
2017-07-18 10:35 ` MyungJoo Ham
@ 2017-07-18 11:27 ` jeffy
2017-07-19 4:28 ` jeffy
0 siblings, 1 reply; 4+ messages in thread
From: jeffy @ 2017-07-18 11:27 UTC (permalink / raw)
To: myungjoo.ham, linux-kernel@vger.kernel.org
Cc: rui.zhang@intel.com, briannorris@chromium.org,
javi.merino@kernel.org, dianders@chromium.org,
lukasz.luba@arm.com, Chanwoo Choi, Kyungmin Park,
linux-pm@vger.kernel.org
hi Ham,
Thanks for your reply.
On 07/18/2017 06:35 PM, MyungJoo Ham wrote:
>> If governor suspends soon after started, it may not have the chance to
>> update devfreq stats, which leaves devfreq stats' current frequence be
>> zero.
>>
>> So when the thermal core tries to throttle the power, it would failed
>> to get the correct static power of current frequence and print these
>> warnings:
>> [ 2.024735] core: dev_pm_opp_get_voltage: Invalid parameters
>> [ 2.024743] mali ff9a0000.gpu: Failed to get voltage for frequency 0:
>> -34
>> ...
>> [ 2.026320] core: dev_pm_opp_get_voltage: Invalid parameters
>> [ 2.026327] mali ff9a0000.gpu: Failed to get voltage for frequency 0:
>> -34
>>
>> Update devfreq stats when governor started to avoid that.
>>
>> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
>
> How are you calling suspend/resume routins in the mali drivers?
>
i was porting mali driver from here:
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-4.4/drivers/gpu/arm/midgard/mali_kbase_core_linux.c#4079
> It appears that your mali device driver's suspend/resume routines are
> accessing "struct devfreq_dev_status" directly. Is this correct?
>
no, but the suspend/resume would suspend/resume the governor.
>
> Plus, for MALI (if that assumption is correct), this issue might occur
> with other governors.
>
> If so, would it be better to put the first initializing call of
> devfreq_update_stats() at devfreq_add_device()?
>
right, that make sense. i put it here because the comment of this
function said it should be called by governor, but you're right, it
would be better this way, will send new version soon.
>
> Cheers,
> MyungJoo
>
> ps. Where can I look at the mali-devfreq device driver? (I couldn't find it)
sorry, i should mention that, please check above link :)
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] devfreq: simple_ondemand: Update devfreq stats when governor started
2017-07-18 11:27 ` jeffy
@ 2017-07-19 4:28 ` jeffy
0 siblings, 0 replies; 4+ messages in thread
From: jeffy @ 2017-07-19 4:28 UTC (permalink / raw)
To: myungjoo.ham, linux-kernel@vger.kernel.org
Cc: rui.zhang@intel.com, briannorris@chromium.org,
javi.merino@kernel.org, dianders@chromium.org,
lukasz.luba@arm.com, Chanwoo Choi, Kyungmin Park,
linux-pm@vger.kernel.org
Hi Ham,
oops, sorry, it turns out the devfreq would already tried to handle this
case(by using profile's initial_freq):
8d39fc0 PM / devfreq: fix initialization of current frequency in last status
and my local kernel didn't contains this commit.
so this patch is not needed, please ignore it.
On 07/18/2017 07:27 PM, jeffy wrote:
> hi Ham,
>
> Thanks for your reply.
>
> On 07/18/2017 06:35 PM, MyungJoo Ham wrote:
>>> If governor suspends soon after started, it may not have the chance to
>>> update devfreq stats, which leaves devfreq stats' current frequence be
>>> zero.
>>>
>>> So when the thermal core tries to throttle the power, it would failed
>>> to get the correct static power of current frequence and print these
>>> warnings:
>>> [ 2.024735] core: dev_pm_opp_get_voltage: Invalid parameters
>>> [ 2.024743] mali ff9a0000.gpu: Failed to get voltage for frequency 0:
>>> -34
>>> ...
>>> [ 2.026320] core: dev_pm_opp_get_voltage: Invalid parameters
>>> [ 2.026327] mali ff9a0000.gpu: Failed to get voltage for frequency 0:
>>> -34
>>>
>>> Update devfreq stats when governor started to avoid that.
>>>
>>> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
>>
>> How are you calling suspend/resume routins in the mali drivers?
>>
> i was porting mali driver from here:
> https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-4.4/drivers/gpu/arm/midgard/mali_kbase_core_linux.c#4079
>
>> It appears that your mali device driver's suspend/resume routines are
>> accessing "struct devfreq_dev_status" directly. Is this correct?
>>
> no, but the suspend/resume would suspend/resume the governor.
>>
>> Plus, for MALI (if that assumption is correct), this issue might occur
>> with other governors.
>>
>> If so, would it be better to put the first initializing call of
>> devfreq_update_stats() at devfreq_add_device()?
>>
> right, that make sense. i put it here because the comment of this
> function said it should be called by governor, but you're right, it
> would be better this way, will send new version soon.
>>
>> Cheers,
>> MyungJoo
>>
>> ps. Where can I look at the mali-devfreq device driver? (I couldn't
>> find it)
> sorry, i should mention that, please check above link :)
>>
>>
>>
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-19 4:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20170718100259epcas3p2886849647d4a6fe257a4e12854a10f7c@epcms1p8>
2017-07-18 10:02 ` [PATCH] devfreq: simple_ondemand: Update devfreq stats when governor started Jeffy Chen
2017-07-18 10:35 ` MyungJoo Ham
2017-07-18 11:27 ` jeffy
2017-07-19 4:28 ` jeffy
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).