]> git.baikalelectronics.ru Git - kernel.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)
commitd5eebf8b35a7864662d70b89a2c44ef08f99cbf6
tree1bb9f436927a8b6f6dd60aba889852fe32b24e52
parent43bb8df16c69a0add3be32331a0330a701a75816
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