diff options
author | Srinivas Ramana <sramana@codeaurora.org> | 2018-12-20 19:05:57 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-05 17:58:47 +0100 |
commit | 17fab8914f8650f9d815919c14228915e02558a2 (patch) | |
tree | 888f6263bbc8c9140819a5432f81598775f4d189 | |
parent | 7746dd64c2c9e08c60e2cf735b1bc2c9e227ea0d (diff) | |
download | linux-stable-17fab8914f8650f9d815919c14228915e02558a2.tar.gz linux-stable-17fab8914f8650f9d815919c14228915e02558a2.tar.bz2 linux-stable-17fab8914f8650f9d815919c14228915e02558a2.zip |
genirq: Make sure the initial affinity is not empty
[ Upstream commit bddda606ec76550dd63592e32a6e87e7d32583f7 ]
If all CPUs in the irq_default_affinity mask are offline when an interrupt
is initialized then irq_setup_affinity() can set an empty affinity mask for
a newly allocated interrupt.
Fix this by falling back to cpu_online_mask in case the resulting affinity
mask is zero.
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-msm@vger.kernel.org
Link: https://lkml.kernel.org/r/1545312957-8504-1-git-send-email-sramana@codeaurora.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | kernel/irq/manage.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 9dbdccab3b6a..5c0ba5ca5930 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -393,6 +393,9 @@ int irq_setup_affinity(struct irq_desc *desc) } cpumask_and(&mask, cpu_online_mask, set); + if (cpumask_empty(&mask)) + cpumask_copy(&mask, cpu_online_mask); + if (node != NUMA_NO_NODE) { const struct cpumask *nodemask = cpumask_of_node(node); |