]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
cpufreq: powernv: Fix uninitialized lpstate_idx in gpstates_timer_handler()
authorAkshay Adiga <akshay.adiga@linux.vnet.ibm.com>
Mon, 14 Nov 2016 11:59:27 +0000 (17:29 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 14 Nov 2016 20:32:31 +0000 (21:32 +0100)
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 <sfr@canb.auug.org.au>
Signed-off-by: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/powernv-cpufreq.c

index c82304b7a4c004c9271aafc5181b27144b9d113d..c5c5bc35eecedae078a768b20ba42f972ff03219 100644 (file)
@@ -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 {