* [PATCH] arm64: dts: rockchip: adjust SMMU interrupt type @ 2025-02-10 21:37 Patrick Wildt 2025-02-11 7:40 ` Heiko Stübner 2025-02-11 20:35 ` Heiko Stuebner 0 siblings, 2 replies; 5+ messages in thread From: Patrick Wildt @ 2025-02-10 21:37 UTC (permalink / raw) To: linux-rockchip Cc: linux-arm-kernel, devicetree, Kever Yang, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner The SMMU architecture requires wired interrupts to be edge triggered, which does not align with the DT description for the RK3588. This leads to interrupt storms, as the SMMU continues to hold the pin high and only pulls it down for a short amount when issuing an IRQ. Update the DT description to be in line with the spec and perceived reality. Signed-off-by: Patrick Wildt <patrick@blueri.se> --- arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi index 8cfa30837ce7..520d0814a4de 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi @@ -549,10 +549,10 @@ usb_host2_xhci: usb@fcd00000 { mmu600_pcie: iommu@fc900000 { compatible = "arm,smmu-v3"; reg = <0x0 0xfc900000 0x0 0x200000>; - interrupts = <GIC_SPI 369 IRQ_TYPE_LEVEL_HIGH 0>, - <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH 0>, - <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH 0>, - <GIC_SPI 367 IRQ_TYPE_LEVEL_HIGH 0>; + interrupts = <GIC_SPI 369 IRQ_TYPE_EDGE_RISING 0>, + <GIC_SPI 371 IRQ_TYPE_EDGE_RISING 0>, + <GIC_SPI 374 IRQ_TYPE_EDGE_RISING 0>, + <GIC_SPI 367 IRQ_TYPE_EDGE_RISING 0>; interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; #iommu-cells = <1>; }; @@ -560,10 +560,10 @@ mmu600_pcie: iommu@fc900000 { mmu600_php: iommu@fcb00000 { compatible = "arm,smmu-v3"; reg = <0x0 0xfcb00000 0x0 0x200000>; - interrupts = <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH 0>, - <GIC_SPI 383 IRQ_TYPE_LEVEL_HIGH 0>, - <GIC_SPI 386 IRQ_TYPE_LEVEL_HIGH 0>, - <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH 0>; + interrupts = <GIC_SPI 381 IRQ_TYPE_EDGE_RISING 0>, + <GIC_SPI 383 IRQ_TYPE_EDGE_RISING 0>, + <GIC_SPI 386 IRQ_TYPE_EDGE_RISING 0>, + <GIC_SPI 379 IRQ_TYPE_EDGE_RISING 0>; interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; #iommu-cells = <1>; status = "disabled"; -- 2.48.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] arm64: dts: rockchip: adjust SMMU interrupt type 2025-02-10 21:37 [PATCH] arm64: dts: rockchip: adjust SMMU interrupt type Patrick Wildt @ 2025-02-11 7:40 ` Heiko Stübner 2025-02-11 12:22 ` Niklas Cassel 2025-02-11 20:35 ` Heiko Stuebner 1 sibling, 1 reply; 5+ messages in thread From: Heiko Stübner @ 2025-02-11 7:40 UTC (permalink / raw) To: linux-rockchip, Patrick Wildt, Niklas Cassel Cc: linux-arm-kernel, devicetree, Kever Yang, Rob Herring, Krzysztof Kozlowski, Conor Dooley, robin.murphy Am Montag, 10. Februar 2025, 22:37:29 MEZ schrieb Patrick Wildt: > The SMMU architecture requires wired interrupts to be edge triggered, > which does not align with the DT description for the RK3588. This leads > to interrupt storms, as the SMMU continues to hold the pin high and only > pulls it down for a short amount when issuing an IRQ. Update the DT > description to be in line with the spec and perceived reality. > Cc'ed Niklas This should probably also get a Fixes: cd81d3a0695c ("arm64: dts: rockchip: add rk3588 pcie and php IOMMUs") > Signed-off-by: Patrick Wildt <patrick@blueri.se> > --- > arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi > index 8cfa30837ce7..520d0814a4de 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi > @@ -549,10 +549,10 @@ usb_host2_xhci: usb@fcd00000 { > mmu600_pcie: iommu@fc900000 { > compatible = "arm,smmu-v3"; > reg = <0x0 0xfc900000 0x0 0x200000>; > - interrupts = <GIC_SPI 369 IRQ_TYPE_LEVEL_HIGH 0>, > - <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH 0>, > - <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH 0>, > - <GIC_SPI 367 IRQ_TYPE_LEVEL_HIGH 0>; > + interrupts = <GIC_SPI 369 IRQ_TYPE_EDGE_RISING 0>, > + <GIC_SPI 371 IRQ_TYPE_EDGE_RISING 0>, > + <GIC_SPI 374 IRQ_TYPE_EDGE_RISING 0>, > + <GIC_SPI 367 IRQ_TYPE_EDGE_RISING 0>; > interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; > #iommu-cells = <1>; > }; > @@ -560,10 +560,10 @@ mmu600_pcie: iommu@fc900000 { > mmu600_php: iommu@fcb00000 { > compatible = "arm,smmu-v3"; > reg = <0x0 0xfcb00000 0x0 0x200000>; > - interrupts = <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH 0>, > - <GIC_SPI 383 IRQ_TYPE_LEVEL_HIGH 0>, > - <GIC_SPI 386 IRQ_TYPE_LEVEL_HIGH 0>, > - <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH 0>; > + interrupts = <GIC_SPI 381 IRQ_TYPE_EDGE_RISING 0>, > + <GIC_SPI 383 IRQ_TYPE_EDGE_RISING 0>, > + <GIC_SPI 386 IRQ_TYPE_EDGE_RISING 0>, > + <GIC_SPI 379 IRQ_TYPE_EDGE_RISING 0>; > interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; > #iommu-cells = <1>; > status = "disabled"; > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] arm64: dts: rockchip: adjust SMMU interrupt type 2025-02-11 7:40 ` Heiko Stübner @ 2025-02-11 12:22 ` Niklas Cassel 2025-02-11 18:17 ` Robin Murphy 0 siblings, 1 reply; 5+ messages in thread From: Niklas Cassel @ 2025-02-11 12:22 UTC (permalink / raw) To: Heiko Stübner Cc: linux-rockchip, Patrick Wildt, linux-arm-kernel, devicetree, Kever Yang, Rob Herring, Krzysztof Kozlowski, Conor Dooley, robin.murphy On Tue, Feb 11, 2025 at 08:40:25AM +0100, Heiko Stübner wrote: > Am Montag, 10. Februar 2025, 22:37:29 MEZ schrieb Patrick Wildt: > > The SMMU architecture requires wired interrupts to be edge triggered, > > which does not align with the DT description for the RK3588. This leads > > to interrupt storms, as the SMMU continues to hold the pin high and only > > pulls it down for a short amount when issuing an IRQ. Update the DT > > description to be in line with the spec and perceived reality. > > > > Cc'ed Niklas > > This should probably also get a > > Fixes: cd81d3a0695c ("arm64: dts: rockchip: add rk3588 pcie and php IOMMUs") Agreed. > > > Signed-off-by: Patrick Wildt <patrick@blueri.se> > > --- > > arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 16 ++++++++-------- > > 1 file changed, 8 insertions(+), 8 deletions(-) > > > > diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi > > index 8cfa30837ce7..520d0814a4de 100644 > > --- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi > > +++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi > > @@ -549,10 +549,10 @@ usb_host2_xhci: usb@fcd00000 { > > mmu600_pcie: iommu@fc900000 { > > compatible = "arm,smmu-v3"; > > reg = <0x0 0xfc900000 0x0 0x200000>; > > - interrupts = <GIC_SPI 369 IRQ_TYPE_LEVEL_HIGH 0>, > > - <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH 0>, > > - <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH 0>, > > - <GIC_SPI 367 IRQ_TYPE_LEVEL_HIGH 0>; > > + interrupts = <GIC_SPI 369 IRQ_TYPE_EDGE_RISING 0>, > > + <GIC_SPI 371 IRQ_TYPE_EDGE_RISING 0>, > > + <GIC_SPI 374 IRQ_TYPE_EDGE_RISING 0>, > > + <GIC_SPI 367 IRQ_TYPE_EDGE_RISING 0>; > > interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; > > #iommu-cells = <1>; > > }; > > @@ -560,10 +560,10 @@ mmu600_pcie: iommu@fc900000 { > > mmu600_php: iommu@fcb00000 { > > compatible = "arm,smmu-v3"; > > reg = <0x0 0xfcb00000 0x0 0x200000>; > > - interrupts = <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH 0>, > > - <GIC_SPI 383 IRQ_TYPE_LEVEL_HIGH 0>, > > - <GIC_SPI 386 IRQ_TYPE_LEVEL_HIGH 0>, > > - <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH 0>; > > + interrupts = <GIC_SPI 381 IRQ_TYPE_EDGE_RISING 0>, > > + <GIC_SPI 383 IRQ_TYPE_EDGE_RISING 0>, > > + <GIC_SPI 386 IRQ_TYPE_EDGE_RISING 0>, > > + <GIC_SPI 379 IRQ_TYPE_EDGE_RISING 0>; > > interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; > > #iommu-cells = <1>; > > status = "disabled"; > > Patrick, thank you for the patch! FWIW, they have the same bug in downstream: https://github.com/radxa/kernel/blob/linux-6.1-stan-rkr4.1/arch/arm64/boot/dts/rockchip/rk3588s.dtsi#L2761-L2783 However, the Rockchip PCIe Virtualization Developer Guide correctly define the IRQs as edge triggered: https://dl.radxa.com/users/dev/Rockchip_PCIe_Virtualization_Developer_Guide_CN.pdf Looking at the ARM SMMUv3 architecture specification: "An implementation must support one of, or optionally both of, wired interrupts and MSIs. Whether an implementation supports MSIs is discoverable from SMMU_IDR0.MSI and SMMU_S_IDR0.MSI. An implementation might support wired interrupt outputs that are edge-triggered. The discovery of support for wired interrupts is IMPLEMENTATION DEFINED." Thus: Reviewed-by: Niklas Cassel <cassel@kernel.org> Heiko, this patch should go to 6.14. Side note: We also have another SMMU patch that should go to 6.14: https://lore.kernel.org/linux-rockchip/20250207143900.2047949-2-cassel@kernel.org/ Kind regards, Niklas ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] arm64: dts: rockchip: adjust SMMU interrupt type 2025-02-11 12:22 ` Niklas Cassel @ 2025-02-11 18:17 ` Robin Murphy 0 siblings, 0 replies; 5+ messages in thread From: Robin Murphy @ 2025-02-11 18:17 UTC (permalink / raw) To: Niklas Cassel, Heiko Stübner Cc: linux-rockchip, Patrick Wildt, linux-arm-kernel, devicetree, Kever Yang, Rob Herring, Krzysztof Kozlowski, Conor Dooley On 2025-02-11 12:22 pm, Niklas Cassel wrote: > On Tue, Feb 11, 2025 at 08:40:25AM +0100, Heiko Stübner wrote: >> Am Montag, 10. Februar 2025, 22:37:29 MEZ schrieb Patrick Wildt: >>> The SMMU architecture requires wired interrupts to be edge triggered, >>> which does not align with the DT description for the RK3588. This leads >>> to interrupt storms, as the SMMU continues to hold the pin high and only >>> pulls it down for a short amount when issuing an IRQ. Update the DT >>> description to be in line with the spec and perceived reality. >>> >> >> Cc'ed Niklas >> >> This should probably also get a >> >> Fixes: cd81d3a0695c ("arm64: dts: rockchip: add rk3588 pcie and php IOMMUs") > > Agreed. > > >> >>> Signed-off-by: Patrick Wildt <patrick@blueri.se> >>> --- >>> arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 16 ++++++++-------- >>> 1 file changed, 8 insertions(+), 8 deletions(-) >>> >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi >>> index 8cfa30837ce7..520d0814a4de 100644 >>> --- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi >>> +++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi >>> @@ -549,10 +549,10 @@ usb_host2_xhci: usb@fcd00000 { >>> mmu600_pcie: iommu@fc900000 { >>> compatible = "arm,smmu-v3"; >>> reg = <0x0 0xfc900000 0x0 0x200000>; >>> - interrupts = <GIC_SPI 369 IRQ_TYPE_LEVEL_HIGH 0>, >>> - <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH 0>, >>> - <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH 0>, >>> - <GIC_SPI 367 IRQ_TYPE_LEVEL_HIGH 0>; >>> + interrupts = <GIC_SPI 369 IRQ_TYPE_EDGE_RISING 0>, >>> + <GIC_SPI 371 IRQ_TYPE_EDGE_RISING 0>, >>> + <GIC_SPI 374 IRQ_TYPE_EDGE_RISING 0>, >>> + <GIC_SPI 367 IRQ_TYPE_EDGE_RISING 0>; >>> interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; >>> #iommu-cells = <1>; >>> }; >>> @@ -560,10 +560,10 @@ mmu600_pcie: iommu@fc900000 { >>> mmu600_php: iommu@fcb00000 { >>> compatible = "arm,smmu-v3"; >>> reg = <0x0 0xfcb00000 0x0 0x200000>; >>> - interrupts = <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH 0>, >>> - <GIC_SPI 383 IRQ_TYPE_LEVEL_HIGH 0>, >>> - <GIC_SPI 386 IRQ_TYPE_LEVEL_HIGH 0>, >>> - <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH 0>; >>> + interrupts = <GIC_SPI 381 IRQ_TYPE_EDGE_RISING 0>, >>> + <GIC_SPI 383 IRQ_TYPE_EDGE_RISING 0>, >>> + <GIC_SPI 386 IRQ_TYPE_EDGE_RISING 0>, >>> + <GIC_SPI 379 IRQ_TYPE_EDGE_RISING 0>; >>> interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; >>> #iommu-cells = <1>; >>> status = "disabled"; >>> > > Patrick, thank you for the patch! > > FWIW, they have the same bug in downstream: > https://github.com/radxa/kernel/blob/linux-6.1-stan-rkr4.1/arch/arm64/boot/dts/rockchip/rk3588s.dtsi#L2761-L2783 > > However, the Rockchip PCIe Virtualization Developer Guide correctly define > the IRQs as edge triggered: > https://dl.radxa.com/users/dev/Rockchip_PCIe_Virtualization_Developer_Guide_CN.pdf > > Looking at the ARM SMMUv3 architecture specification: > "An implementation must support one of, or optionally both of, wired > interrupts and MSIs. Whether an implementation supports MSIs is discoverable > from SMMU_IDR0.MSI and SMMU_S_IDR0.MSI. An implementation might support wired > interrupt outputs that are edge-triggered. The discovery of support for wired > interrupts is IMPLEMENTATION DEFINED." Yup, rising edge is certainly what MMU-600 spits out. Thanks, Robin. > > Thus: > Reviewed-by: Niklas Cassel <cassel@kernel.org> > > > Heiko, this patch should go to 6.14. > > Side note: We also have another SMMU patch that should go to 6.14: > https://lore.kernel.org/linux-rockchip/20250207143900.2047949-2-cassel@kernel.org/ > > > Kind regards, > Niklas ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] arm64: dts: rockchip: adjust SMMU interrupt type 2025-02-10 21:37 [PATCH] arm64: dts: rockchip: adjust SMMU interrupt type Patrick Wildt 2025-02-11 7:40 ` Heiko Stübner @ 2025-02-11 20:35 ` Heiko Stuebner 1 sibling, 0 replies; 5+ messages in thread From: Heiko Stuebner @ 2025-02-11 20:35 UTC (permalink / raw) To: linux-rockchip, Patrick Wildt Cc: Heiko Stuebner, linux-arm-kernel, devicetree, Kever Yang, Rob Herring, Krzysztof Kozlowski, Conor Dooley On Mon, 10 Feb 2025 22:37:29 +0100, Patrick Wildt wrote: > The SMMU architecture requires wired interrupts to be edge triggered, > which does not align with the DT description for the RK3588. This leads > to interrupt storms, as the SMMU continues to hold the pin high and only > pulls it down for a short amount when issuing an IRQ. Update the DT > description to be in line with the spec and perceived reality. > > > [...] Applied, thanks! [1/1] arm64: dts: rockchip: adjust SMMU interrupt type commit: 8546cfd08aa4b982acd2357403a1f15495d622ec Best regards, -- Heiko Stuebner <heiko@sntech.de> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-02-11 20:38 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-02-10 21:37 [PATCH] arm64: dts: rockchip: adjust SMMU interrupt type Patrick Wildt 2025-02-11 7:40 ` Heiko Stübner 2025-02-11 12:22 ` Niklas Cassel 2025-02-11 18:17 ` Robin Murphy 2025-02-11 20:35 ` Heiko Stuebner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).