Skip to contentSkip to conversation

Add Xilinx Versal NET SMMU CSR interrupt controller support

PATCH Applied Tushar Nimkar 5 participants 10 messages Sep 23 – Oct 15

Subsystems (4)

v3 of 4 Applied Latest is v4 →

lore
Share & tools
lore

Tushar Nimkar

author maintainer
#0 lore raw

v3 cover Add Xilinx Versal NET SMMU CSR interrupt controller support

On Xilinx Versal NET, the ARM SMMUv3 EVENTQ, PRIQ and GERROR interrupts are routed through a vendor-specific Control and Status Register (CSR) block, where they must be enabled, cleared and acknowledged before being forwarded to the parent GIC.
This series adds a small irqchip driver for the CSR block that chains to the standard arm-smmu-v3 driver, so the generic SMMUv3 driver needs no changes.
Patch 1 adds the DT binding.
Patch 2 adds the irqchip driver.

Changes in v3:
- irqchip driver (Sashiko): harden against interrupt sources left enabled/latched by a prior boot stage:
- Mask and clear every CSR source at init, including CMD_SYNC (bit 1) which the driver does not service.
- Gate the handler on the mask register (ISR & ~MASK) instead of the raw ISR, so masked-but-latched sources are not dispatched.
- Mask and clear any active source with no mapped consumer so it cannot spin the parent line.
- dt-bindings: No changes

Link to v2:
https://lore.kernel.org/all/[email protected]/#t

Changes in v2:
- Posted as a proper threaded series with a cover letter (v1 patches went out individually).
- dt-bindings (Krzysztof):
- Dropped the irrelevant arm,smmu-v3 consumer node from the example.
- Dropped the unused "smmu_irq_csr" label from the example.
- Dropped the redundant "binding" from the patch subject.
- irqchip driver (Thomas):
- Aligned kernel-doc member descriptions and used "interrupt" instead of "IRQ".
- Used guard(raw_spinlock)() in the mask/unmask/ack callbacks and addressed the comments related to lock handling.
- Thomas suggested using devm-managed allocation and irqdomain APIs; however, the driver is registered via IRQCHIP_DECLARE() and has no associated struct device, so devm APIs cannot be used. This code is left unchanged.

Link to v1:
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/

---
Anirudha Sarangi (2):
dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR
irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

 .../xlnx,versal-net-smmu-csr.yaml                  |  75 +++++++
 MAINTAINERS                                        |  10 +
 drivers/irqchip/Kconfig                            |  10 +
 drivers/irqchip/Makefile                           |   1 +
 drivers/irqchip/irq-xilinx-smmu-csr.c              | 247 +++++++++++++++++++++
 5 files changed, 343 insertions(+)

---
base-commit: 0d9d0dbf2fddcff5859d623e90ca73c4054276e1
change-id: 20260917-smmu-changes-v2-9cf7435d6969

Best regards,

Signature · 1 line
Tushar Nimkar <[email protected]>
author maintainer
#1 lore raw

PATCH v3 1/2 dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR

From: Anirudha Sarangi <[email protected]>

Add a device tree binding schema for the Xilinx Versal NET SMMU CSR (Control and Status Register) interrupt controller.

The SMMU CSR block acts as a vendor-specific interrupt controller in front of the ARM SMMUv3, providing registers to enable and clear standard SMMU interrupts such as EVENTQ, CMDQ_SYNC, GERROR and PRIQ. Interrupts must be acknowledged in this block before being forwarded to the parent interrupt controller (e.g. GIC).

---
 .../xlnx,versal-net-smmu-csr.yaml                  | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)
Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml new file +75 -0
new file mode 100644
index 000000000000..38b63e51b732
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/xlnx,versal-net-smmu-csr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Versal NET SMMU CSR Interrupt Controller
+
+maintainers:
+  - Anirudha Sarangi <[email protected]>
+  - Tushar Nimkar <[email protected]>
+
+description: |
+  The Versal NET platform includes a Xilinx-specific SMMU CSR (Control and
+  Status Register) block that acts as an intermediate interrupt controller
+  for ARM SMMUv3.
+
+  The block provides registers to enable, disable and clear the
+  standard SMMUv3 interrupt sources (EVENTQ, CMDQ_SYNC, GERROR and PRIQ)
+  before forwarding them to the parent interrupt controller,
+  typically a GIC.
+
+  The controller receives one parent interrupt and demultiplexes CSR
+  status bits into the following child interrupt identifiers
+    0 - EVENTQ
+    1 - CMDQ_SYNC
+    2 - GERROR (GLOBAL)
+    3 - PRIQ
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  compatible:
+    const: xlnx,versal-net-smmu-csr
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 1
+    description: |
+     Single cell containing the child interrupt identifier
+      0 - EVENTQ
+      1 - CMDQ_SYNC
+      2 - GERROR (GLOBAL)
+      3 - PRIQ
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    interrupt-controller@eca10000 {
+        compatible = "xlnx,versal-net-smmu-csr";
+        reg = <0xeca10000 0x1000>;
+        interrupt-controller;
+        #interrupt-cells = <1>;
+        interrupt-parent = <&gic>;
+        interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
+    };
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR

Quoted 4 lines · Tushar Nimkar

From: Anirudha Sarangi <[email protected]>

Add a device tree binding schema for the Xilinx Versal NET SMMU CSR (Control and Status Register) interrupt controller.

This sounds like a very odd name for an interrupt controller. What else does this block do?

You've actually got a 0x1000 carve out in the example, starting at a round number, so I suspect this is "fine" and if there's other features required later you've not painted yourself into a corner by defining a device for one register. The driver having a starting offset of 0x24 is another point in your favour.

I'm inclined to ack this, I just want to see an answer first.

Cheers,
Conor.

Quoted 99 lines

The SMMU CSR block acts as a vendor-specific interrupt controller in front of the ARM SMMUv3, providing registers to enable and clear standard SMMU interrupts such as EVENTQ, CMDQ_SYNC, GERROR and PRIQ. Interrupts must be acknowledged in this block before being forwarded to the parent interrupt controller (e.g. GIC).

---
 .../xlnx,versal-net-smmu-csr.yaml                  | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)
Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml new file +75 -0
new file mode 100644
index 000000000000..38b63e51b732
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/xlnx,versal-net-smmu-csr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Versal NET SMMU CSR Interrupt Controller
+
+maintainers:
+  - Anirudha Sarangi <[email protected]>
+  - Tushar Nimkar <[email protected]>
+
+description: |
+  The Versal NET platform includes a Xilinx-specific SMMU CSR (Control and
+  Status Register) block that acts as an intermediate interrupt controller
+  for ARM SMMUv3.
+
+  The block provides registers to enable, disable and clear the
+  standard SMMUv3 interrupt sources (EVENTQ, CMDQ_SYNC, GERROR and PRIQ)
+  before forwarding them to the parent interrupt controller,
+  typically a GIC.
+
+  The controller receives one parent interrupt and demultiplexes CSR
+  status bits into the following child interrupt identifiers
+    0 - EVENTQ
+    1 - CMDQ_SYNC
+    2 - GERROR (GLOBAL)
+    3 - PRIQ
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  compatible:
+    const: xlnx,versal-net-smmu-csr
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 1
+    description: |
+     Single cell containing the child interrupt identifier
+      0 - EVENTQ
+      1 - CMDQ_SYNC
+      2 - GERROR (GLOBAL)
+      3 - PRIQ
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    interrupt-controller@eca10000 {
+        compatible = "xlnx,versal-net-smmu-csr";
+        reg = <0xeca10000 0x1000>;
+        interrupt-controller;
+        #interrupt-cells = <1>;
+        interrupt-parent = <&gic>;
+        interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
+    };
Signature · 2 lines
-- 
2.34.1
#3 lore raw

Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR

Hi Conor,

Thanks for review.

Quoted 5 lines · Conor Dooley
Quoted 4 lines · Tushar Nimkar

From: Anirudha Sarangi <[email protected]>

Add a device tree binding schema for the Xilinx Versal NET SMMU CSR (Control and Status Register) interrupt controller.

Quoted 8 lines

This sounds like a very odd name for an interrupt controller. What else does this block do?

You've actually got a 0x1000 carve out in the example, starting at a round number, so I suspect this is "fine" and if there's other features required later you've not painted yourself into a corner by defining a device for one register. The driver having a starting offset of 0x24 is another point in your favour.

The SMMU_CSR is a Xilinx-specific integration block for the ARM SMMUv3. It provides interrupt enable, status, and clear registers for SMMU interrupt sources before forwarding them to the parent GIC. The binding models the CSR block as a whole, allowing future integration-specific functionality to be added if needed.

Quoted 2 lines

I'm inclined to ack this, I just want to see an answer first.

thanks  a much !!

-Tushar

Quoted 101 lines

Cheers,
Conor.

Quoted 98 lines

The SMMU CSR block acts as a vendor-specific interrupt controller in front of the ARM SMMUv3, providing registers to enable and clear standard SMMU interrupts such as EVENTQ, CMDQ_SYNC, GERROR and PRIQ. Interrupts must be acknowledged in this block before being forwarded to the parent interrupt controller (e.g. GIC).

---
  .../xlnx,versal-net-smmu-csr.yaml                  | 75 ++++++++++++++++++++++
  1 file changed, 75 insertions(+)
Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml new file +75 -0
new file mode 100644
index 000000000000..38b63e51b732
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/xlnx,versal-net-smmu-csr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Versal NET SMMU CSR Interrupt Controller
+
+maintainers:
+  - Anirudha Sarangi <[email protected]>
+  - Tushar Nimkar <[email protected]>
+
+description: |
+  The Versal NET platform includes a Xilinx-specific SMMU CSR (Control and
+  Status Register) block that acts as an intermediate interrupt controller
+  for ARM SMMUv3.
+
+  The block provides registers to enable, disable and clear the
+  standard SMMUv3 interrupt sources (EVENTQ, CMDQ_SYNC, GERROR and PRIQ)
+  before forwarding them to the parent interrupt controller,
+  typically a GIC.
+
+  The controller receives one parent interrupt and demultiplexes CSR
+  status bits into the following child interrupt identifiers
+    0 - EVENTQ
+    1 - CMDQ_SYNC
+    2 - GERROR (GLOBAL)
+    3 - PRIQ
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  compatible:
+    const: xlnx,versal-net-smmu-csr
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 1
+    description: |
+     Single cell containing the child interrupt identifier
+      0 - EVENTQ
+      1 - CMDQ_SYNC
+      2 - GERROR (GLOBAL)
+      3 - PRIQ
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    interrupt-controller@eca10000 {
+        compatible = "xlnx,versal-net-smmu-csr";
+        reg = <0xeca10000 0x1000>;
+        interrupt-controller;
+        #interrupt-cells = <1>;
+        interrupt-parent = <&gic>;
+        interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
+    };
Signature · 2 lines
-- 
2.34.1
Acked-by
#4 lore raw

Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR

Quoted 26 lines · Tushar Nimkar

Hi Conor,

Thanks for review.

Quoted 5 lines · Conor Dooley
Quoted 4 lines · Tushar Nimkar

From: Anirudha Sarangi <[email protected]>

Add a device tree binding schema for the Xilinx Versal NET SMMU CSR (Control and Status Register) interrupt controller.

Quoted 8 lines

This sounds like a very odd name for an interrupt controller. What else does this block do?

You've actually got a 0x1000 carve out in the example, starting at a round number, so I suspect this is "fine" and if there's other features required later you've not painted yourself into a corner by defining a device for one register. The driver having a starting offset of 0x24 is another point in your favour.

The SMMU_CSR is a Xilinx-specific integration block for the ARM SMMUv3. It provides interrupt enable, status, and clear registers for SMMU interrupt sources before forwarding them to the parent GIC. The binding models the CSR block as a whole, allowing future integration-specific functionality to be added if needed.

Quoted 1 line
Quoted 3 lines
Quoted 1 line

I'm inclined to ack this, I just want to see an answer first.

thanks  a much !!

pw-bot: not-applicable

Quoted 104 lines

-Tushar

Quoted 101 lines

Cheers,
Conor.

Quoted 98 lines

The SMMU CSR block acts as a vendor-specific interrupt controller in front of the ARM SMMUv3, providing registers to enable and clear standard SMMU interrupts such as EVENTQ, CMDQ_SYNC, GERROR and PRIQ. Interrupts must be acknowledged in this block before being forwarded to the parent interrupt controller (e.g. GIC).

---
  .../xlnx,versal-net-smmu-csr.yaml                  | 75 ++++++++++++++++++++++
  1 file changed, 75 insertions(+)
Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml new file +75 -0
new file mode 100644
index 000000000000..38b63e51b732
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/xlnx,versal-net-smmu-csr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Versal NET SMMU CSR Interrupt Controller
+
+maintainers:
+  - Anirudha Sarangi <[email protected]>
+  - Tushar Nimkar <[email protected]>
+
+description: |
+  The Versal NET platform includes a Xilinx-specific SMMU CSR (Control and
+  Status Register) block that acts as an intermediate interrupt controller
+  for ARM SMMUv3.
+
+  The block provides registers to enable, disable and clear the
+  standard SMMUv3 interrupt sources (EVENTQ, CMDQ_SYNC, GERROR and PRIQ)
+  before forwarding them to the parent interrupt controller,
+  typically a GIC.
+
+  The controller receives one parent interrupt and demultiplexes CSR
+  status bits into the following child interrupt identifiers
+    0 - EVENTQ
+    1 - CMDQ_SYNC
+    2 - GERROR (GLOBAL)
+    3 - PRIQ
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  compatible:
+    const: xlnx,versal-net-smmu-csr
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 1
+    description: |
+     Single cell containing the child interrupt identifier
+      0 - EVENTQ
+      1 - CMDQ_SYNC
+      2 - GERROR (GLOBAL)
+      3 - PRIQ
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    interrupt-controller@eca10000 {
+        compatible = "xlnx,versal-net-smmu-csr";
+        reg = <0xeca10000 0x1000>;
+        interrupt-controller;
+        #interrupt-cells = <1>;
+        interrupt-parent = <&gic>;
+        interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
+    };
Signature · 2 lines
-- 
2.34.1
#5 lore raw

[tip: irq/drivers] dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR

In reply to Tushar Nimkar
The following commit has been merged into the irq/drivers branch of tip:

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     ffc1ebaef0c7e62b355a94e88cb8b63a79eec5d5
Gitweb:        https://git.kernel.org/tip/ffc1ebaef0c7e62b355a94e88cb8b63a79eec5d5
Author:        Anirudha Sarangi <[email protected]>
AuthorDate:    Wed, 23 Sep 2026 12:46:31 +05:30
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 15 Oct 2026 11:50:48 +02:00

dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR

Add a device tree binding schema for the Xilinx Versal NET SMMU CSR (Control and Status Register) interrupt controller.

The SMMU CSR block acts as a vendor-specific interrupt controller in front of the ARM SMMUv3, providing registers to enable and clear standard SMMU interrupts such as EVENTQ, CMDQ_SYNC, GERROR and PRIQ. Interrupts must be acknowledged in this block before being forwarded to the parent interrupt controller (e.g. GIC).

---
 Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 75 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml
Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml new file +75 -0
new file mode 100644
index 0000000..38b63e5
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/xlnx,versal-net-smmu-csr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Versal NET SMMU CSR Interrupt Controller
+
+maintainers:
+  - Anirudha Sarangi <[email protected]>
+  - Tushar Nimkar <[email protected]>
+
+description: |
+  The Versal NET platform includes a Xilinx-specific SMMU CSR (Control and
+  Status Register) block that acts as an intermediate interrupt controller
+  for ARM SMMUv3.
+
+  The block provides registers to enable, disable and clear the
+  standard SMMUv3 interrupt sources (EVENTQ, CMDQ_SYNC, GERROR and PRIQ)
+  before forwarding them to the parent interrupt controller,
+  typically a GIC.
+
+  The controller receives one parent interrupt and demultiplexes CSR
+  status bits into the following child interrupt identifiers
+    0 - EVENTQ
+    1 - CMDQ_SYNC
+    2 - GERROR (GLOBAL)
+    3 - PRIQ
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  compatible:
+    const: xlnx,versal-net-smmu-csr
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 1
+    description: |
+     Single cell containing the child interrupt identifier
+      0 - EVENTQ
+      1 - CMDQ_SYNC
+      2 - GERROR (GLOBAL)
+      3 - PRIQ
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    interrupt-controller@eca10000 {
+        compatible = "xlnx,versal-net-smmu-csr";
+        reg = <0xeca10000 0x1000>;
+        interrupt-controller;
+        #interrupt-cells = <1>;
+        interrupt-parent = <&gic>;
+        interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
+    };
author maintainer
#6 lore raw

PATCH v3 2/2 irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

In reply to Tushar Nimkar

From: Anirudha Sarangi <[email protected]>

The Xilinx Versal NET SoC implements a Control and Status Register (CSR) block in front of the ARM SMMUv3 to manage EVENTQ, PRIQ and GLOBAL interrupts. Interrupts are enabled, cleared, and acknowledged through this block by writing to the relevant registers. Once an interrupt is acknowledged, it is forwarded to the parent interrupt controller for further processing.

Add an irqchip driver for the CSR block. The driver registers as an interrupt controller and chains to the upstream SMMUv3 driver, so that the standard SMMUv3 driver does not require modification while still supporting Xilinx SoCs.

The CSR block can also gate the SMMUv3 CMDQ_SYNC completion interrupt (bit 1), but it is intentionally left unsupported. The Linux arm-smmu-v3 driver signals CMDQ_SYNC completion via polling or MSI and never requests a wired CMD_SYNC interrupt, so there is no in-kernel consumer for it. Exposing it as a child line would only risk spurious, never-acked interrupts, and it is omitted from the DT binding for the same reason.

This driver is intended to operate in conjunction with the ARM SMMUv3 driver and the kernel's IOMMU DMA infrastructure. These dependencies are not selected directly in Kconfig to avoid introducing dependency recursion.

---
 MAINTAINERS                           |  10 ++
 drivers/irqchip/Kconfig               |  10 ++
 drivers/irqchip/Makefile              |   1 +
 drivers/irqchip/irq-xilinx-smmu-csr.c | 247 ++++++++++++++++++++++++++++++++++
 4 files changed, 268 insertions(+)
MAINTAINERS +10 -0
index 6e50747a621c..40ef350285a6 100644
@@ -30141,6 +30141,16 @@ F:	Documentation/misc-devices/xilinx_sdfec.rst
 F:	drivers/misc/xilinx_sdfec.c
 F:	include/uapi/misc/xilinx_sdfec.h
 
+XILINX SMMU CSR IRQ DRIVER
+M:	Anirudha Sarangi <[email protected]>
+M:	Tushar Nimkar <[email protected]>
+L:	[email protected]
+L:	[email protected]
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml
+F:	drivers/irqchip/irq-xilinx-smmu-csr.c
+
 XILINX TRNG DRIVER
 M:	Mounika Botcha <[email protected]>
 M:	Harsh Jain <[email protected]>
drivers/irqchip/Kconfig +10 -0
index a8f8c423b795..81a2c9107601 100644
@@ -842,4 +842,14 @@ config SUNPLUS_SP7021_INTC
 	  chained controller, routing all interrupt source in P-Chip to
 	  the primary controller on C-Chip.
 
+config IRQCHIP_XILINX_SMMU_CSR
+	bool "Xilinx SMMU CSR Interrupt Driver"
+	depends on ARCH_ZYNQMP
+	select IRQ_DOMAIN
+	help
+	  This driver does the initial handling of SMMU interrupts before
+	  forwarding them to the ARM SMMU v3 driver.  It is intended for
+	  ZynqMP-class platforms where a vendor CSR block mediates SMMU
+	  interrupts.
+
 endmenu
drivers/irqchip/Makefile +1 -0
index ab33cccd8471..16a5fd126c9a 100644
@@ -135,3 +135,4 @@ obj-$(CONFIG_APPLE_AIC)			+= irq-apple-aic.o
 obj-$(CONFIG_MCHP_EIC)			+= irq-mchp-eic.o
 obj-$(CONFIG_SOPHGO_SG2042_MSI)		+= irq-sg2042-msi.o
 obj-$(CONFIG_SUNPLUS_SP7021_INTC)	+= irq-sp7021-intc.o
+obj-$(CONFIG_IRQCHIP_XILINX_SMMU_CSR)	+= irq-xilinx-smmu-csr.o
drivers/irqchip/irq-xilinx-smmu-csr.c new file +247 -0

247 lines not on this page · raw message

Signature · 1 line
2.34.1
#7 lore raw

Re: [PATCH v3 2/2] irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] irqchip: spurious interrupts due to handle_level_irq with latched status --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] irqchip: spurious interrupts due to handle_level_irq with latched status --

commit 2d37d393fff3fd3914b9e3ef7cecbd4d6f1c364c
Author: Anirudha Sarangi <[email protected]>

irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

The Xilinx Versal NET SoC implements a Control and Status Register (CSR) block in front of the ARM SMMUv3 to manage EVENTQ, PRIQ and GLOBAL interrupts. This commit adds an irqchip driver for the CSR block that registers as an interrupt controller and chains to the upstream SMMUv3 driver.

Quoted 5 lines
drivers/irqchip/irq-xilinx-smmu-csr.c new file +0 -0
new file mode 100644
index 0000000000000..b29aafd01dbeb

[ ... ]

Quoted 6 lines
drivers/irqchip/irq-xilinx-smmu-csr.c new file +6 -0
+static struct irq_chip xilinx_smmu_csr_chip = {
+	.name		= "xlnx-smmu-csr",
+	.irq_mask	= xilinx_smmu_csr_irq_mask,
+	.irq_unmask	= xilinx_smmu_csr_irq_unmask,
+	.irq_ack	= xilinx_smmu_csr_irq_ack,
+};

[ ... ]

drivers/irqchip/irq-xilinx-smmu-csr.c line 166

Quoted 9 lines
drivers/irqchip/irq-xilinx-smmu-csr.c new file +9 -0
+static int xilinx_smmu_csr_domain_map(struct irq_domain *d, unsigned int virq,
+				      irq_hw_number_t hwirq)
+{
+	struct xilinx_smmu_csr *csr = d->host_data;
+
+	if (!xilinx_smmu_csr_hwirq_mask(hwirq))
+		return -EINVAL;
+
+	irq_set_chip_and_handler(virq, &xilinx_smmu_csr_chip, handle_level_irq);

[Severity: High]
Will using handle_level_irq() cause spurious interrupts due to the latched status in the SMMU_CSR_ISR register?

Since handle_level_irq() acknowledges the interrupt by calling the .irq_ack callback (which clears the W1C SMMU_CSR_ISR register) before invoking the SMMUv3 device handler, the CSR block clears its status while the underlying SMMU line is still asserted.

Because the source isn't deasserted yet, the CSR block will immediately re-latch the status. When handle_level_irq() unmasks the interrupt after the SMMUv3 handler finishes, this re-latched status will trigger a second interrupt. The SMMUv3 driver will find no actual events and return IRQ_NONE, eventually causing the kernel's spurious interrupt detector to disable the GIC line.

Should this driver use handle_fasteoi_irq() and implement the .irq_eoi callback instead, so the CSR status is only cleared after the underlying SMMUv3 driver has successfully deasserted the source?

Quoted 5 lines
drivers/irqchip/irq-xilinx-smmu-csr.c new file +5 -0
+	irq_set_chip_data(virq, csr);
+	irq_set_status_flags(virq, IRQ_LEVEL);
+
+	return 0;
+}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#8 lore raw

Re: [PATCH v3 2/2] irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

Thanks for the review,

Quoted 6 lines · On 9/23/2026 12:56 PM, [email protected] wrote:

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] irqchip: spurious interrupts due to handle_level_irq with latched status --

will fix in v4

Quoted 51 lines

commit 2d37d393fff3fd3914b9e3ef7cecbd4d6f1c364c
Author: Anirudha Sarangi <[email protected]>

irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

The Xilinx Versal NET SoC implements a Control and Status Register (CSR) block in front of the ARM SMMUv3 to manage EVENTQ, PRIQ and GLOBAL interrupts. This commit adds an irqchip driver for the CSR block that registers as an interrupt controller and chains to the upstream SMMUv3 driver.

Quoted 5 lines
drivers/irqchip/irq-xilinx-smmu-csr.c new file +0 -0
new file mode 100644
index 0000000000000..b29aafd01dbeb

[ ... ]

Quoted 6 lines
drivers/irqchip/irq-xilinx-smmu-csr.c new file +6 -0
+static struct irq_chip xilinx_smmu_csr_chip = {
+     .name           = "xlnx-smmu-csr",
+     .irq_mask       = xilinx_smmu_csr_irq_mask,
+     .irq_unmask     = xilinx_smmu_csr_irq_unmask,
+     .irq_ack        = xilinx_smmu_csr_irq_ack,
+};

[ ... ]

drivers/irqchip/irq-xilinx-smmu-csr.c line 166

Quoted 9 lines
drivers/irqchip/irq-xilinx-smmu-csr.c new file +9 -0
+static int xilinx_smmu_csr_domain_map(struct irq_domain *d, unsigned int virq,
+                                   irq_hw_number_t hwirq)
+{
+     struct xilinx_smmu_csr *csr = d->host_data;
+
+     if (!xilinx_smmu_csr_hwirq_mask(hwirq))
+             return -EINVAL;
+
+     irq_set_chip_and_handler(virq, &xilinx_smmu_csr_chip, handle_level_irq);

[Severity: High]
Will using handle_level_irq() cause spurious interrupts due to the latched status in the SMMU_CSR_ISR register?

Since handle_level_irq() acknowledges the interrupt by calling the .irq_ack callback (which clears the W1C SMMU_CSR_ISR register) before invoking the SMMUv3 device handler, the CSR block clears its status while the underlying SMMU line is still asserted.

Because the source isn't deasserted yet, the CSR block will immediately re-latch the status. When handle_level_irq() unmasks the interrupt after the SMMUv3 handler finishes, this re-latched status will trigger a second interrupt. The SMMUv3 driver will find no actual events and return IRQ_NONE, eventually causing the kernel's spurious interrupt detector to disable the GIC line.

Quoted 3 lines

Should this driver use handle_fasteoi_irq() and implement the .irq_eoi callback instead, so the CSR status is only cleared after the underlying SMMUv3 driver has successfully deasserted the source?

Good catch, agreed !
SMMU_CSR_ISR is sticky W1C, so clearing it in .irq_ack before the SMMUv3 handler drains the source lets the CSR re-latch, producing a spurious IRQ_NONE that trips the spurious detector.

Fixed in v4: switched to handle_fasteoi_irq() with the W1C clear moved to .irq_eoi, plus IRQCHIP_EOI_THREADED so the clear is deferred until the threaded EVENTQ/PRIQ handler has actually drained the queue.

Thanks,
Tushar

Quoted 7 lines

drivers/irqchip/irq-xilinx-smmu-csr.c line 171

Quoted 5 lines
drivers/irqchip/irq-xilinx-smmu-csr.c new file +5 -0
+     irq_set_chip_data(virq, csr);
+     irq_set_status_flags(virq, IRQ_LEVEL);
+
+     return 0;
+}

--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2

#9 lore raw

[tip: irq/drivers] irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

In reply to Tushar Nimkar
The following commit has been merged into the irq/drivers branch of tip:

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     4af2efed57551ddc43a3fd9c23b639bc261e5c7a
Gitweb:        https://git.kernel.org/tip/4af2efed57551ddc43a3fd9c23b639bc261e5c7a
Author:        Anirudha Sarangi <[email protected]>
AuthorDate:    Wed, 23 Sep 2026 12:46:32 +05:30
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 15 Oct 2026 11:50:48 +02:00

irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

The Xilinx Versal NET SoC implements a Control and Status Register (CSR) block in front of the ARM SMMUv3 to manage EVENTQ, PRIQ and GLOBAL interrupts. Interrupts are enabled, cleared, and acknowledged through this block by writing to the relevant registers. Once an interrupt is acknowledged, it is forwarded to the parent interrupt controller for further processing.

Add an irqchip driver for the CSR block. The driver registers as an interrupt controller and chains to the upstream SMMUv3 driver, so that the standard SMMUv3 driver does not require modification while still supporting Xilinx SoCs.

The CSR block can also gate the SMMUv3 CMDQ_SYNC completion interrupt (bit 1), but it is intentionally left unsupported. The Linux arm-smmu-v3 driver signals CMDQ_SYNC completion via polling or MSI and never requests a wired CMD_SYNC interrupt, so there is no in-kernel consumer for it. Exposing it as a child line would only risk spurious, never-acked interrupts, and it is omitted from the DT binding for the same reason.

This driver is intended to operate in conjunction with the ARM SMMUv3 driver and the kernel's IOMMU DMA infrastructure. These dependencies are not selected directly in Kconfig to avoid introducing dependency recursion.

---
 MAINTAINERS                           |  10 +-
 drivers/irqchip/Kconfig               |  10 +-
 drivers/irqchip/Makefile              |   1 +-
 drivers/irqchip/irq-xilinx-smmu-csr.c | 243 +++++++++++++++++++++++++-
 4 files changed, 264 insertions(+)
 create mode 100644 drivers/irqchip/irq-xilinx-smmu-csr.c
MAINTAINERS +10 -0
index 3a19da7..f6007e7 100644
@@ -29913,6 +29913,16 @@ F:	Documentation/misc-devices/xilinx_sdfec.rst
 F:	drivers/misc/xilinx_sdfec.c
 F:	include/uapi/misc/xilinx_sdfec.h
 
+XILINX SMMU CSR IRQ DRIVER
+M:	Anirudha Sarangi <[email protected]>
+M:	Tushar Nimkar <[email protected]>
+L:	[email protected]
+L:	[email protected]
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml
+F:	drivers/irqchip/irq-xilinx-smmu-csr.c
+
 XILINX TRNG DRIVER
 M:	Mounika Botcha <[email protected]>
 M:	Harsh Jain <[email protected]>
drivers/irqchip/Kconfig +10 -0
index 06d5cbf..136bab4 100644
@@ -842,4 +842,14 @@ config SUNPLUS_SP7021_INTC
 	  chained controller, routing all interrupt source in P-Chip to
 	  the primary controller on C-Chip.
 
+config IRQCHIP_XILINX_SMMU_CSR
+	bool "Xilinx SMMU CSR Interrupt Driver"
+	depends on ARCH_ZYNQMP
+	select IRQ_DOMAIN
+	help
+	  This driver does the initial handling of SMMU interrupts before
+	  forwarding them to the ARM SMMU v3 driver.  It is intended for
+	  ZynqMP-class platforms where a vendor CSR block mediates SMMU
+	  interrupts.
+
 endmenu
drivers/irqchip/Makefile +1 -0
index ab33ccc..16a5fd1 100644
@@ -135,3 +135,4 @@ obj-$(CONFIG_APPLE_AIC)			+= irq-apple-aic.o
 obj-$(CONFIG_MCHP_EIC)			+= irq-mchp-eic.o
 obj-$(CONFIG_SOPHGO_SG2042_MSI)		+= irq-sg2042-msi.o
 obj-$(CONFIG_SUNPLUS_SP7021_INTC)	+= irq-sp7021-intc.o
+obj-$(CONFIG_IRQCHIP_XILINX_SMMU_CSR)	+= irq-xilinx-smmu-csr.o
drivers/irqchip/irq-xilinx-smmu-csr.c new file +243 -0

243 lines not on this page · raw message