summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSyed Rameez Mustafa <rameezmustafa@codeaurora.org>2016-10-28 12:12:41 -0700
committerSyed Rameez Mustafa <rameezmustafa@codeaurora.org>2016-10-28 12:12:41 -0700
commit6385a475e0118abc099566ba82d8c8a59c283ff6 (patch)
tree7c1c82bbf914b54d2c85e6da73e0874f649983a8 /kernel
parentbcd8ec9210c9048c14d934e16267ba79a894db09 (diff)
sched/hmp: Disable interrupts when resetting all task stats
Taking the pi_lock without disabling interrupts in reset_all_task_stats() is problematic. In that an interrupt can end up waking a task which in turn needs the pi_lock again causing a deadlock. Disable interrupts along with taking the lock to avoid this problem. Change-Id: If27cb2bb3fcaafa5c8435f3c2e0e4be9b8f1e987 Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/hmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/hmp.c b/kernel/sched/hmp.c
index d220482f4dbc..938d3c244108 100644
--- a/kernel/sched/hmp.c
+++ b/kernel/sched/hmp.c
@@ -3106,9 +3106,9 @@ static void reset_all_task_stats(void)
read_lock(&tasklist_lock);
do_each_thread(g, p) {
- raw_spin_lock(&p->pi_lock);
+ raw_spin_lock_irq(&p->pi_lock);
reset_task_stats(p);
- raw_spin_unlock(&p->pi_lock);
+ raw_spin_unlock_irq(&p->pi_lock);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
}