Thread (13 messages) 13 messages, 3 authors, 2025-10-20

Re: [PATCH v1 5/6] iommu: Do not revert set_domain for the last gdev

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2025-10-20 18:47:20
Also in: asahi, linux-arm-kernel, linux-arm-msm, linux-iommu, linux-mediatek, linux-patches, linux-riscv, linux-rockchip, linux-s390, linux-samsung-soc, linux-sunxi, linux-tegra, lkml

On Sun, Oct 12, 2025 at 04:57:41PM -0700, Nicolin Chen wrote:
The last gdev is the device that failed the __iommu_device_set_domain().
So, it doesn't need to be reverted, given it's attached to group->domain
already.

This is not a problem currently, since it's a simply re-attach. However,
the core will need to pass in the old domain to __iommu_device_set_domain
so the old domain pointers would be inconsistent between a failed device
and all its prior succeeded devices, as all the prior devices need to be
reverted.

Avoid the re-attach for the last gdev, by breaking before the revert.

Signed-off-by: Nicolin Chen <redacted>
---
 drivers/iommu/iommu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help