ALT Linux kernel packages development
 help / color / mirror / Atom feed
From: Anton Midyukov <antohami@altlinux.org>
To: devel-kernel@lists.altlinux.org
Subject: [d-kernel] [PATCH 28/30] arm64: dts: rockchip: disable IOMMU when running rk3588 in PCIe endpoint mode
Date: Tue, 22 Apr 2025 13:04:47 +0300
Message-ID: <217f8cdb8c6dc763c2f381e4320ef2fe569adc10.1745307792.git.antohami@altlinux.org> (raw)
In-Reply-To: <cover.1745307792.git.antohami@altlinux.org>

From: Niklas Cassel <cassel@kernel.org>

Commit da92d3dfc871 ("arm64: dts: rockchip: enable the mmu600_pcie IOMMU
on the rk3588 SoC") enabled the mmu600_pcie IOMMU, both in the normal case
(when all PCIe controllers are running in Root Complex mode) and in the
case when running the pcie3x4 PCIe controller in Endpoint mode.

There have been no issues detected when running the PCIe controllers in
Root Complex mode. During PCI probe time, we will add a SID to the IOMMU
for each PCI device enumerated on the bus, including the root port itself.

However, when running the pcie3x4 PCIe controller in Endpoint mode, we
will only add a single SID to the IOMMU (the SID specified in the iommus
DT property).

The enablement of IOMMU in endpoint mode was verified on setup with two
Rock 5b:s, where the BDF of the Root Complex has BDF (00:00.0).

A Root Complex sending a TLP to the Endpoint will have Requester ID set
to the BDF of the initiator. On the EP side, the Requester ID will then
be used as the SID. This works fine if the Root Complex has a BDF that
matches the iommus DT property, however, if the Root Complex has any other
BDF, we will see something like:
arm-smmu-v3 fc900000.iommu: event: C_BAD_STREAMID client: (unassigned sid) sid: 0x1600 ssid: 0x0
on the endpoint side.

For PCIe controllers running in endpoint mode that always uses the
incoming Requester ID as the SID, the iommus DT property simply isn't
a viable solution. (Neither is iommu-map a viable solution, as there is
no enumeration done on the endpoint side.)

Thus, partly revert commit da92d3dfc871 ("arm64: dts: rockchip: enable the
mmu600_pcie IOMMU on the rk3588 SoC") by disabling the PCI IOMMU when
running the pcie3x4 PCIe controller in Endpoint mode.

Since the PCI IOMMU is working as expected in the normal case, keep it
enabled when running all PCIe controllers in Root Complex mode.

Fixes: da92d3dfc871 ("arm64: dts: rockchip: enable the mmu600_pcie IOMMU on the rk3588 SoC")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20250207143900.2047949-2-cassel@kernel.org
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 7d1163fc08936fcb5cf5d9daf366c322c3b4e882)
Signed-off-by: Anton Midyukov <antohami@altlinux.org>
---
 arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi           | 1 -
 arch/arm64/boot/dts/rockchip/rk3588-rock-5b-pcie-ep.dtso | 4 ++++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
index 4a950907ea6f5..840b638af1c24 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
@@ -213,7 +213,6 @@ pcie3x4_ep: pcie-ep@fe150000 {
 		interrupt-names = "sys", "pmc", "msg", "legacy", "err",
 				  "dma0", "dma1", "dma2", "dma3";
 		max-link-speed = <3>;
-		iommus = <&mmu600_pcie 0x0000>;
 		num-lanes = <4>;
 		phys = <&pcie30phy>;
 		phy-names = "pcie-phy";
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b-pcie-ep.dtso b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b-pcie-ep.dtso
index 672d748fcc67c..f229cb49da680 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b-pcie-ep.dtso
+++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b-pcie-ep.dtso
@@ -23,3 +23,7 @@ &pcie3x4_ep {
 	vpcie3v3-supply = <&vcc3v3_pcie30>;
 	status = "okay";
 };
+
+&mmu600_pcie {
+	status = "disabled";
+};
-- 
2.42.4



  parent reply	other threads:[~2025-04-22 10:04 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22 10:04 [d-kernel] [PATCH 00/30] [6.12] Enable HDMI0 support on rk3588 and same other improvements from v6.14 Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 01/30] drm/bridge: synopsys: Add DW HDMI QP TX Controller support library Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 02/30] dt-bindings: display: rockchip: Add schema for RK3588 HDMI TX Controller Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 03/30] drm/rockchip: Add basic RK3588 HDMI output support Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 04/30] drm/rockchip: avoid 64-bit division Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 05/30] arm64: dts: rockchip: Add HDMI0 node to rk3588 Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 06/30] arm64: dts: rockchip: Enable HDMI0 on rock-5b Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 07/30] arm64: dts: rockchip: Enable HDMI0 on rk3588-evb1 Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 08/30] arm64: dts: rockchip: Enable HDMI0 on orangepi-5-plus Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 09/30] arm64: dts: rockchip: add and enable gpu node for Radxa ROCK 5A Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 10/30] arm64: dts: rockchip: Enable HDMI0 on Orange Pi 5 Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 11/30] arm64: dts: rockchip: analog audio " Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 12/30] arm64: dts: rockchip: reorder audio/hdmi nodes in " Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 13/30] arm64: dts: rockchip: pwm-leds for " Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 14/30] arm64: dts: rockchip: Enable HDMI0 on rk3588-nanopc-t6 Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 15/30] arm64: dts: rockchip: Enable HDMI0 on rock-5a Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 16/30] arm64: dts: rockchip: add HDMI pinctrl to rk3588-tiger SoM Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 17/30] arm64: dts: rockchip: add HDMI support to rk3588-tiger-haikou Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 18/30] arm64: dts: rockchip: add HDMI support to rk3588-jaguar Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 19/30] arm64: dts: rockchip: refactor common Orange Pi 5 board Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 20/30] arm64: dts: rockchip: Enable HDMI0 on FriendlyElec CM3588 NAS Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 21/30] arm64: dts: rockchip: Enable HDMI on Hardkernel ODROID-M2 Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 22/30] arm64: dts: rockchip: Enable HDMI0 for rk3588 Cool Pi CM5 EVB Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 23/30] arm64: dts: rockchip: Enable HDMI display for rk3588 Cool Pi 4B Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 24/30] arm64: dts: rockchip: Enable HDMI display for rk3588 Cool Pi GenBook Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 25/30] arm64: dts: rockchip: orangepi-5-plus: Enable GPU Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 26/30] arm64: dts: rockchip: enable the mmu600_pcie IOMMU on the rk3588 SoC Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 27/30] arm64: dts: rockchip: rename rfkill label for Radxa ROCK 5B Anton Midyukov
2025-04-22 10:04 ` Anton Midyukov [this message]
2025-04-22 10:04 ` [d-kernel] [PATCH 29/30] arm64: dts: rockchip: slow down emmc freq for rock 5 itx Anton Midyukov
2025-04-22 10:04 ` [d-kernel] [PATCH 30/30] config-aarch64: CONFIG_ROCKCHIP_DW_HDMI_QP=y Anton Midyukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=217f8cdb8c6dc763c2f381e4320ef2fe569adc10.1745307792.git.antohami@altlinux.org \
    --to=antohami@altlinux.org \
    --cc=devel-kernel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux kernel packages development

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
		devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
	public-inbox-index devel-kernel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git