aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/highbank-cpufreq.c
diff options
context:
space:
mode:
authorGautham R. Shenoy <ego@linux.vnet.ibm.com>2017-12-13 12:27:39 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-01-05 13:11:24 +0100
commitee1f4a7dafa997816ff3de96155c6f3edc21c1e6 (patch)
treed8658f17eb84abb6ff1f5c1b54d1d651033ad991 /drivers/cpufreq/highbank-cpufreq.c
parentcpufreq: imx6q: switch to Use clk_bulk_get() to refine clk operations (diff)
downloadlinux-dev-ee1f4a7dafa997816ff3de96155c6f3edc21c1e6.tar.xz
linux-dev-ee1f4a7dafa997816ff3de96155c6f3edc21c1e6.zip
powernv-cpufreq: Add helper to extract pstate from PMSR
On POWERNV platform, the fields for pstates in the Power Management Status Register (PMSR) and the Power Management Control Register (PMCR) are 8-bits wide. On POWER8 the pstates are negatively numbered while on POWER9 they are positively numbered. The device-tree exports pstates as 32-bit entries. The device-tree implementation sign-extends the 8-bit pstate values to obtain the corresponding 32-bit entry. Eg: On POWER8, a pstate value 0x82 [-126] is represented in the device-tree as 0xfffffff82 while on POWER9, the same value 0x82 [130] is represented in the device-tree as 0x00000082. The powernv-cpufreq driver implementation represents pstates using the integer type. In multiple places in the driver, the code interprets the pstates extracted from the PMSR as a signed byte and assigns it to a integer variable to get the sign-extention. On POWER9 platforms which have greater than 128 pstates, this results in the driver performing incorrect sign-extention, and thereby treating a legitimate pstate (say 130) as an invalid pstates (since it is interpreted as -126). This patch fixes the issue by implementing a helper function to extract Pstates from PMSR register, and correctly sign-extend it to be consistent with the values provided by the device-tree. Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> Acked-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/highbank-cpufreq.c')
0 files changed, 0 insertions, 0 deletions