Linux ATA/IDE development
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: aiyengar1990@gmail.com
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	heiko@sntech.de, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	david.wu@rock-chips.com, dlemoal@kernel.org, cassel@kernel.org,
	fancer.lancer@gmail.com, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-ide@vger.kernel.org, praan@google.com, will@kernel.org,
	robin.murphy@arm.com, iommu@lists.linux.dev,
	shawn.lin@rock-chips.com, sebastian.reichel@collabora.com
Subject: Re: [PATCH 8/9] arm64: dts: rockchip: Attach the masters of the RK3588 PHP SMMU
Date: Tue, 17 Nov 2026 17:35:20 +0000	[thread overview]
Message-ID: <179493692082.3136.9767912829887161888@kernel.org> (raw)
In-Reply-To: <20261113-mmu600-php-v1-8-231196049a3b@gmail.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] Once mmu600_php is enabled, this patch makes all DMA from
  GMAC0/1, SATA0-2 and USB3OTG_2 depend on SMMU state: CR0.SMMUEN, the…
- [Medium] This patch points GMAC0/1, SATA0-2 and USB3OTG_2 at the
  mmu600_php node.
- [Low] The commit message describes StreamIDs 1-6 as a property of the
  hardware: "GMAC0/1, SATA0-2 and USB3OTG_2 are behind MMU600_PHP with…

--

arm64: dts: rockchip: Attach the masters of the RK3588 PHP SMMU

This patch adds iommus properties to GMAC0/1, SATA0-2 and USB3OTG_2 on
RK3588. They point at the PHP SMMU (mmu600_php) with StreamIDs 1 to 6.
The SMMU node is still disabled at this point in the series.

> GMAC0/1, SATA0-2 and USB3OTG_2 are behind MMU600_PHP with StreamIDs
> 1-6. No effect until the SMMU is enabled.

[Severity: Low]

Are StreamIDs 1-6 a property of the hardware? An earlier patch in this
series, "soc: rockchip: grf: Assign the StreamIDs of the RK3588 PHP SMMU
masters", says the PHP GRF StreamID registers "reset to 0 and are never
programmed".

The values only become true because rockchip_grf_init() writes them, and
rockchip_grf_resume() writes them again after suspend:

drivers/soc/rockchip/grf.c:
static const struct rockchip_grf_value rk3588_defaults_php_grf[] = {
	{ "gmac0 write streamid", RK3588_PHP_GRF_GMAC0_SID_AW, 1 },
	...
	{ "usb3otg2 read streamid", RK3588_PHP_GRF_USB3OTG2_SID_AR, 6 },
};

So the iommus specifiers in this patch encode a choice made by a Linux
driver, not fixed hardware.

Some software could use this DT with the SMMU enabled but without that
GRF programming. Examples are a stable backport that takes only the DTS
patches, U-Boot passing this DT through, or another OS. In that case
every master would emit SID 0. By the series' own design SID 0 is
unused, so DMA from all six masters would be aborted.

In-tree Linux sees no runtime effect here. The GRF patch comes earlier
in the series and mmu600_php is still disabled.

Could the commit message say this, and name the GRF patch as a hard
prerequisite?

> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
> index 3bf8d0e4ff332..cb0a39f637887 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
> @@ -534,6 +534,7 @@ usb_host2_xhci: usb@fcd00000 {
>  		compatible = "rockchip,rk3588-dwc3", "snps,dwc3";
>  		reg = <0x0 0xfcd00000 0x0 0x400000>;
>  		interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH 0>;
> +		iommus = <&mmu600_php 6>;

[Severity: Medium]

These iommus entries make the masters depend on mmu600_php, which in
this tree has:

	mmu600_php: iommu@fcb00000 {
		compatible = "arm,smmu-v3";
		...
		clocks = <&cru ACLK_MMU_PHP>;
		resets = <&cru SRST_A_MMU_PHP>;
		#iommu-cells = <1>;
		status = "disabled";
	};

Does anything accept or use these two properties?

Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml defines no
clocks or resets and ends with additionalProperties: false. The series
does not change that binding. Would dtbs_check then reject mmu600_php on
every RK3588 DTB?

The arm-smmu-v3 driver also has no clk_* or reset_control_* calls
anywhere under drivers/iommu/arm/arm-smmu-v3/. So the SMMU never holds
this clock.

The series says the clock is there "so the SMMU keeps its clock while
its masters are idle". The final commit "arm64: dts: rockchip: Enable
the RK3588 PHP SMMU" relies on "the SMMU has its clock". In
drivers/clk/rockchip/clk-rk3588.c it is a plain gate without
CLK_IS_CRITICAL:

	GATE(ACLK_MMU_PHP, "aclk_mmu_php", "aclk_php_root", 0,
			RK3588_CLKGATE_CON(34), 8, GFLAGS),

Its only enablers are its children: ACLK_GMAC0/1, ACLK_SATA0/1/2 and
ACLK_USB3OTG2.

Can clk_disable_unused, or the masters going idle, gate this clock while
the SMMU is live? Some examples:

  - arm_smmu_attach_dev() runs before a modular master driver enables
    its clocks
  - all masters are runtime suspended
  - a board enables none of these masters

The series implies that ACLK_MMU_PHP clocks the SMMU register interface.
If so, could command queue accesses, CMD_SYNC polling or the IRQ
handlers hang the bus or time out? That would look like the PHP GRF hang
described in "Add the PHP GRF clock on RK3588".

>  		clocks = <&cru REF_CLK_USB3OTG2>, <&cru SUSPEND_CLK_USB3OTG2>,
>  			 <&cru ACLK_USB3OTG2>, <&cru CLK_UTMI_OTG2>,
>  			 <&cru CLK_PIPEPHY2_PIPE_U3_G>;
> @@ -2310,6 +2311,7 @@ gmac1: ethernet@fe1c0000 {
>  		interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH 0>,
>  			     <GIC_SPI 233 IRQ_TYPE_LEVEL_HIGH 0>;
>  		interrupt-names = "macirq", "eth_wake_irq";
> +		iommus = <&mmu600_php 2>;

[Severity: High]

Once mmu600_php is enabled, all DMA from GMAC0/1, SATA0-2 and USB3OTG_2
depends on SMMU state:

  - CR0.SMMUEN
  - the stream table and queue base registers
  - the STEs for SIDs 1-6

What restores that state after deep suspend?

arm_smmu_driver in drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c has no
.pm ops:

	.probe	= arm_smmu_device_probe,
	.remove = arm_smmu_device_remove,
	.shutdown = arm_smmu_device_shutdown,

So arm_smmu_device_reset() only runs at probe.

The final commit of the series, "arm64: dts: rockchip: Enable the RK3588
PHP SMMU", says:

  "PD_PHP is powered off in deep suspend and the SMMU resumes from reset
  in bypass, so this needs arm-smmu-v3 system sleep support [1]"

That support is not in this tree. Even so, that commit removes
status = "disabled" from mmu600_php for every RK3588 board.

Take a board with an active PHP master and run
echo mem > /sys/power/state. After resume, only the PHP GRF StreamIDs
are restored, by rockchip_grf_resume(). The GMAC descriptor rings, AHCI
command lists and xHCI rings still hold IOVAs.

Wouldn't their DMA go out untranslated, with the IOVAs used as physical
addresses?

This patch alone does nothing while the SMMU is disabled. But it creates
the dependency, and the problem is still present at the end of the
series. Should the enable commit wait until arm-smmu-v3 system sleep
support has landed?

>  		clocks = <&cru CLK_GMAC_125M>, <&cru CLK_GMAC_50M>,
>  			 <&cru PCLK_GMAC1>, <&cru ACLK_GMAC1>,
>  			 <&cru CLK_GMAC1_PTP_REF>;

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113-mmu600-php-v1-0-231196049a3b%40gmail.com

  reply	other threads:[~2026-11-17 17:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 16:38 [PATCH 0/9] RK3588: Enable the PHP SMMU Arun Iyengar via B4 Relay
2026-11-13 16:38 ` [PATCH 1/9] dt-bindings: net: rockchip-dwmac: Allow iommus Arun Iyengar via B4 Relay
2026-11-17 17:35   ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 2/9] dt-bindings: ata: rockchip,dwc-ahci: " Arun Iyengar via B4 Relay
2026-11-17 17:35   ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 3/9] dt-bindings: soc: rockchip: grf: Allow a clock for the RK3588 PHP GRF Arun Iyengar via B4 Relay
2026-11-17 17:35   ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 4/9] soc: rockchip: grf: Assign the StreamIDs of the RK3588 PHP SMMU masters Arun Iyengar via B4 Relay
2026-11-13 16:38 ` [PATCH 5/9] arm64: dts: rockchip: Add the PHP GRF clock on RK3588 Arun Iyengar via B4 Relay
2026-11-17 17:35   ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 6/9] soc: rockchip: grf: Restore the RK3588 PHP StreamIDs after system suspend Arun Iyengar via B4 Relay
2026-11-17 17:35   ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 7/9] arm64: dts: rockchip: Add the clock and reset of the RK3588 PHP SMMU Arun Iyengar via B4 Relay
2026-11-17 17:35   ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 8/9] arm64: dts: rockchip: Attach the masters " Arun Iyengar via B4 Relay
2026-11-17 17:35   ` netdev-bot+sashiko [this message]
2026-11-13 16:38 ` [PATCH 9/9] arm64: dts: rockchip: Enable " Arun Iyengar via B4 Relay
2026-11-14 16:39   ` sashiko-bot
2026-11-15  7:59     ` Arun Iyengar
2026-11-17 17:35   ` netdev-bot+sashiko

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=179493692082.3136.9767912829887161888@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=aiyengar1990@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=cassel@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=david.wu@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=heiko@sntech.de \
    --cc=iommu@lists.linux.dev \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=praan@google.com \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=shawn.lin@rock-chips.com \
    --cc=will@kernel.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox