[PATCH v2 5/6] iommu: Do not revert set_domain for the last gdev
Baolu Lu
baolu.lu at linux.intel.com
Wed Oct 22 21:50:13 PDT 2025
On 10/23/25 10:21, 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.
>
> Reviewed-by: Jason Gunthorpe<jgg at nvidia.com>
> Signed-off-by: Nicolin Chen<nicolinc at nvidia.com>
> ---
> drivers/iommu/iommu.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Lu Baolu <baolu.lu at linux.intel.com>
More information about the linux-riscv
mailing list