Re: [PATCH v4 02/15] iommu/arm-smmu-v3: Add arm_smmu_attach_release()

From: Jonathan Cameron

Date: Thu Sep 10 2026 - 20:15:05 EST


> The IOPF teardown is done in arm_smmu_remove_master_domain() when releasing
> the master_domain on detach, under the global arm_smmu_asid_lock mutex.
>
> A later change will add an IOPF workqueue flush to that teardown, which can
> block on a user-faulting page-fault handler. Holding the arm_smmu_asid_lock
> across it would stall every unrelated attachment in the system.
>
> Split the teardown out of arm_smmu_remove_master_domain(), to a new helper
> arm_smmu_attach_release() that runs after arm_smmu_asid_lock is released.
>
> No functional change: the old master_domain belongs to no other device, so
> freeing it outside the lock stays safe, still under iommu_group->mutex.
>
> Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
Nice now.

Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>

--
Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>