OSDN Git Service

PM / OPP: Fix get sharing CPUs when hotplug is used
authorWaldemar Rymarkiewicz <waldemarx.rymarkiewicz@intel.com>
Thu, 27 Jul 2017 10:01:17 +0000 (12:01 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 1 Aug 2017 12:10:55 +0000 (14:10 +0200)
commit762792913f8c71fb4807b25540347e4ace1b5b95
tree8c025e238e33eb328d08aabf18e8fb10885da423
parent5b60697cd89cf5a438b2984e11859228e5ec1c6b
PM / OPP: Fix get sharing CPUs when hotplug is used

We fail dev_pm_opp_of_get_sharing_cpus() when possible CPU device does
not exist. This can happen on platforms where not all possible CPUs
are available at start up ie. hotplugged out.  The CPU device is not
registered in the system so we are not able to check struct device to
set the sharing CPUs bitmask properly.

Example (real use case):
2 physical MIPS cores, 4 VPE, cpu0/2 run Linux and cpu1/3 are not
available for Linux at boot up. cpufreq-dt driver + OPP v2 fail to
register opp_table due to the fact there is no struct device for
cpu1 (remains offline at
bootup).

To solve the bug, stop using device struct to check device_node.
Instead get CPU device_node directly from device tree with
of_get_cpu_node().

Signed-off-by: Waldemar Rymarkiewicz <waldemarx.rymarkiewicz@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/opp/of.c