projects/linux·commit 03ffbcdd

Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

03ffbcdd · Linus Torvalds <[email protected]> · 2017-07-03 16:50:31 -07:00

Pull irq updates from Thomas Gleixner:
 "The irq department delivers:

   - Expand the generic infrastructure handling the irq migration on CPU
     hotplug and convert X86 over to it. (Thomas Gleixner)

     Aside of consolidating code this is a preparatory change for:

   - Finalizing the affinity management for multi-queue devices. The
     main change here is to shut down interrupts which are affine to a
     outgoing CPU and reenabling them when the CPU comes online again.
     That avoids moving interrupts pointlessly around and breaking and
     reestablishing affinities for no value. (Christoph Hellwig)

     Note: This contains also the BLOCK-MQ and NVME changes which depend
     on the rework of the irq core infrastructure. Jens acked them and
     agreed that they should go with the irq changes.

   - Consolidation of irq domain code (Marc Zyngier)

   - State tracking consolidation in the core code (Jeffy Chen)

   - Add debug infrastructure for hierarchical irq domains (Thomas
     Gleixner)

   - Infrastructure enhancement for managing generic interrupt chips via
     devmem (Bartosz Golaszewski)

   - Constification work all over the place (Tobias Klauser)

   - Two new interrupt controller drivers for MVEBU (Thomas Petazzoni)

   - The usual set of fixes, updates and enhancements all over the
     place"

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (112 commits)
  irqchip/or1k-pic: Fix interrupt acknowledgement
  irqchip/irq-mvebu-gicp: Allocate enough memory for spi_bitmap
  irqchip/gic-v3: Fix out-of-bound access in gic_set_affinity
  nvme: Allocate queues for all possible CPUs
  blk-mq: Create hctx for each present CPU
  blk-mq: Include all present CPUs in the default queue mapping
  genirq: Avoid unnecessary low level irq function calls
  genirq: Set irq masked state when initializing irq_desc
  genirq/timings: Add infrastructure for estimating the next interrupt arrival time
  genirq/timings: Add infrastructure to track the interrupt timings
  genirq/debugfs: Remove pointless NULL pointer check
  irqchip/gic-v3-its: Don't assume GICv3 hardware supports 16bit INTID
  irqchip/gic-v3-its: Add ACPI NUMA node mapping
  irqchip/gic-v3-its-platform-msi: Make of_device_ids const
  irqchip/gic-v3-its: Make of_device_ids const
  irqchip/irq-mvebu-icu: Add new driver for Marvell ICU
  irqchip/irq-mvebu-gicp: Add new driver for Marvell GICP
  dt-bindings/interrupt-controller: Add DT binding for the Marvell ICU
  genirq/irqdomain: Remove auto-recursive hierarchy support
  irqchip/MSI: Use irq_domain_update_bus_token instead of an open coded access
  ...
Commit
03ffbcdd7898c0b5299efeb9f18de927487ec1cf
Parents
1b044f1c · f9632de4

Merge commit. Changes below are compared with the first parent: 1b044f1c.

Changes

86 files changed · +3342 −709

FileStatusAddDelContent
Documentation/IRQ-domain.txtmodified+39−2View file
Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-nmi.txtmodified+5−2View file
Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-i2c-ic.txtadded+25−0View file
Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-vic.txtmodified+5−4View file
Documentation/devicetree/bindings/interrupt-controller/marvell,gicp.txtadded+27−0View file
Documentation/devicetree/bindings/interrupt-controller/marvell,icu.txtadded+51−0View file
Documentation/driver-model/devres.txtmodified+2−0View file
arch/x86/Kconfigmodified+2−0View file
arch/x86/include/asm/apic.hmodified+11−25View file
arch/x86/include/asm/irq.hmodified+0−1View file
arch/x86/include/asm/irq_remapping.hmodified+2−1View file
arch/x86/kernel/apic/apic.cmodified+22−13View file
arch/x86/kernel/apic/apic_flat_64.cmodified+2−2View file
arch/x86/kernel/apic/apic_noop.cmodified+1−1View file
arch/x86/kernel/apic/apic_numachip.cmodified+2−2View file
arch/x86/kernel/apic/bigsmp_32.cmodified+1−1View file
arch/x86/kernel/apic/htirq.cmodified+15−4View file
arch/x86/kernel/apic/io_apic.cmodified+20−2View file
arch/x86/kernel/apic/msi.cmodified+43−10View file
arch/x86/kernel/apic/probe_32.cmodified+1−1View file
arch/x86/kernel/apic/vector.cmodified+35−14View file
arch/x86/kernel/apic/x2apic_cluster.cmodified+16−20View file
arch/x86/kernel/apic/x2apic_phys.cmodified+1−1View file
arch/x86/kernel/apic/x2apic_uv_x.cmodified+7−19View file
arch/x86/kernel/irq.cmodified+2−76View file
arch/x86/platform/uv/uv_irq.cmodified+13−5View file
arch/x86/xen/apic.cmodified+1−1View file
block/blk-mq-cpumap.cmodified+4−6View file
block/blk-mq.cmodified+11−109View file
block/blk-mq.hmodified+0−5View file
drivers/base/platform-msi.cmodified+1−1View file
drivers/iommu/amd_iommu.cmodified+15−7View file
drivers/iommu/intel_irq_remapping.cmodified+21−10View file
drivers/irqchip/Kconfigmodified+6−0View file
drivers/irqchip/Makefilemodified+3−1View file
drivers/irqchip/irq-armada-370-xp.cmodified+130−18View file
drivers/irqchip/irq-aspeed-i2c-ic.cadded+115−0View file
drivers/irqchip/irq-aspeed-vic.cmodified+3−2View file
drivers/irqchip/irq-gic-v2m.cmodified+1−1View file
drivers/irqchip/irq-gic-v3-its-pci-msi.cmodified+17−18View file
drivers/irqchip/irq-gic-v3-its-platform-msi.cmodified+1−1View file
drivers/irqchip/irq-gic-v3-its.cmodified+93−20View file
drivers/irqchip/irq-gic-v3.cmodified+3−0View file
drivers/irqchip/irq-i8259.cmodified+1−1View file
drivers/irqchip/irq-imx-gpcv2.cmodified+1−1View file
drivers/irqchip/irq-mbigen.cmodified+1−1View file
drivers/irqchip/irq-mips-cpu.cmodified+1−1View file
drivers/irqchip/irq-mips-gic.cmodified+2−2View file
drivers/irqchip/irq-mvebu-gicp.cadded+279−0View file
drivers/irqchip/irq-mvebu-gicp.hadded+11−0View file
drivers/irqchip/irq-mvebu-icu.cadded+289−0View file
drivers/irqchip/irq-or1k-pic.cmodified+1−1View file
drivers/irqchip/irq-renesas-h8300h.cmodified+1−1View file
drivers/irqchip/irq-renesas-h8s.cmodified+1−1View file
drivers/irqchip/irq-sunxi-nmi.cmodified+54−14View file
drivers/irqchip/qcom-irq-combiner.cmodified+1−6View file
drivers/nvme/host/pci.cmodified+1−1View file
drivers/pci/host/vmd.cmodified+7−1View file
drivers/pci/msi.cmodified+1−1View file
drivers/staging/fsl-mc/bus/fsl-mc-msi.cmodified+1−1View file
drivers/xen/events/events_base.cmodified+5−1View file
include/dt-bindings/interrupt-controller/mvebu-icu.hadded+15−0View file
include/linux/cpuhotplug.hmodified+1−1View file
include/linux/interrupt.hmodified+6−0View file
include/linux/irq.hmodified+89−0View file
include/linux/irqdesc.hmodified+4−0View file
include/linux/irqdomain.hmodified+39−4View file
kernel/cpu.cmodified+5−0View file
kernel/irq/Kconfigmodified+18−0View file
kernel/irq/Makefilemodified+2−0View file
kernel/irq/affinity.cmodified+63−13View file
kernel/irq/autoprobe.cmodified+2−2View file
kernel/irq/chip.cmodified+157−38View file
kernel/irq/cpuhotplug.cmodified+126−24View file
kernel/irq/debugfs.cadded+213−0View file
kernel/irq/devres.cmodified+86−0View file
kernel/irq/generic-chip.cmodified+3−4View file
kernel/irq/handle.cmodified+2−0View file
kernel/irq/internals.hmodified+223−2View file
kernel/irq/irqdesc.cmodified+26−10View file
kernel/irq/irqdomain.cmodified+279−80View file
kernel/irq/manage.cmodified+47−72View file
kernel/irq/migration.cmodified+30−0View file
kernel/irq/msi.cmodified+10−3View file
kernel/irq/proc.cmodified+94−16View file
kernel/irq/timings.cadded+369−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/IRQ-domain.txt

View file
diff --git a/Documentation/IRQ-domain.txt b/Documentation/IRQ-domain.txt
index 82001a2..1f246eb 100644
--- a/Documentation/IRQ-domain.txt
+++ b/Documentation/IRQ-domain.txt
@@ -231,5 +231,42 @@ needs to:
4) No need to implement irq_domain_ops.map and irq_domain_ops.unmap,
they are unused with hierarchy irq_domain.
-Hierarchy irq_domain may also be used to support other architectures,
-such as ARM, ARM64 etc.
+Hierarchy irq_domain is in no way x86 specific, and is heavily used to
+support other architectures, such as ARM, ARM64 etc.
+
+=== Debugging ===
+
+If you switch on CONFIG_IRQ_DOMAIN_DEBUG (which depends on
+CONFIG_IRQ_DOMAIN and CONFIG_DEBUG_FS), you will find a new file in
+your debugfs mount point, called irq_domain_mapping. This file
+contains a live snapshot of all the IRQ domains in the system:
+
+ name mapped linear-max direct-max devtree-node
+ pl061 8 8 0 /smb/gpio@e0080000
+ pl061 8 8 0 /smb/gpio@e1050000
+ pMSI 0 0 0 /interrupt-controller@e1101000/v2m@e0080000
+ MSI 37 0 0 /interrupt-controller@e1101000/v2m@e0080000
+ GICv2m 37 0 0 /interrupt-controller@e1101000/v2m@e0080000
+ GICv2 448 448 0 /interrupt-controller@e1101000
+
+it also iterates over the interrupts to display their mapping in the
+domains, and makes the domain stacking visible:
+
+
+irq hwirq chip name chip data active type domain
+ 1 0x00019 GICv2 0xffff00000916bfd8 * LINEAR GICv2
+ 2 0x0001d GICv2 0xffff00000916bfd8 LINEAR GICv2
+ 3 0x0001e GICv2 0xffff00000916bfd8 * LINEAR GICv2
+ 4 0x0001b GICv2 0xffff00000916bfd8 * LINEAR GICv2
+ 5 0x0001a GICv2 0xffff00000916bfd8 LINEAR GICv2
+[...]
+ 96 0x81808 MSI 0x (null) RADIX MSI
+ 96+ 0x00063 GICv2m 0xffff8003ee116980 RADIX GICv2m
+ 96+ 0x00063 GICv2 0xffff00000916bfd8 LINEAR GICv2
+ 97 0x08800 MSI 0x (null) * RADIX MSI
+ 97+ 0x00064 GICv2m 0xffff8003ee116980 * RADIX GICv2m
+ 97+ 0x00064 GICv2 0xffff00000916bfd8 * LINEAR GICv2
+
+Here, interrupts 1-5 are only using a single domain, while 96 and 97
+are build out of a stack of three domain, each level performing a
+particular function.

Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-nmi.txt

View file
diff --git a/Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-nmi.txt b/Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-nmi.txt
index 81cd369..4ae553e 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-nmi.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-nmi.txt
@@ -3,8 +3,11 @@ Allwinner Sunxi NMI Controller
Required properties:
-- compatible : should be "allwinner,sun7i-a20-sc-nmi" or
- "allwinner,sun6i-a31-sc-nmi" or "allwinner,sun9i-a80-nmi"
+- compatible : should be one of the following:
+ - "allwinner,sun7i-a20-sc-nmi"
+ - "allwinner,sun6i-a31-sc-nmi" (deprecated)
+ - "allwinner,sun6i-a31-r-intc"
+ - "allwinner,sun9i-a80-nmi"
- reg : Specifies base physical address and size of the registers.
- interrupt-controller : Identifies the node as an interrupt controller
- #interrupt-cells : Specifies the number of cells needed to encode an

Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-i2c-ic.txt

View file
diff --git a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-i2c-ic.txt b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-i2c-ic.txt
new file mode 100644
index 0000000..033cc82
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-i2c-ic.txt
@@ -0,0 +1,25 @@
+Device tree configuration for the I2C Interrupt Controller on the AST24XX and
+AST25XX SoCs.
+
+Required Properties:
+- #address-cells : should be 1
+- #size-cells : should be 1
+- #interrupt-cells : should be 1
+- compatible : should be "aspeed,ast2400-i2c-ic"
+ or "aspeed,ast2500-i2c-ic"
+- reg : address start and range of controller
+- interrupts : interrupt number
+- interrupt-controller : denotes that the controller receives and fires
+ new interrupts for child busses
+
+Example:
+
+i2c_ic: interrupt-controller@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ #interrupt-cells = <1>;
+ compatible = "aspeed,ast2400-i2c-ic";
+ reg = <0x0 0x40>;
+ interrupts = <12>;
+ interrupt-controller;
+};

Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-vic.txt

View file
diff --git a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-vic.txt b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-vic.txt
index 6c6e853..e3fea07 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-vic.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-vic.txt
@@ -1,12 +1,13 @@
Aspeed Vectored Interrupt Controller
-These bindings are for the Aspeed AST2400 interrupt controller register layout.
-The SoC has an legacy register layout, but this driver does not support that
-mode of operation.
+These bindings are for the Aspeed interrupt controller. The AST2400 and
+AST2500 SoC families include a legacy register layout before a re-designed
+layout, but the bindings do not prescribe the use of one or the other.
Required properties:
-- compatible : should be "aspeed,ast2400-vic".
+- compatible : "aspeed,ast2400-vic"
+ "aspeed,ast2500-vic"
- interrupt-controller : Identifies the node as an interrupt controller
- #interrupt-cells : Specifies the number of cells needed to encode an

Documentation/devicetree/bindings/interrupt-controller/marvell,gicp.txt

View file
diff --git a/Documentation/devicetree/bindings/interrupt-controller/marvell,gicp.txt b/Documentation/devicetree/bindings/interrupt-controller/marvell,gicp.txt
new file mode 100644
index 0000000..64a00ce
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/marvell,gicp.txt
@@ -0,0 +1,27 @@
+Marvell GICP Controller
+-----------------------
+
+GICP is a Marvell extension of the GIC that allows to trigger GIC SPI
+interrupts by doing a memory transaction. It is used by the ICU
+located in the Marvell CP110 to turn wired interrupts inside the CP
+into GIC SPI interrupts.
+
+Required properties:
+
+- compatible: Must be "marvell,ap806-gicp"
+
+- reg: Must be the address and size of the GICP SPI registers
+
+- marvell,spi-ranges: tuples of GIC SPI interrupts ranges available
+ for this GICP
+
+- msi-controller: indicates that this is an MSI controller
+
+Example:
+
+gicp_spi: gicp-spi@3f0040 {
+ compatible = "marvell,ap806-gicp";
+ reg = <0x3f0040 0x10>;
+ marvell,spi-ranges = <64 64>, <288 64>;
+ msi-controller;
+};

Documentation/devicetree/bindings/interrupt-controller/marvell,icu.txt

View file
diff --git a/Documentation/devicetree/bindings/interrupt-controller/marvell,icu.txt b/Documentation/devicetree/bindings/interrupt-controller/marvell,icu.txt
new file mode 100644
index 0000000..aa8bf2e
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/marvell,icu.txt
@@ -0,0 +1,51 @@
+Marvell ICU Interrupt Controller
+--------------------------------
+
+The Marvell ICU (Interrupt Consolidation Unit) controller is
+responsible for collecting all wired-interrupt sources in the CP and
+communicating them to the GIC in the AP, the unit translates interrupt
+requests on input wires to MSG memory mapped transactions to the GIC.
+
+Required properties:
+
+- compatible: Should be "marvell,cp110-icu"
+
+- reg: Should contain ICU registers location and length.
+
+- #interrupt-cells: Specifies the number of cells needed to encode an
+ interrupt source. The value shall be 3.
+
+ The 1st cell is the group type of the ICU interrupt. Possible group
+ types are:
+
+ ICU_GRP_NSR (0x0) : Shared peripheral interrupt, non-secure
+ ICU_GRP_SR (0x1) : Shared peripheral interrupt, secure
+ ICU_GRP_SEI (0x4) : System error interrupt
+ ICU_GRP_REI (0x5) : RAM error interrupt
+
+ The 2nd cell is the index of the interrupt in the ICU unit.
+
+ The 3rd cell is the type of the interrupt. See arm,gic.txt for
+ details.
+
+- interrupt-controller: Identifies the node as an interrupt
+ controller.
+
+- msi-parent: Should point to the GICP controller, the GIC extension
+ that allows to trigger interrupts using MSG memory mapped
+ transactions.
+
+Example:
+
+icu: interrupt-controller@1e0000 {
+ compatible = "marvell,cp110-icu";
+ reg = <0x1e0000 0x10>;
+ #interrupt-cells = <3>;
+ interrupt-controller;
+ msi-parent = <&gicp>;
+};
+
+usb3h0: usb3@500000 {
+ interrupt-parent = <&icu>;
+ interrupts = <ICU_GRP_NSR 106 IRQ_TYPE_LEVEL_HIGH>;
+};

Documentation/driver-model/devres.txt

View file
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index e72587f..6a6618f 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -311,6 +311,8 @@ IRQ
devm_irq_alloc_desc_at()
devm_irq_alloc_desc_from()
devm_irq_alloc_descs_from()
+ devm_irq_alloc_generic_chip()
+ devm_irq_setup_generic_chip()
LED
devm_led_classdev_register()

arch/x86/Kconfig

View file
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 737212c..7bdb902 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -87,6 +87,8 @@ config X86
select GENERIC_EARLY_IOREMAP
select GENERIC_FIND_FIRST_BIT
select GENERIC_IOMAP
+ select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
+ select GENERIC_IRQ_MIGRATION if SMP
select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW
select GENERIC_PENDING_IRQ if SMP

arch/x86/include/asm/apic.h

View file
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index bdffcd9..5f01671 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -252,6 +252,8 @@ static inline int x2apic_enabled(void) { return 0; }
#define x2apic_supported() (0)
#endif /* !CONFIG_X86_X2APIC */
+struct irq_data;
+
/*
* Copyright 2004 James Cleverdon, IBM.
* Subject to the GNU Public License, v.2
@@ -296,9 +298,9 @@ struct apic {
/* Can't be NULL on 64-bit */
unsigned long (*set_apic_id)(unsigned int id);
- int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
- const struct cpumask *andmask,
- unsigned int *apicid);
+ int (*cpu_mask_to_apicid)(const struct cpumask *cpumask,
+ struct irq_data *irqdata,
+ unsigned int *apicid);
/* ipi */
void (*send_IPI)(int cpu, int vector);
@@ -540,28 +542,12 @@ static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
#endif
-static inline int
-flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
- const struct cpumask *andmask,
- unsigned int *apicid)
-{
- unsigned long cpu_mask = cpumask_bits(cpumask)[0] &
- cpumask_bits(andmask)[0] &
- cpumask_bits(cpu_online_mask)[0] &
- APIC_ALL_CPUS;
-
- if (likely(cpu_mask)) {
- *apicid = (unsigned int)cpu_mask;
- return 0;
- } else {
- return -EINVAL;
- }
-}
-
-extern int
-default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
- const struct cpumask *andmask,
- unsigned int *apicid);
+extern int flat_cpu_mask_to_apicid(const struct cpumask *cpumask,
+ struct irq_data *irqdata,
+ unsigned int *apicid);
+extern int default_cpu_mask_to_apicid(const struct cpumask *cpumask,
+ struct irq_data *irqdata,
+ unsigned int *apicid);
static inline void
flat_vector_allocation_domain(int cpu, struct cpumask *retmask,

arch/x86/include/asm/irq.h

View file
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 16d3fa2..668cca5 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -29,7 +29,6 @@ struct irq_desc;
#include <linux/cpumask.h>
extern int check_irq_vectors_for_cpu_disable(void);
extern void fixup_irqs(void);
-extern void irq_force_complete_move(struct irq_desc *desc);
#endif
#ifdef CONFIG_HAVE_KVM

arch/x86/include/asm/irq_remapping.h

View file
diff --git a/arch/x86/include/asm/irq_remapping.h b/arch/x86/include/asm/irq_remapping.h
index a210eba..023b4a9 100644
--- a/arch/x86/include/asm/irq_remapping.h
+++ b/arch/x86/include/asm/irq_remapping.h
@@ -55,7 +55,8 @@ extern struct irq_domain *
irq_remapping_get_irq_domain(struct irq_alloc_info *info);
/* Create PCI MSI/MSIx irqdomain, use @parent as the parent irqdomain. */
-extern struct irq_domain *arch_create_msi_irq_domain(struct irq_domain *parent);
+extern struct irq_domain *
+arch_create_remap_msi_irq_domain(struct irq_domain *par, const char *n, int id);
/* Get parent irqdomain for interrupt remapping irqdomain */
static inline struct irq_domain *arch_get_ir_parent_domain(void)

arch/x86/kernel/apic/apic.c

View file
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 2d75faf..e740946 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2201,23 +2201,32 @@ void default_init_apic_ldr(void)
apic_write(APIC_LDR, val);
}
-int default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
- const struct cpumask *andmask,
- unsigned int *apicid)
+int default_cpu_mask_to_apicid(const struct cpumask *mask,
+ struct irq_data *irqdata,
+ unsigned int *apicid)
{
- unsigned int cpu;
+ unsigned int cpu = cpumask_first(mask);
- for_each_cpu_and(cpu, cpumask, andmask) {
- if (cpumask_test_cpu(cpu, cpu_online_mask))
- break;
- }
+ if (cpu >= nr_cpu_ids)
+ return -EINVAL;
+ *apicid = per_cpu(x86_cpu_to_apicid, cpu);
+ irq_data_update_effective_affinity(irqdata, cpumask_of(cpu));
+ return 0;
+}
- if (likely(cpu < nr_cpu_ids)) {
- *apicid = per_cpu(x86_cpu_to_apicid, cpu);
- return 0;
- }
+int flat_cpu_mask_to_apicid(const struct cpumask *mask,
+ struct irq_data *irqdata,
+ unsigned int *apicid)
- return -EINVAL;
+{
+ struct cpumask *effmsk = irq_data_get_effective_affinity_mask(irqdata);
+ unsigned long cpu_mask = cpumask_bits(mask)[0] & APIC_ALL_CPUS;
+
+ if (!cpu_mask)
+ return -EINVAL;
+ *apicid = (unsigned int)cpu_mask;
+ cpumask_bits(effmsk)[0] = cpu_mask;
+ return 0;
}
/*

arch/x86/kernel/apic/apic_flat_64.c

View file
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
index a4d7ff2..dedd5a4 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -172,7 +172,7 @@ static struct apic apic_flat __ro_after_init = {
.get_apic_id = flat_get_apic_id,
.set_apic_id = set_apic_id,
- .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and,
+ .cpu_mask_to_apicid = flat_cpu_mask_to_apicid,
.send_IPI = default_send_IPI_single,
.send_IPI_mask = flat_send_IPI_mask,
@@ -268,7 +268,7 @@ static struct apic apic_physflat __ro_after_init = {
.get_apic_id = flat_get_apic_id,
.set_apic_id = set_apic_id,
- .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
+ .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
.send_IPI = default_send_IPI_single_phys,
.send_IPI_mask = default_send_IPI_mask_sequence_phys,

arch/x86/kernel/apic/apic_noop.c

View file
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c
index 2262eb6..6599f43 100644
--- a/arch/x86/kernel/apic/apic_noop.c
+++ b/arch/x86/kernel/apic/apic_noop.c
@@ -141,7 +141,7 @@ struct apic apic_noop __ro_after_init = {
.get_apic_id = noop_get_apic_id,
.set_apic_id = NULL,
- .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and,
+ .cpu_mask_to_apicid = flat_cpu_mask_to_apicid,
.send_IPI = noop_send_IPI,
.send_IPI_mask = noop_send_IPI_mask,

arch/x86/kernel/apic/apic_numachip.c

View file
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
index e08fe2c..2fda912 100644
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -267,7 +267,7 @@ static const struct apic apic_numachip1 __refconst = {
.get_apic_id = numachip1_get_apic_id,
.set_apic_id = numachip1_set_apic_id,
- .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
+ .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
.send_IPI = numachip_send_IPI_one,
.send_IPI_mask = numachip_send_IPI_mask,
@@ -318,7 +318,7 @@ static const struct apic apic_numachip2 __refconst = {
.get_apic_id = numachip2_get_apic_id,
.set_apic_id = numachip2_set_apic_id,
- .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
+ .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
.send_IPI = numachip_send_IPI_one,
.send_IPI_mask = numachip_send_IPI_mask,

arch/x86/kernel/apic/bigsmp_32.c

View file
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
index 5601201..456e45e 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -172,7 +172,7 @@ static struct apic apic_bigsmp __ro_after_init = {
.get_apic_id = bigsmp_get_apic_id,
.set_apic_id = NULL,
- .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
+ .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
.send_IPI = default_send_IPI_single_phys,
.send_IPI_mask = default_send_IPI_mask_sequence_phys,

arch/x86/kernel/apic/htirq.c

View file
diff --git a/arch/x86/kernel/apic/htirq.c b/arch/x86/kernel/apic/htirq.c
index 81ff489..56ccf93 100644
--- a/arch/x86/kernel/apic/htirq.c
+++ b/arch/x86/kernel/apic/htirq.c
@@ -152,14 +152,25 @@ static const struct irq_domain_ops htirq_domain_ops = {
void __init arch_init_htirq_domain(struct irq_domain *parent)
{
+ struct fwnode_handle *fn;
+
if (disable_apic)
return;
- htirq_domain = irq_domain_add_tree(NULL, &htirq_domain_ops, NULL);
+ fn = irq_domain_alloc_named_fwnode("PCI-HT");
+ if (!fn)
+ goto warn;
+
+ htirq_domain = irq_domain_create_tree(fn, &htirq_domain_ops, NULL);
+ irq_domain_free_fwnode(fn);
if (!htirq_domain)
- pr_warn("failed to initialize irqdomain for HTIRQ.\n");
- else
- htirq_domain->parent = parent;
+ goto warn;
+
+ htirq_domain->parent = parent;
+ return;
+
+warn:
+ pr_warn("Failed to initialize irqdomain for HTIRQ.\n");
}
int arch_setup_ht_irq(int idx, int pos, struct pci_dev *dev,

arch/x86/kernel/apic/io_apic.c

View file
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 247880f..b4f5f73 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2201,6 +2201,8 @@ static int mp_irqdomain_create(int ioapic)
struct ioapic *ip = &ioapics[ioapic];
struct ioapic_domain_cfg *cfg = &ip->irqdomain_cfg;
struct mp_ioapic_gsi *gsi_cfg = mp_ioapic_gsi_routing(ioapic);
+ struct fwnode_handle *fn;
+ char *name = "IO-APIC";
if (cfg->type == IOAPIC_DOMAIN_INVALID)
return 0;
@@ -2211,9 +2213,25 @@ static int mp_irqdomain_create(int ioapic)
parent = irq_remapping_get_ir_irq_domain(&info);
if (!parent)
parent = x86_vector_domain;
+ else
+ name = "IO-APIC-IR";
+
+ /* Handle device tree enumerated APICs proper */
+ if (cfg->dev) {
+ fn = of_node_to_fwnode(cfg->dev);
+ } else {
+ fn = irq_domain_alloc_named_id_fwnode(name, ioapic);
+ if (!fn)
+ return -ENOMEM;
+ }
+
+ ip->irqdomain = irq_domain_create_linear(fn, hwirqs, cfg->ops,
+ (void *)(long)ioapic);
+
+ /* Release fw handle if it was allocated above */
+ if (!cfg->dev)
+ irq_domain_free_fwnode(fn);
- ip->irqdomain = irq_domain_add_linear(cfg->dev, hwirqs, cfg->ops,
- (void *)(long)ioapic);
if (!ip->irqdomain)
return -ENOMEM;

arch/x86/kernel/apic/msi.c

View file
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 4c5d188..9b18be7 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -138,11 +138,18 @@ static struct msi_domain_info pci_msi_domain_info = {
void __init arch_init_msi_domain(struct irq_domain *parent)
{
+ struct fwnode_handle *fn;
+
if (disable_apic)
return;
- msi_default_domain = pci_msi_create_irq_domain(NULL,
- &pci_msi_domain_info, parent);
+ fn = irq_domain_alloc_named_fwnode("PCI-MSI");
+ if (fn) {
+ msi_default_domain =
+ pci_msi_create_irq_domain(fn, &pci_msi_domain_info,
+ parent);
+ irq_domain_free_fwnode(fn);
+ }
if (!msi_default_domain)
pr_warn("failed to initialize irqdomain for MSI/MSI-x.\n");
}
@@ -167,9 +174,18 @@ static struct msi_domain_info pci_msi_ir_domain_info = {
.handler_name = "edge",
};
-struct irq_domain *arch_create_msi_irq_domain(struct irq_domain *parent)
+struct irq_domain *arch_create_remap_msi_irq_domain(struct irq_domain *parent,
+ const char *name, int id)
{
- return pci_msi_create_irq_domain(NULL, &pci_msi_ir_domain_info, parent);
+ struct fwnode_handle *fn;
+ struct irq_domain *d;
+
+ fn = irq_domain_alloc_named_id_fwnode(name, id);
+ if (!fn)
+ return NULL;
+ d = pci_msi_create_irq_domain(fn, &pci_msi_ir_domain_info, parent);
+ irq_domain_free_fwnode(fn);
+ return d;
}
#endif
@@ -221,13 +237,20 @@ static struct irq_domain *dmar_get_irq_domain(void)
{
static struct irq_domain *dmar_domain;
static DEFINE_MUTEX(dmar_lock);
+ struct fwnode_handle *fn;
mutex_lock(&dmar_lock);
- if (dmar_domain == NULL)
- dmar_domain = msi_create_irq_domain(NULL, &dmar_msi_domain_info,
+ if (dmar_domain)
+ goto out;
+
+ fn = irq_domain_alloc_named_fwnode("DMAR-MSI");
+ if (fn) {
+ dmar_domain = msi_create_irq_domain(fn, &dmar_msi_domain_info,
x86_vector_domain);
+ irq_domain_free_fwnode(fn);
+ }
+out:
mutex_unlock(&dmar_lock);
-
return dmar_domain;
}
@@ -317,9 +340,10 @@ static struct msi_domain_info hpet_msi_domain_info = {
struct irq_domain *hpet_create_irq_domain(int hpet_id)
{
- struct irq_domain *parent;
- struct irq_alloc_info info;
struct msi_domain_info *domain_info;
+ struct irq_domain *parent, *d;
+ struct irq_alloc_info info;
+ struct fwnode_handle *fn;
if (x86_vector_domain == NULL)

This diff is incomplete. Download the complete patch.

arch/x86/kernel/apic/probe_32.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/apic/vector.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/apic/x2apic_cluster.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/apic/x2apic_phys.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/apic/x2apic_uv_x.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/irq.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/platform/uv/uv_irq.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/xen/apic.c

View file

This diff is incomplete. Download the complete patch.

block/blk-mq-cpumap.c

View file

This diff is incomplete. Download the complete patch.

block/blk-mq.c

View file

This diff is incomplete. Download the complete patch.

block/blk-mq.h

View file

This diff is incomplete. Download the complete patch.

drivers/base/platform-msi.c

View file

This diff is incomplete. Download the complete patch.

drivers/iommu/amd_iommu.c

View file

This diff is incomplete. Download the complete patch.

drivers/iommu/intel_irq_remapping.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-armada-370-xp.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-aspeed-i2c-ic.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-aspeed-vic.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-gic-v2m.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-gic-v3-its-pci-msi.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-gic-v3-its-platform-msi.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-gic-v3-its.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-gic-v3.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-i8259.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-imx-gpcv2.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-mbigen.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-mips-cpu.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-mips-gic.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-mvebu-gicp.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-mvebu-gicp.h

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-mvebu-icu.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-or1k-pic.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-renesas-h8300h.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-renesas-h8s.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/irq-sunxi-nmi.c

View file

This diff is incomplete. Download the complete patch.

drivers/irqchip/qcom-irq-combiner.c

View file

This diff is incomplete. Download the complete patch.

drivers/nvme/host/pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/host/vmd.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/msi.c

View file

This diff is incomplete. Download the complete patch.

drivers/staging/fsl-mc/bus/fsl-mc-msi.c

View file

This diff is incomplete. Download the complete patch.

drivers/xen/events/events_base.c

View file

This diff is incomplete. Download the complete patch.

include/dt-bindings/interrupt-controller/mvebu-icu.h

View file

This diff is incomplete. Download the complete patch.

include/linux/cpuhotplug.h

View file

This diff is incomplete. Download the complete patch.

include/linux/interrupt.h

View file

This diff is incomplete. Download the complete patch.

include/linux/irq.h

View file

This diff is incomplete. Download the complete patch.

include/linux/irqdesc.h

View file

This diff is incomplete. Download the complete patch.

include/linux/irqdomain.h

View file

This diff is incomplete. Download the complete patch.

kernel/cpu.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/Kconfig

View file

This diff is incomplete. Download the complete patch.

kernel/irq/Makefile

View file

This diff is incomplete. Download the complete patch.

kernel/irq/affinity.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/autoprobe.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/chip.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/cpuhotplug.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/debugfs.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/devres.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/generic-chip.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/handle.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/internals.h

View file

This diff is incomplete. Download the complete patch.

kernel/irq/irqdesc.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/irqdomain.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/manage.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/migration.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/msi.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/proc.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/timings.c

View file

This diff is incomplete. Download the complete patch.