From: Niklas Cassel <cassel@kernel.org>
To: "Heiko Stübner" <heiko@sntech.de>
Cc: Robin Murphy <robin.murphy@arm.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Damien Le Moal <dlemoal@kernel.org>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org
Subject: Re: [PATCH] arm64: dts: rockchip: enable the mmu600_pcie IOMMU on the rk3588 SoC
Date: Wed, 13 Aug 2025 20:42:01 +0200 [thread overview]
Message-ID: <aJzceQbjdilfJSyo@ryzen> (raw)
In-Reply-To: <4400329.mogB4TqSGs@diego>
Hello Heiko,
On Wed, Aug 06, 2025 at 09:36:10PM +0200, Heiko Stübner wrote:
>
> I've run into a bit of a problem with this patch and v6.16 today :-( .
Is the problem there also on older kernels?
(There as been a bunch of patches to the arm-smmu-v3 driver lately.)
>
> It seems the SMMU currently does not play well, if has no users. With
> this patch the pcie smmu is always probed, even if nothing is using it.
> (or in fact the PCIe controller driver defers probing for whatever reason).
Well, the good thing is that the PCIe driver will probe successfully even
when there is nothing attached to the PCIe slot:
https://github.com/torvalds/linux/blob/v6.17-rc1/drivers/pci/controller/dwc/pcie-designware-host.c#L560-L561
So the only case where the driver will still be deferred after a normal
boot is if e.g. the user forgot to select the Kconfig for the PHY driver.
It does of course sound very bad that the board takes 30 seconds to reboot
in this case, but at least it reboots eventually.
>
> But in all cases the SMMU's shutdown callback will be called when needed.
>
> So test-case:
> - probe pcie-smmu, but do not probe PCIe ... hit reboot
> The smmu shutdown function will hang for a bit, and at least my two
> test boards did reboot after hanging about 30 seconds
> (I did trace that down to the arm_smmu_shutdown function)
> - probe pcie-smmu and probe PCIe - creating a user for the smmu
> Reboot happens without hang/delay
>
> Likely the SMMU is missing either a clock or its power-domain.
>
> Just adding the power-domain to the node, did keep the domain on, but
> did not solve the hang for me.
Which power-domain did you add?
When I look at the PCIe controllers, they seem to use:
power-domains = <&power RK3588_PD_PCIE>;
So I assume that this is the power domain that you tried?
If I look at the RK3588 TRM Part1, 7.3.1 Domain Description,
page 1096, it does seem like the MMU600_PCIE is in power domain
PD_PHP and not PD_PCIE.
Perhaps you could something like:
power-domains = <&power RK3588_PD_PCIE>, <&power RK3588_PD_PHP>;
just to see if that improves things? (Ideally I would assume that we
should just need RK3588_PD_PHP.)
I do notice that RK3588_PD_PHP is defined/used in:
drivers/pmdomain/rockchip/pm-domains.c and
include/dt-bindings/power/rk3588-power.h
However, the RK3588_PD_PHP power domain does not seem to be defined in
rk3588-base.dtsi, like e.g. the RK3588_PD_PCIE power domain is:
https://github.com/torvalds/linux/blob/v6.17-rc1/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi#L1115-L1121
I also cannot find the RK3588_PD_PHP power domain defined in the
downstream dtsi:
https://github.com/radxa/kernel/blob/linux-6.1-stan-rkr5.1/arch/arm64/boot/dts/rockchip/rk3588s.dtsi#L3422-L3427
Side note: from the TRM is seems that
pcie2x1l0, pcie2x1l1, pcie2x1l2 is also in the RK3588_PD_PHP power domain.
(only pcie3x4 and pcie3x2 is in the RK3588_PD_PCIE power domain.)
Yet, looking at rk3588-base.dtsi and rk3588-extra.dtsi, all five
PCIe controllers has:
power-domains = <&power RK3588_PD_PCIE>;
Looking at downstream, pcie3x4 and pcie3x2 has:
power-domains = <&power RK3588_PD_PCIE>;
but pcie2x1l0, pcie2x1l1, pcie2x1l2 has no power-domains property at all.
Perhaps a bug when Sebastian added the PCIe device tree nodes to upstream?
> Strangely enough, additionally forcing all clocks to stay permanently on,
> also didn't help (or I messed up somewhere) .
> I'm not sure if the PCIe controller does cause the SMMU to do some more
> initialization, that would be missing otherwise.
That does sound like the most likely explanation.
arm_smmu_device_shutdown() calls arm_smmu_device_disable() which simply
does a arm_smmu_write_reg_sync(smmu, 0, ARM_SMMU_CR0, ARM_SMMU_CR0ACK);
The ARM_SMMU_POLL_TIMEOUT_US is however 1s, so if your board reboots after
30 seconds, that is probably because of a watchdog or similar.
Kind regards,
Niklas
prev parent reply other threads:[~2025-08-13 18:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 12:37 [PATCH] arm64: dts: rockchip: enable the mmu600_pcie IOMMU on the rk3588 SoC Niklas Cassel
2024-11-18 11:52 ` Niklas Cassel
2024-11-18 13:24 ` Heiko Stübner
2024-12-02 23:29 ` Heiko Stuebner
2025-08-06 19:36 ` Heiko Stübner
2025-08-13 18:42 ` Niklas Cassel [this message]
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=aJzceQbjdilfJSyo@ryzen \
--to=cassel@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlemoal@kernel.org \
--cc=heiko@sntech.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=sebastian.reichel@collabora.com \
/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;
as well as URLs for NNTP newsgroup(s).