summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorShay Drory <shayd@nvidia.com>2024-08-06 10:20:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-19 05:33:52 +0200
commitda18145e7dd4365099ba143802cd8e5dda85d801 (patch)
tree58d4345c5255c847d074ff7d14f5a19a9ee67fec /kernel
parent55b2a5d331a6ceb1c4372945fdb77181265ba24f (diff)
downloadlinux-da18145e7dd4365099ba143802cd8e5dda85d801.tar.gz
linux-da18145e7dd4365099ba143802cd8e5dda85d801.tar.bz2
linux-da18145e7dd4365099ba143802cd8e5dda85d801.zip
genirq/irqdesc: Honor caller provided affinity in alloc_desc()
commit edbbaae42a56f9a2b39c52ef2504dfb3fb0a7858 upstream. Currently, whenever a caller is providing an affinity hint for an interrupt, the allocation code uses it to calculate the node and copies the cpumask into irq_desc::affinity. If the affinity for the interrupt is not marked 'managed' then the startup of the interrupt ignores irq_desc::affinity and uses the system default affinity mask. Prevent this by setting the IRQD_AFFINITY_SET flag for the interrupt in the allocator, which causes irq_setup_affinity() to use irq_desc::affinity on interrupt startup if the mask contains an online CPU. [ tglx: Massaged changelog ] Fixes: 45ddcecbfa94 ("genirq: Use affinity hint in irqdesc allocation") Signed-off-by: Shay Drory <shayd@nvidia.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/all/20240806072044.837827-1-shayd@nvidia.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/irqdesc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 0272a2e36ae6..a0e86b426ba5 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -491,6 +491,7 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node,
flags = IRQD_AFFINITY_MANAGED |
IRQD_MANAGED_SHUTDOWN;
}
+ flags |= IRQD_AFFINITY_SET;
mask = &affinity->mask;
node = cpu_to_node(cpumask_first(mask));
affinity++;