This series solves some inconsistency with how IRQ affinity masks are
handled between SMP and non-SMP configurations.
In non-SMP configs, an IRQ's true affinity is always cpumask_of(0), so
irq_{,data_}get_affinity_mask now return that, instead of returning an
uninitialized per-IRQ cpumask. This change makes iterating over the
affinity mask do the right thing in both SMP and non-SMP configurations.
To accomplish that:
- patches 1-3 disable some library code that was broken anyway on !SMP
- patches 4-7 refactor the code so that irq_{,data_}get_affinity_mask
can return a const cpumask, since that is what cpumask_of provides
- patch 8 drops the per-IRQ cpumask and replaces it with cpumask_of(0)
This series was split from the v2 series here, which uses the new
behavior in the RISC-V PLIC irqchip driver:
https://lore.kernel.org/lkml/[email protected]/
Changes in v3:
- New patch to fix build errors in uniprocessor MIPS configs
- New patch to drop irq_init_effective_affinity
- New patch to introduce irq_data_update_affinity
- New patch to make the returned cpumasks const
- Use cpumask_of(0) instead of cpu_possible_mask
Changes in v2:
- New patch to prevent GENERIC_IRQ_IPI from being selected on !SMP
Samuel Holland (8):
irqchip/mips-gic: Only register IPI domain when SMP is enabled
genirq: GENERIC_IRQ_IPI depends on SMP
genirq: GENERIC_IRQ_EFFECTIVE_AFF_MASK depends on SMP
genirq: Drop redundant irq_init_effective_affinity
genirq: Refactor accessors to use irq_data_get_affinity_mask
genirq: Add and use an irq_data_update_affinity helper
genirq: Return a const cpumask from irq_data_get_affinity_mask
genirq: Provide an IRQ affinity mask in non-SMP configs
arch/alpha/kernel/irq.c | 2 +-
arch/arm/mach-hisi/Kconfig | 2 +-
arch/ia64/kernel/iosapic.c | 2 +-
arch/ia64/kernel/irq.c | 4 +-
arch/ia64/kernel/msi_ia64.c | 4 +-
arch/mips/cavium-octeon/octeon-irq.c | 4 +-
arch/parisc/kernel/irq.c | 2 +-
arch/sh/kernel/irq.c | 7 +--
arch/x86/hyperv/irqdomain.c | 2 +-
arch/xtensa/kernel/irq.c | 7 +--
drivers/iommu/hyperv-iommu.c | 2 +-
drivers/irqchip/Kconfig | 19 +++----
drivers/irqchip/irq-bcm6345-l1.c | 4 +-
drivers/irqchip/irq-mips-gic.c | 80 +++++++++++++++++++---------
drivers/parisc/iosapic.c | 2 +-
drivers/pci/controller/pci-hyperv.c | 10 ++--
drivers/sh/intc/chip.c | 2 +-
drivers/xen/events/events_base.c | 7 +--
include/linux/irq.h | 34 ++++++++----
kernel/irq/Kconfig | 2 +
kernel/irq/chip.c | 8 +--
kernel/irq/debugfs.c | 2 +-
kernel/irq/ipi.c | 16 +++---
kernel/irq/manage.c | 10 +---
24 files changed, 140 insertions(+), 94 deletions(-)
--
2.35.1
It does exactly the same thing as irq_data_update_effective_affinity.
Signed-off-by: Samuel Holland <[email protected]>
---
Changes in v3:
- New patch to drop irq_init_effective_affinity
kernel/irq/manage.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 8c396319d5ac..40fe7806cc8c 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -205,16 +205,8 @@ static void irq_validate_effective_affinity(struct irq_data *data)
pr_warn_once("irq_chip %s did not update eff. affinity mask of irq %u\n",
chip->name, data->irq);
}
-
-static inline void irq_init_effective_affinity(struct irq_data *data,
- const struct cpumask *mask)
-{
- cpumask_copy(irq_data_get_effective_affinity_mask(data), mask);
-}
#else
static inline void irq_validate_effective_affinity(struct irq_data *data) { }
-static inline void irq_init_effective_affinity(struct irq_data *data,
- const struct cpumask *mask) { }
#endif
int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
@@ -347,7 +339,7 @@ static bool irq_set_affinity_deactivated(struct irq_data *data,
return false;
cpumask_copy(desc->irq_common_data.affinity, mask);
- irq_init_effective_affinity(data, mask);
+ irq_data_update_effective_affinity(data, mask);
irqd_set(data, IRQD_AFFINITY_SET);
return true;
}
--
2.35.1
The following commit has been merged into the irq/irqchip-next branch of irqchip:
Commit-ID: 610306306aaa56ab324d03a55138ea611be9e282
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/610306306aaa56ab324d03a55138ea611be9e282
Author: Samuel Holland <[email protected]>
AuthorDate: Fri, 01 Jul 2022 15:00:52 -05:00
Committer: Marc Zyngier <[email protected]>
CommitterDate: Thu, 07 Jul 2022 09:38:04 +01:00
genirq: Drop redundant irq_init_effective_affinity
It does exactly the same thing as irq_data_update_effective_affinity.
Signed-off-by: Samuel Holland <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
kernel/irq/manage.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 8c39631..40fe780 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -205,16 +205,8 @@ static void irq_validate_effective_affinity(struct irq_data *data)
pr_warn_once("irq_chip %s did not update eff. affinity mask of irq %u\n",
chip->name, data->irq);
}
-
-static inline void irq_init_effective_affinity(struct irq_data *data,
- const struct cpumask *mask)
-{
- cpumask_copy(irq_data_get_effective_affinity_mask(data), mask);
-}
#else
static inline void irq_validate_effective_affinity(struct irq_data *data) { }
-static inline void irq_init_effective_affinity(struct irq_data *data,
- const struct cpumask *mask) { }
#endif
int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
@@ -347,7 +339,7 @@ static bool irq_set_affinity_deactivated(struct irq_data *data,
return false;
cpumask_copy(desc->irq_common_data.affinity, mask);
- irq_init_effective_affinity(data, mask);
+ irq_data_update_effective_affinity(data, mask);
irqd_set(data, IRQD_AFFINITY_SET);
return true;
}