diff options
author | Xiongfeng Wang <[email protected]> | 2021-11-29 16:02:48 +0800 |
---|---|---|
committer | Rafael J. Wysocki <[email protected]> | 2021-12-01 19:50:56 +0100 |
commit | 2c1b5a84669d2477d8fffe9136e86a2cff591729 (patch) | |
tree | 55e69456b3eb6803fb164a86f08d75e4a509df4b /tools/perf/scripts/python/syscall-counts-by-pid.py | |
parent | d58071a8a76d779eedab38033ae4c821c30295a5 (diff) |
cpufreq: Fix get_cpu_device() failure in add_cpu_dev_symlink()
When I hot added a CPU, I found 'cpufreq' directory was not created
below /sys/devices/system/cpu/cpuX/.
It is because get_cpu_device() failed in add_cpu_dev_symlink().
cpufreq_add_dev() is the .add_dev callback of a CPU subsys interface.
It will be called when the CPU device registered into the system.
The call chain is as follows:
register_cpu()
->device_register()
->device_add()
->bus_probe_device()
->cpufreq_add_dev()
But only after the CPU device has been registered, we can get the
CPU device by get_cpu_device(), otherwise it will return NULL.
Since we already have the CPU device in cpufreq_add_dev(), pass
it to add_cpu_dev_symlink().
I noticed that the 'kobj' of the CPU device has been added into
the system before cpufreq_add_dev().
Fixes: 2f0ba790df51 ("cpufreq: Fix creation of symbolic links to policy directories")
Signed-off-by: Xiongfeng Wang <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Cc: All applicable <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts-by-pid.py')
0 files changed, 0 insertions, 0 deletions