Add Xilinx Versal NET SMMU CSR interrupt controller support
Tushar Nimkar
maintainerv3 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]>
Tushar Nimkar
maintainerPATCH 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
@@ -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
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).Signed-off-by Anirudha Sarangi <[email protected]>Co-developed-by Tushar Nimkar <[email protected]>Signed-off-by Tushar Nimkar <[email protected]>--- .../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@@ -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
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
0x1000carve 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 of0x24is 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).Signed-off-by Anirudha Sarangi <[email protected]>Co-developed-by Tushar Nimkar <[email protected]>Signed-off-by Tushar Nimkar <[email protected]>--- .../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@@ -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
Conor Dooley
Acked-byRe: [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
0x1000carve 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 of0x24is another point in your favour.The
SMMU_CSRis 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).Signed-off-by Anirudha Sarangi <[email protected]>Co-developed-by Tushar Nimkar <[email protected]>Signed-off-by Tushar Nimkar <[email protected]>--- .../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@@ -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
[tip: irq/drivers] dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR
In reply to Tushar NimkarThe 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
@@ -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>; + };
Tushar Nimkar
maintainerPATCH v3 2/2 irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver
In reply to Tushar NimkarFrom: 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
@@ -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
@@ -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
@@ -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
[email protected]
AI reviewRe: [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
[ ... ]
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
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 tohandle_level_irqwith 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[ ... ]
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 usinghandle_level_irq()cause spurious interrupts due to the latched status in theSMMU_CSR_ISRregister?Since
handle_level_irq()acknowledges the interrupt by calling the .irq_ack callback (which clears the W1CSMMU_CSR_ISRregister) 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 returnIRQ_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
[tip: irq/drivers] irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver
In reply to Tushar NimkarThe 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
@@ -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
@@ -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
@@ -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