* [PATCH] iommu/vsi: Don't write the enable register on suspend
@ 2026-11-13 20:06 Arun Iyengar via B4 Relay
2026-11-16 8:12 ` Benjamin Gaignard
0 siblings, 1 reply; 2+ messages in thread
From: Arun Iyengar via B4 Relay @ 2026-11-13 20:06 UTC (permalink / raw)
To: Benjamin Gaignard, Joerg Roedel (AMD), Will Deacon, Robin Murphy
Cc: iommu, linux-kernel, Arun Iyengar
From: Arun Iyengar <aiyengar1990@gmail.com>
Benjamin Gaignard pointed out that, per the IOMMU documentation, the
IOMMU can't be disabled once enabled. Drop the write on suspend:
resume reprograms the IOMMU anyway.
Suggested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
Benjamin suggested this in the hantro-robust review:
https://lore.kernel.org/r/f212840b-92fd-4d97-a6a7-2768a55483f7@collabora.com
Identity attach keeps the write. On RK3588 it does clear the enable
bit (AHB_CONTROL reads 0x1 before, 0x0 after), and without it the
IOMMU would keep using the old domain's page table. Benjamin, should
that one go too?
Tested on RK3588S (Orange Pi 5), v7.3-based kernel with [1] and
hantro-robust v3 [2]: AV1 fluster unchanged (203/242), 20 AV1 decoder
unbind/bind cycles, 3 s2idle cycles. The IOMMU runtime suspended
after each step; no SError or IOMMU fault.
Not tested: identity domains, suspend to RAM.
No conflict with [1] or with patch 10 of [2].
Developed with Claude (Anthropic), which wrote the code and the commit
message. I reviewed it.
[1] https://lore.kernel.org/r/20261113-vsi-iommu-pm-ref-v1-0-fd917eebdf18@gmail.com
[2] https://lore.kernel.org/r/20261113-hantro-robust-v3-0-82383c722ad2@gmail.com
---
drivers/iommu/vsi-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/vsi-iommu.c b/drivers/iommu/vsi-iommu.c
index 5dac20b143a5..bd984060253b 100644
--- a/drivers/iommu/vsi-iommu.c
+++ b/drivers/iommu/vsi-iommu.c
@@ -740,7 +740,7 @@ static int __maybe_unused vsi_iommu_suspend(struct device *dev)
{
struct vsi_iommu *iommu = dev_get_drvdata(dev);
- vsi_iommu_disable(iommu);
+ iommu->enable = false;
clk_bulk_disable(iommu->num_clocks, iommu->clocks);
---
base-commit: 2cf4be57b301ed2d7af82e70cff5dfd96894d8de
change-id: 20261113-vsi-iommu-disable-42edd626d009
Best regards,
--
Arun Iyengar <aiyengar1990@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] iommu/vsi: Don't write the enable register on suspend
2026-11-13 20:06 [PATCH] iommu/vsi: Don't write the enable register on suspend Arun Iyengar via B4 Relay
@ 2026-11-16 8:12 ` Benjamin Gaignard
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Gaignard @ 2026-11-16 8:12 UTC (permalink / raw)
To: aiyengar1990, Joerg Roedel (AMD), Will Deacon, Robin Murphy
Cc: iommu, linux-kernel
Le 13/11/2026 à 21:06, Arun Iyengar via B4 Relay a écrit :
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> Benjamin Gaignard pointed out that, per the IOMMU documentation, the
> IOMMU can't be disabled once enabled. Drop the write on suspend:
> resume reprograms the IOMMU anyway.
>
> Suggested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
> Benjamin suggested this in the hantro-robust review:
> https://lore.kernel.org/r/f212840b-92fd-4d97-a6a7-2768a55483f7@collabora.com
>
> Identity attach keeps the write. On RK3588 it does clear the enable
> bit (AHB_CONTROL reads 0x1 before, 0x0 after), and without it the
> IOMMU would keep using the old domain's page table. Benjamin, should
> that one go too?
>
> Tested on RK3588S (Orange Pi 5), v7.3-based kernel with [1] and
> hantro-robust v3 [2]: AV1 fluster unchanged (203/242), 20 AV1 decoder
> unbind/bind cycles, 3 s2idle cycles. The IOMMU runtime suspended
> after each step; no SError or IOMMU fault.
> Not tested: identity domains, suspend to RAM.
> No conflict with [1] or with patch 10 of [2].
>
> Developed with Claude (Anthropic), which wrote the code and the commit
> message. I reviewed it.
>
> [1] https://lore.kernel.org/r/20261113-vsi-iommu-pm-ref-v1-0-fd917eebdf18@gmail.com
> [2] https://lore.kernel.org/r/20261113-hantro-robust-v3-0-82383c722ad2@gmail.com
> ---
> drivers/iommu/vsi-iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/vsi-iommu.c b/drivers/iommu/vsi-iommu.c
> index 5dac20b143a5..bd984060253b 100644
> --- a/drivers/iommu/vsi-iommu.c
> +++ b/drivers/iommu/vsi-iommu.c
> @@ -740,7 +740,7 @@ static int __maybe_unused vsi_iommu_suspend(struct device *dev)
> {
> struct vsi_iommu *iommu = dev_get_drvdata(dev);
>
> - vsi_iommu_disable(iommu);
> + iommu->enable = false;
>
> clk_bulk_disable(iommu->num_clocks, iommu->clocks);
>
>
> ---
> base-commit: 2cf4be57b301ed2d7af82e70cff5dfd96894d8de
> change-id: 20261113-vsi-iommu-disable-42edd626d009
>
> Best regards,
> --
> Arun Iyengar <aiyengar1990@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-16 8:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 20:06 [PATCH] iommu/vsi: Don't write the enable register on suspend Arun Iyengar via B4 Relay
2026-11-16 8:12 ` Benjamin Gaignard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®