[PATCH] iommu/vsi: Don't write the enable register on suspend
From: Arun Iyengar via B4 Relay
Date: Fri Nov 13 2026 - 16:01:58 EST
From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
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@xxxxxxxxxxxxx>
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
Benjamin suggested this in the hantro-robust review:
https://lore.kernel.org/r/f212840b-92fd-4d97-a6a7-2768a55483f7@xxxxxxxxxxxxx
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@xxxxxxxxx
[2] https://lore.kernel.org/r/20261113-hantro-robust-v3-0-82383c722ad2@xxxxxxxxx
---
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@xxxxxxxxx>