From d9ffca841291c9f54dc2b3136134b871c11d56d0 Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Tue, 5 Jan 2021 15:07:28 -0800 Subject: [PATCH] ANDROID: irq/proc: use active cpus for allowed irq affinity With the introduction of pause, irqs should avoid paused cpus. Previously, when userspace set the irq affinity, it was only filtered toward online cpus. A cpu can be paused but online, and irqs should avoid. Check the cpu_active_mask instead of the online mask when writing the irq affinity, such that the subset of cpus allowed doesn't include inactive cpus. Bug: 161210528 Change-Id: I359a452cc97ad58ad85e9613a29d144ffcd51567 Signed-off-by: Stephen Dickey --- kernel/irq/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 72513ed2a5fc..0459b6983510 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -157,9 +157,9 @@ static ssize_t write_irq_affinity(int type, struct file *file, /* * Do not allow disabling IRQs completely - it's a too easy * way to make the system unusable accidentally :-) At least - * one online CPU still has to be targeted. + * one active CPU still has to be targeted. */ - if (!cpumask_intersects(new_value, cpu_online_mask)) { + if (!cpumask_intersects(new_value, cpu_active_mask)) { /* * Special case for empty set - allow the architecture code * to set default SMP affinity.