Skip to content

Commit

Permalink
genirq: Make sure the initial affinity is not empty
Browse files Browse the repository at this point in the history
[ 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 <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Srinivas Ramana authored and gregkh committed Mar 5, 2019
1 parent 7746dd6 commit 17fab89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 17fab89

Please sign in to comment.