Skip to contentSkip to conversation

PM / OPP: Fix get sharing cpus when hotplug is used

PATCH Viresh Kumar 3 participants 4 messages Jul 24, 2017 – Jul 26, 2017 1 message not in the archive

lore
Share & tools
lore

Viresh Kumar

author Acked-by
#1 lore raw
In reply to a message not in the archive
Quoted 12 lines · Waldemar Rymarkiewicz

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. 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).

Quoted 7 lines

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().

---
 drivers/base/power/opp/of.c | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)
Signature · 1 line
viresh
#2 lore raw
Quoted 16 lines · Viresh Kumar
Quoted 15 lines · Waldemar Rymarkiewicz

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. 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().

Quoted 6 lines
Quoted 4 lines
---
 drivers/base/power/opp/of.c | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

I've lost track of this, care to resend?

#3 lore raw
Quoted 17 lines · Rafael J. Wysocki
Quoted 16 lines · Viresh Kumar
Quoted 15 lines · Waldemar Rymarkiewicz

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. 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().

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
---
 drivers/base/power/opp/of.c | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

I've lost track of this, care to resend?

I've resent v3.

/Waldek

#4 lore raw
Quoted 23 lines · Waldemar Rymarkiewicz
Quoted 22 lines · Rafael J. Wysocki
Quoted 21 lines · Viresh Kumar
Quoted 19 lines · Waldemar Rymarkiewicz

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. 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().

---
 drivers/base/power/opp/of.c | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I've lost track of this, care to resend?

I've resent v3.

Well, I'm not seeing it in any of my mailboxes.

Have you CCed it to the mailing lists?