From: Srinivas Ramana Date: Thu, 20 Dec 2018 13:35:57 +0000 (+0530) Subject: genirq: Make sure the initial affinity is not empty X-Git-Tag: v4.14.105~37 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=10a1f3195914fe650b326364ccbb942080ce72dd;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Thomas Gleixner 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 --- diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 4cd85870f00e6..6c877d28838f2 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -360,6 +360,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);