Re: [PATCH] PM / devfreq: Skip status update on uninitialized previous_freq
From: MyungJoo Ham <myungjoo.ham@samsung.com>
Date: 2016-09-30 14:09:50
On Thu, Sep 29, 2016 at 9:36 PM, Tobias Jakobi [off-list ref] wrote:
quoted hunk ↗ jump to hunk
In case devfreq->previous_freq is still uninitialized in devfreq_update_status(), i.e. it has value '0', the lookups in that function fail, eventually leading to some error message: [ 3.041292] devfreq bus_dmc: Couldn't update frequency transition information. Just skip the statup update in this situation. Signed-off-by: Tobias Jakobi <redacted> --- drivers/devfreq/devfreq.c | 4 ++++ 1 file changed, 4 insertions(+)diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 478006b..1bb300f 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c@@ -137,6 +137,10 @@ static int devfreq_update_status(struct devfreq *devfreq, unsigned long freq) cur_time = jiffies; + /* Immediately exit if previous_freq is not initialized yet. */ + if (!devfreq->previous_freq) + goto out; +
Thanks! Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Cheers, MyungJoo
prev_lev = devfreq_get_freq_level(devfreq, devfreq->previous_freq);
if (prev_lev < 0) {
ret = prev_lev;
--
2.7.3
--
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