diff options
| author | spkal01 <kalligeross@gmail.com> | 2021-05-17 02:37:28 +0530 |
|---|---|---|
| committer | spkal01 <kalligeross@gmail.com> | 2021-05-17 02:37:28 +0530 |
| commit | 93b265ae2eba8d93d0ffa406958547232f3114c8 (patch) | |
| tree | c2f093aa144f732b5cf7bd8a0b45bf35eda42e1c /drivers/base | |
| parent | 0a82617b8fce8994076b518064e7d420af290ea8 (diff) | |
| parent | 016f4ba70bffb6d02725e778c3989fa542e6d12a (diff) | |
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/cpu.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 11027b2146bc..5a537093b9a6 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -435,6 +435,16 @@ static int cpu_uevent(struct device *dev, struct kobj_uevent_env *env) } #endif +static int cpu_dev_pm_unset_is_prepared(unsigned int cpu) +{ + struct device *cpu_dev = get_cpu_device(cpu); + + if (cpu_dev) + cpu_dev->power.is_prepared = false; + + return 0; +} + /* * register_cpu - Setup a sysfs device for a CPU. * @cpu - cpu->hotpluggable field set to 1 will generate a control file in @@ -469,7 +479,9 @@ int register_cpu(struct cpu *cpu, int num) register_cpu_under_node(num, cpu_to_node(num)); dev_pm_qos_expose_latency_limit(&cpu->dev, 0); - return 0; + return cpuhp_setup_state_nocalls(CPUHP_CPUDEV_PM_PREPARE, + "base/cpu/dev_pm:prepare", + cpu_dev_pm_unset_is_prepared, NULL); } struct device *get_cpu_device(unsigned cpu) |
