]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit64962a84a1b6ca1c0e2f307f8789c3161c6cc9b0
tree8c025e238e33eb328d08aabf18e8fb10885da423
parent93f8d98e938d1eb91788d13a2be70e1489611f50
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