]> asedeno.scripts.mit.edu Git - linux.git/commit
powernv-cpufreq: Treat pstates as opaque 8-bit values
authorGautham R. Shenoy <ego@linux.vnet.ibm.com>
Wed, 13 Dec 2017 06:57:41 +0000 (12:27 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 5 Jan 2018 12:11:24 +0000 (13:11 +0100)
commit967b87fd81d513de7aac247320f02b1645f9ca64
tree1bb9f436927a8b6f6dd60aba889852fe32b24e52
parent332f0a01f0dd669dcd208e4e9666d80dffd62e7b
powernv-cpufreq: Treat pstates as opaque 8-bit values

On POWER8 and POWER9, the PMSR and the PMCR registers define pstates
to be 8-bit wide values. The device-tree exports pstates as 32-bit
wide values of which the lower byte is the actual pstate.

The current implementation in the kernel treats pstates as integer
type, since it used to use the sign of the pstate for performing some
boundary-checks. This is no longer required after the patch
"powernv-cpufreq: Fix pstate_to_idx() to handle non-continguous
pstates".

So, in this patch, we modify the powernv-cpufreq driver to uniformly
treat pstates as opaque 8-bit values obtained from the device-tree or
the PMCR. This simplifies the extract_pstate() helper function since
we no longer no longer require to worry about the sign-extentions.

Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/powernv-cpufreq.c