summaryrefslogtreecommitdiff
path: root/net/can
diff options
context:
space:
mode:
authorGautham R. Shenoy <ego@linux.vnet.ibm.com>2017-12-13 12:27:40 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-01-05 13:11:24 +0100
commit332f0a01f0dd669dcd208e4e9666d80dffd62e7b (patch)
treee7c0648f8515fb7863991c07a163eb6d2c5c4c02 /net/can
parentee1f4a7dafa997816ff3de96155c6f3edc21c1e6 (diff)
powernv-cpufreq: Fix pstate_to_idx() to handle non-continguous pstates
The code in powernv-cpufreq, makes the following two assumptions which are not guaranteed by the device-tree bindings: 1) Pstate ids are continguous: This is used in pstate_to_idx() to obtain the reverse map from a pstate to it's corresponding entry into the cpufreq frequency table. 2) Every Pstate should always lie between the max and the min pstates that are explicitly reported in the device tree: This is used to determine whether a pstate reported by the PMSR is out of bounds. Both these assumptions are unwarranted and can change on future platforms. In this patch, we maintain the reverse map from a pstate to it's index in the cpufreq frequency table and use this in pstate_to_idx(). This does away with the assumptions (1) mentioned above, and will work with non continguous pstate ids. If no entry exists for a particular pstate, then such a pstate is treated as being out of bounds. This gets rid of assumption (2). On all the existing platforms, where the pstates are 8-bit long values, the new implementation of pstate_to_idx() takes constant time. Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'net/can')
0 files changed, 0 insertions, 0 deletions