From: Lukasz Luba <lukasz.luba@arm.com>
To: linux-pm@vger.kernel.org
Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
javi.merino@arm.com, Lukasz Luba <lukasz.luba@arm.com>
Subject: [PATCH] devfreq: fix initialization of current frequency in last status
Date: Tue, 31 May 2016 11:25:09 +0100 [thread overview]
Message-ID: <1464690309-27809-1-git-send-email-lukasz.luba@arm.com> (raw)
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
next reply other threads:[~2016-05-31 10:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 10:25 Lukasz Luba [this message]
2016-06-01 8:30 ` [PATCH] devfreq: fix initialization of current frequency in last status Javi Merino
-- strict thread matches above, loose matches on Subject: below --
2016-06-01 10:23 MyungJoo Ham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1464690309-27809-1-git-send-email-lukasz.luba@arm.com \
--to=lukasz.luba@arm.com \
--cc=javi.merino@arm.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-pm@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox