mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
cpuidle: coupled: fix sleeping while atomic in cpu notifier
The cpu hotplug notifier gets called in both atomic and non-atomic contexts, it is not always safe to lock a mutex. Filter out all events except the six necessary ones, which are all sleepable, before taking the mutex. Signed-off-by: Colin Cross <[email protected]> Reviewed-by: Srivatsa S. Bhat <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
55d7ec4520
commit
63c6ba4352
1 changed files with 12 additions and 0 deletions
|
|
@ -678,6 +678,18 @@ static int cpuidle_coupled_cpu_notify(struct notifier_block *nb,
|
|||
int cpu = (unsigned long)hcpu;
|
||||
struct cpuidle_device *dev;
|
||||
|
||||
switch (action & ~CPU_TASKS_FROZEN) {
|
||||
case CPU_UP_PREPARE:
|
||||
case CPU_DOWN_PREPARE:
|
||||
case CPU_ONLINE:
|
||||
case CPU_DEAD:
|
||||
case CPU_UP_CANCELED:
|
||||
case CPU_DOWN_FAILED:
|
||||
break;
|
||||
default:
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
mutex_lock(&cpuidle_lock);
|
||||
|
||||
dev = per_cpu(cpuidle_devices, cpu);
|
||||
|
|
|
|||
Loading…
Reference in a new issue