From: Akshay Adiga Date: Mon, 14 Nov 2016 11:59:27 +0000 (+0530) Subject: cpufreq: powernv: Fix uninitialized lpstate_idx in gpstates_timer_handler() X-Git-Tag: v4.14-rc1~1641^2^3~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9a81e6864d48f81797397bbd65d299bf20c6148;p=platform%2Fkernel%2Flinux-rpi3.git cpufreq: powernv: Fix uninitialized lpstate_idx in gpstates_timer_handler() lpstate_idx remains uninitialized in the case when elapsed_time is greater than MAX_RAMP_DOWN_TIME. At the end of rampdown the global pstate should be equal to the local pstate. Fixes: 20b15b766354 (cpufreq: powernv: Use PMCR to verify global and localpstate) Reported-by: Stephen Rothwell Signed-off-by: Akshay Adiga Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index c82304b..c5c5bc3 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -624,6 +624,7 @@ void gpstate_timer_handler(unsigned long data) if (gpstates->elapsed_time > MAX_RAMP_DOWN_TIME) { gpstate_idx = pstate_to_idx(freq_data.pstate_id); + lpstate_idx = gpstate_idx; reset_gpstates(policy); gpstates->highest_lpstate_idx = gpstate_idx; } else {