cpu: Fix cache warnings when resuming from deep suspend

Fixes the following errors on resume:
[  288.105823] cache: parent cpu1 should not be sleeping
[  288.107089] cache: parent cpu2 should not be sleeping
[  288.108234] cache: parent cpu3 should not be sleeping
[  288.109441] cache: parent cpu4 should not be sleeping
[  288.110022] cache: parent cpu5 should not be sleeping
[  288.110591] cache: parent cpu6 should not be sleeping
[  288.111235] cache: parent cpu7 should not be sleeping

(am from https://patchwork.kernel.org/patch/9483273/)

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: alk3pInjection <webmaster@raspii.tech>
This commit is contained in:
Sudeep Holla 2016-12-21 17:54:22 +00:00 committed by spakkkk
parent 2d693bf1a8
commit 8d219f3008
2 changed files with 14 additions and 1 deletions

View File

@ -445,6 +445,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
@ -482,7 +492,9 @@ int register_cpu(struct cpu *cpu, int num)
dev_pm_qos_expose_latency_limit(&cpu->dev,
PM_QOS_RESUME_LATENCY_NO_CONSTRAINT);
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)

View File

@ -69,6 +69,7 @@ enum cpuhp_state {
CPUHP_SLAB_PREPARE,
CPUHP_MD_RAID5_PREPARE,
CPUHP_RCUTREE_PREP,
CPUHP_CPUDEV_PM_PREPARE,
CPUHP_HYP_CORE_CTL_ISOLATION_DEAD,
CPUHP_CORE_CTL_ISOLATION_DEAD,
CPUHP_CPUIDLE_COUPLED_PREPARE,