mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
Merge "devfreq: memlat: fix potential deadlock during CPU hotplug"
This commit is contained in:
commit
dedd7a1e0b
1 changed files with 9 additions and 5 deletions
|
|
@ -461,8 +461,10 @@ static int memlat_event_hotplug_coming_up(unsigned int cpu)
|
|||
if (!cpu_grp)
|
||||
return -ENODEV;
|
||||
mutex_lock(&cpu_grp->mons_lock);
|
||||
ret = memlat_hp_restart_events(cpu, true);
|
||||
per_cpu(cpu_is_hp, cpu) = false;
|
||||
if (cpu_grp->num_active_mons) {
|
||||
ret = memlat_hp_restart_events(cpu, true);
|
||||
per_cpu(cpu_is_hp, cpu) = false;
|
||||
}
|
||||
mutex_unlock(&cpu_grp->mons_lock);
|
||||
|
||||
return ret;
|
||||
|
|
@ -477,8 +479,10 @@ static int memlat_event_hotplug_going_down(unsigned int cpu)
|
|||
return -ENODEV;
|
||||
/* avoid race between cpu hotplug and update_counts */
|
||||
mutex_lock(&cpu_grp->mons_lock);
|
||||
per_cpu(cpu_is_hp, cpu) = true;
|
||||
ret = memlat_hp_restart_events(cpu, false);
|
||||
if (cpu_grp->num_active_mons) {
|
||||
per_cpu(cpu_is_hp, cpu) = true;
|
||||
ret = memlat_hp_restart_events(cpu, false);
|
||||
}
|
||||
mutex_unlock(&cpu_grp->mons_lock);
|
||||
|
||||
return ret;
|
||||
|
|
@ -629,6 +633,7 @@ static void stop_hwmon(struct memlat_hwmon *hw)
|
|||
hp_idle_register_cnt--;
|
||||
mutex_unlock(¬ify_lock);
|
||||
}
|
||||
mutex_unlock(&cpu_grp->mons_lock);
|
||||
mutex_lock(¬ify_lock);
|
||||
if (!hp_idle_register_cnt) {
|
||||
cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
|
||||
|
|
@ -639,7 +644,6 @@ static void stop_hwmon(struct memlat_hwmon *hw)
|
|||
}
|
||||
}
|
||||
mutex_unlock(¬ify_lock);
|
||||
mutex_unlock(&cpu_grp->mons_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue