Commit 5c2b0508 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'irq-core-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull interrupt subsystem updates from Thomas Gleixner:
 "Tree wide:

   - Make nr_irqs static to the core code and provide accessor functions
     to remove existing and prevent future aliasing problems with local
     variables or function arguments of the same name.

  Core code:

   - Prevent freeing an interrupt in the devres code which is not
     managed by devres in the first place.

   - Use seq_put_decimal_ull_width() for decimal values output in
     /proc/interrupts which increases performance significantly as it
     avoids parsing the format strings over and over.

   - Optimize raising the timer and hrtimer soft interrupts by using the
     'set bit only' variants instead of the combined version which
     checks whether ksoftirqd should be woken up. The latter is a
     pointless exercise as both soft interrupts are raised in the
     context of the timer interrupt and therefore never wake up
     ksoftirqd.

   - Delegate timer/hrtimer soft interrupt processing to a dedicated
     thread on RT.

     Timer and hrtimer soft interrupts are always processed in ksoftirqd
     on RT enabled kernels. This can lead to high latencies when other
     soft interrupts are delegated to ksoftirqd as well.

     The separate thread allows to run them seperately under a RT
     scheduling policy to reduce the latency overhead.

  Drivers:

   - New drivers or extensions of existing drivers to support Renesas
     RZ/V2H(P), Aspeed AST27XX, T-HEAD C900 and ATMEL sam9x7 interrupt
     chips

   - Support for multi-cluster GICs on MIPS.

     MIPS CPUs can come with multiple CPU clusters, where each CPU
     cluster has its own GIC (Generic Interrupt Controller). This
     requires to access the GIC of a remote cluster through a redirect
     register block.

     This is encapsulated into a set of helper functions to keep the
     complexity out of the actual code paths which handle the GIC
     details.

   - Support for encrypted guests in the ARM GICV3 ITS driver

     The ITS page needs to be shared with the hypervisor and therefore
     must be decrypted.

   - Small cleanups and fixes all over the place"

* tag 'irq-core-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (50 commits)
  irqchip/riscv-aplic: Prevent crash when MSI domain is missing
  genirq/proc: Use seq_put_decimal_ull_width() for decimal values
  softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.
  timers: Use __raise_softirq_irqoff() to raise the softirq.
  hrtimer: Use __raise_softirq_irqoff() to raise the softirq
  riscv: defconfig: Enable T-HEAD C900 ACLINT SSWI drivers
  irqchip: Add T-HEAD C900 ACLINT SSWI driver
  dt-bindings: interrupt-controller: Add T-HEAD C900 ACLINT SSWI device
  irqchip/stm32mp-exti: Use of_property_present() for non-boolean properties
  irqchip/mips-gic: Fix selection of GENERIC_IRQ_EFFECTIVE_AFF_MASK
  irqchip/mips-gic: Prevent indirect access to clusters without CPU cores
  irqchip/mips-gic: Multi-cluster support
  irqchip/mips-gic: Setup defaults in each cluster
  irqchip/mips-gic: Support multi-cluster in for_each_online_cpu_gic()
  irqchip/mips-gic: Replace open coded online CPU iterations
  genirq/irqdesc: Use str_enabled_disabled() helper in wakeup_show()
  genirq/devres: Don't free interrupt which is not managed by devres
  irqchip/gic-v3-its: Fix over allocation in itt_alloc_pool()
  irqchip/aspeed-intc: Add AST27XX INTC support
  dt-bindings: interrupt-controller: Add support for ASPEED AST27XX INTC
  ...
parents fb1dd140 1f181d1c
Loading
Loading
Loading
Loading
+86 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/interrupt-controller/aspeed,ast2700-intc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Aspeed AST2700 Interrupt Controller

description:
  This interrupt controller hardware is second level interrupt controller that
  is hooked to a parent interrupt controller. It's useful to combine multiple
  interrupt sources into 1 interrupt to parent interrupt controller.

maintainers:
  - Kevin Chen <kevin_chen@aspeedtech.com>

properties:
  compatible:
    enum:
      - aspeed,ast2700-intc-ic

  reg:
    maxItems: 1

  interrupt-controller: true

  '#interrupt-cells':
    const: 2
    description:
      The first cell is the IRQ number, the second cell is the trigger
      type as defined in interrupt.txt in this directory.

  interrupts:
    maxItems: 6
    description: |
      Depend to which INTC0 or INTC1 used.
      INTC0 and INTC1 are two kinds of interrupt controller with enable and raw
      status registers for use.
      INTC0 is used to assert GIC if interrupt in INTC1 asserted.
      INTC1 is used to assert INTC0 if interrupt of modules asserted.
      +-----+   +-------+     +---------+---module0
      | GIC |---| INTC0 |--+--| INTC1_0 |---module2
      |     |   |       |  |  |         |---...
      +-----+   +-------+  |  +---------+---module31
                           |
                           |   +---------+---module0
                           +---| INTC1_1 |---module2
                           |   |         |---...
                           |   +---------+---module31
                          ...
                           |   +---------+---module0
                           +---| INTC1_5 |---module2
                               |         |---...
                               +---------+---module31


required:
  - compatible
  - reg
  - interrupt-controller
  - '#interrupt-cells'
  - interrupts

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    bus {
        #address-cells = <2>;
        #size-cells = <2>;

        interrupt-controller@12101b00 {
            compatible = "aspeed,ast2700-intc-ic";
            reg = <0 0x12101b00 0 0x10>;
            #interrupt-cells = <2>;
            interrupt-controller;
            interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 194 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 195 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>;
        };
    };
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ properties:
      - atmel,sama5d3-aic
      - atmel,sama5d4-aic
      - microchip,sam9x60-aic
      - microchip,sam9x7-aic

  reg:
    maxItems: 1
+278 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/interrupt-controller/renesas,rzv2h-icu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Renesas RZ/V2H(P) Interrupt Control Unit

maintainers:
  - Fabrizio Castro <fabrizio.castro.jz@renesas.com>
  - Geert Uytterhoeven <geert+renesas@glider.be>

allOf:
  - $ref: /schemas/interrupt-controller.yaml#

description:
  The Interrupt Control Unit (ICU) handles external interrupts (NMI, IRQ, and
  TINT), error interrupts, DMAC requests, GPT interrupts, and internal
  interrupts.

properties:
  compatible:
    const: renesas,r9a09g057-icu # RZ/V2H(P)

  '#interrupt-cells':
    description: The first cell is the SPI number of the NMI or the
      PORT_IRQ[0-15] interrupt, as per user manual. The second cell is used to
      specify the flag.
    const: 2

  '#address-cells':
    const: 0

  interrupt-controller: true

  reg:
    maxItems: 1

  interrupts:
    minItems: 58
    items:
      - description: NMI interrupt
      - description: PORT_IRQ0 interrupt
      - description: PORT_IRQ1 interrupt
      - description: PORT_IRQ2 interrupt
      - description: PORT_IRQ3 interrupt
      - description: PORT_IRQ4 interrupt
      - description: PORT_IRQ5 interrupt
      - description: PORT_IRQ6 interrupt
      - description: PORT_IRQ7 interrupt
      - description: PORT_IRQ8 interrupt
      - description: PORT_IRQ9 interrupt
      - description: PORT_IRQ10 interrupt
      - description: PORT_IRQ11 interrupt
      - description: PORT_IRQ12 interrupt
      - description: PORT_IRQ13 interrupt
      - description: PORT_IRQ14 interrupt
      - description: PORT_IRQ15 interrupt
      - description: GPIO interrupt, TINT0
      - description: GPIO interrupt, TINT1
      - description: GPIO interrupt, TINT2
      - description: GPIO interrupt, TINT3
      - description: GPIO interrupt, TINT4
      - description: GPIO interrupt, TINT5
      - description: GPIO interrupt, TINT6
      - description: GPIO interrupt, TINT7
      - description: GPIO interrupt, TINT8
      - description: GPIO interrupt, TINT9
      - description: GPIO interrupt, TINT10
      - description: GPIO interrupt, TINT11
      - description: GPIO interrupt, TINT12
      - description: GPIO interrupt, TINT13
      - description: GPIO interrupt, TINT14
      - description: GPIO interrupt, TINT15
      - description: GPIO interrupt, TINT16
      - description: GPIO interrupt, TINT17
      - description: GPIO interrupt, TINT18
      - description: GPIO interrupt, TINT19
      - description: GPIO interrupt, TINT20
      - description: GPIO interrupt, TINT21
      - description: GPIO interrupt, TINT22
      - description: GPIO interrupt, TINT23
      - description: GPIO interrupt, TINT24
      - description: GPIO interrupt, TINT25
      - description: GPIO interrupt, TINT26
      - description: GPIO interrupt, TINT27
      - description: GPIO interrupt, TINT28
      - description: GPIO interrupt, TINT29
      - description: GPIO interrupt, TINT30
      - description: GPIO interrupt, TINT31
      - description: Software interrupt, INTA55_0
      - description: Software interrupt, INTA55_1
      - description: Software interrupt, INTA55_2
      - description: Software interrupt, INTA55_3
      - description: Error interrupt to CA55
      - description: GTCCRA compare match/input capture (U0)
      - description: GTCCRB compare match/input capture (U0)
      - description: GTCCRA compare match/input capture (U1)
      - description: GTCCRB compare match/input capture (U1)

  interrupt-names:
    minItems: 58
    items:
      - const: nmi
      - const: port_irq0
      - const: port_irq1
      - const: port_irq2
      - const: port_irq3
      - const: port_irq4
      - const: port_irq5
      - const: port_irq6
      - const: port_irq7
      - const: port_irq8
      - const: port_irq9
      - const: port_irq10
      - const: port_irq11
      - const: port_irq12
      - const: port_irq13
      - const: port_irq14
      - const: port_irq15
      - const: tint0
      - const: tint1
      - const: tint2
      - const: tint3
      - const: tint4
      - const: tint5
      - const: tint6
      - const: tint7
      - const: tint8
      - const: tint9
      - const: tint10
      - const: tint11
      - const: tint12
      - const: tint13
      - const: tint14
      - const: tint15
      - const: tint16
      - const: tint17
      - const: tint18
      - const: tint19
      - const: tint20
      - const: tint21
      - const: tint22
      - const: tint23
      - const: tint24
      - const: tint25
      - const: tint26
      - const: tint27
      - const: tint28
      - const: tint29
      - const: tint30
      - const: tint31
      - const: int-ca55-0
      - const: int-ca55-1
      - const: int-ca55-2
      - const: int-ca55-3
      - const: icu-error-ca55
      - const: gpt-u0-gtciada
      - const: gpt-u0-gtciadb
      - const: gpt-u1-gtciada
      - const: gpt-u1-gtciadb

  clocks:
    maxItems: 1

  power-domains:
    maxItems: 1

  resets:
    maxItems: 1

required:
  - compatible
  - reg
  - '#interrupt-cells'
  - '#address-cells'
  - interrupt-controller
  - interrupts
  - interrupt-names
  - clocks
  - power-domains
  - resets

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/clock/renesas-cpg-mssr.h>

    icu: interrupt-controller@10400000 {
        compatible = "renesas,r9a09g057-icu";
        reg = <0x10400000 0x10000>;
        #interrupt-cells = <2>;
        #address-cells = <0>;
        interrupt-controller;
        interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 419 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 420 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 421 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 423 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 426 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 427 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 428 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 429 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 430 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 431 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 433 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 434 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 435 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 436 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 437 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 438 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 439 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 440 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 441 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 442 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 443 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 444 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 445 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 446 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 447 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 448 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 449 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 450 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 262 IRQ_TYPE_EDGE_RISING>,
                     <GIC_SPI 263 IRQ_TYPE_EDGE_RISING>,
                     <GIC_SPI 264 IRQ_TYPE_EDGE_RISING>,
                     <GIC_SPI 265 IRQ_TYPE_EDGE_RISING>,
                     <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 451 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 452 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 453 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 454 IRQ_TYPE_LEVEL_HIGH>;
        interrupt-names = "nmi",
                          "port_irq0", "port_irq1", "port_irq2",
                          "port_irq3", "port_irq4", "port_irq5",
                          "port_irq6", "port_irq7", "port_irq8",
                          "port_irq9", "port_irq10", "port_irq11",
                          "port_irq12", "port_irq13", "port_irq14",
                          "port_irq15",
                          "tint0", "tint1", "tint2", "tint3",
                          "tint4", "tint5", "tint6", "tint7",
                          "tint8", "tint9", "tint10", "tint11",
                          "tint12", "tint13", "tint14", "tint15",
                          "tint16", "tint17", "tint18", "tint19",
                          "tint20", "tint21", "tint22", "tint23",
                          "tint24", "tint25", "tint26", "tint27",
                          "tint28", "tint29", "tint30", "tint31",
                          "int-ca55-0", "int-ca55-1",
                          "int-ca55-2", "int-ca55-3",
                          "icu-error-ca55",
                          "gpt-u0-gtciada", "gpt-u0-gtciadb",
                          "gpt-u1-gtciada", "gpt-u1-gtciadb";
        clocks = <&cpg CPG_MOD 0x5>;
        power-domains = <&cpg>;
        resets = <&cpg 0x36>;
    };
+58 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/interrupt-controller/thead,c900-aclint-sswi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: T-HEAD C900 ACLINT Supervisor-level Software Interrupt Device

maintainers:
  - Inochi Amaoto <inochiama@outlook.com>

description:
  The SSWI device is a part of the THEAD ACLINT device. It provides
  supervisor-level IPI functionality for a set of HARTs on a THEAD
  platform. It provides a register to set an IPI (SETSSIP) for each
  HART connected to the SSWI device.

properties:
  compatible:
    items:
      - enum:
          - sophgo,sg2044-aclint-sswi
      - const: thead,c900-aclint-sswi

  reg:
    maxItems: 1

  "#interrupt-cells":
    const: 0

  interrupt-controller: true

  interrupts-extended:
    minItems: 1
    maxItems: 4095

additionalProperties: false

required:
  - compatible
  - reg
  - "#interrupt-cells"
  - interrupt-controller
  - interrupts-extended

examples:
  - |
    interrupt-controller@94000000 {
      compatible = "sophgo,sg2044-aclint-sswi", "thead,c900-aclint-sswi";
      reg = <0x94000000 0x00004000>;
      #interrupt-cells = <0>;
      interrupt-controller;
      interrupts-extended = <&cpu1intc 1>,
                            <&cpu2intc 1>,
                            <&cpu3intc 1>,
                            <&cpu4intc 1>;
    };
...
+2 −3
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ void handle_IRQ(unsigned int irq, struct pt_regs *regs)
	 * Some hardware gives randomly wrong interrupts.  Rather
	 * than crashing, do something sensible.
	 */
	if (unlikely(!irq || irq >= nr_irqs))
	if (unlikely(!irq || irq >= irq_get_nr_irqs()))
		desc = NULL;
	else
		desc = irq_to_desc(irq);
@@ -151,7 +151,6 @@ void __init init_IRQ(void)
#ifdef CONFIG_SPARSE_IRQ
int __init arch_probe_nr_irqs(void)
{
	nr_irqs = machine_desc->nr_irqs ? machine_desc->nr_irqs : NR_IRQS;
	return nr_irqs;
	return irq_set_nr_irqs(machine_desc->nr_irqs ? : NR_IRQS);
}
#endif
Loading