public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] devfreq: fix initialization of current frequency in last status
@ 2016-05-31 10:25 Lukasz Luba
  2016-06-01  8:30 ` Javi Merino
  0 siblings, 1 reply; 3+ messages in thread
From: Lukasz Luba @ 2016-05-31 10:25 UTC (permalink / raw)
  To: linux-pm; +Cc: myungjoo.ham, kyungmin.park, javi.merino, Lukasz Luba

Some systems need current frequency from last_status for calculation
but it is zeroed during initialization. When the device starts there is
no history, but we can assume that the last frequency was the
same as the initial frequency (which is also used in 'previous_freq').
The log shows the result of this misinterpreted value.
[    2.042847] ... Failed to get voltage for frequency 0: -34

Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
 drivers/devfreq/devfreq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 984c5e9..a3f2c3b 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -515,6 +515,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
 	devfreq->profile = profile;
 	strncpy(devfreq->governor_name, governor_name, DEVFREQ_NAME_LEN);
 	devfreq->previous_freq = profile->initial_freq;
+	devfreq->last_status.current_frequency = profile->initial_freq;
 	devfreq->data = data;
 	devfreq->nb.notifier_call = devfreq_notifier_call;
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* Re: [PATCH] devfreq: fix initialization of current frequency in last status
@ 2016-06-01 10:23 MyungJoo Ham
  0 siblings, 0 replies; 3+ messages in thread
From: MyungJoo Ham @ 2016-06-01 10:23 UTC (permalink / raw)
  To: Javi Merino; +Cc: Lukasz Luba, Linux PM list, Kyungmin Park

On Wed, Jun 1, 2016 at 5:30 PM, Javi Merino <javi.merino@arm.com> wrote:
> On Tue, May 31, 2016 at 11:25:09AM +0100, Lukasz Luba wrote:
>> Some systems need current frequency from last_status for calculation
>> but it is zeroed during initialization. When the device starts there is
>> no history, but we can assume that the last frequency was the
>> same as the initial frequency (which is also used in 'previous_freq').
>> The log shows the result of this misinterpreted value.
>> [    2.042847] ... Failed to get voltage for frequency 0: -34
>>
>> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
>
> Looks good to me,
>
> Reviewed-by: Javi Merino <javi.merino@arm.com>

Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>

This is going to be sent for rcX along with other fixes.


Anyway, I don't see a device driver that has the issue you've mentioned.
Could you please tell me which device driver is having this issue?



>
>> ---
>>  drivers/devfreq/devfreq.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>> index 984c5e9..a3f2c3b 100644
>> --- a/drivers/devfreq/devfreq.c
>> +++ b/drivers/devfreq/devfreq.c
>> @@ -515,6 +515,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
>>       devfreq->profile = profile;
>>       strncpy(devfreq->governor_name, governor_name, DEVFREQ_NAME_LEN);
>>       devfreq->previous_freq = profile->initial_freq;
>> +     devfreq->last_status.current_frequency = profile->initial_freq;
>>       devfreq->data = data;
>>       devfreq->nb.notifier_call = devfreq_notifier_call;
>>
>> --
>> 1.9.1
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
MyungJoo Ham, Ph.D.
Frontier CS Lab, S/W Center, Samsung Electronics

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

end of thread, other threads:[~2016-06-01 10:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-31 10:25 [PATCH] devfreq: fix initialization of current frequency in last status Lukasz Luba
2016-06-01  8:30 ` Javi Merino
  -- strict thread matches above, loose matches on Subject: below --
2016-06-01 10:23 MyungJoo Ham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox