genirq: Add and use an irq_data_update_affinity helper
authorSamuel Holland <samuel@sholland.org>
Fri, 1 Jul 2022 20:00:54 +0000 (15:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:57:31 +0000 (13:57 +0100)
commitc775a5246151cd9f849be3a33681011b78365b35
tree0d60fef0ab3f7a111d82b5f5d0233dd9b7f56764
parent00340ccb5407e4c60fc339b16b5d975cbd04b540
genirq: Add and use an irq_data_update_affinity helper

[ Upstream commit 073352e951f60946452da358d64841066c3142ff ]

Some architectures and irqchip drivers modify the cpumask returned by
irq_data_get_affinity_mask, usually by copying in to it. This is
problematic for uniprocessor configurations, where the affinity mask
should be constant, as it is known at compile time.

Add and use a setter for the affinity mask, following the pattern of
irq_data_update_effective_affinity. This allows the getter function to
return a const cpumask pointer.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> # Xen bits
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220701200056.46555-7-samuel@sholland.org
Stable-dep-of: feabecaff590 ("genirq/ipi: Fix NULL pointer deref in irq_data_get_affinity_mask()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/alpha/kernel/irq.c
arch/ia64/kernel/iosapic.c
arch/ia64/kernel/irq.c
arch/ia64/kernel/msi_ia64.c
arch/parisc/kernel/irq.c
drivers/irqchip/irq-bcm6345-l1.c
drivers/parisc/iosapic.c
drivers/sh/intc/chip.c
drivers/xen/events/events_base.c
include/linux/irq.h