[PATCH v5 09/27] iommu/arm-smmu-v3: Allocate the CD table entry in advance

Nicolin Chen nicolinc at nvidia.com
Fri Mar 15 21:16:14 PDT 2024


On Mon, Mar 04, 2024 at 07:43:57PM -0400, Jason Gunthorpe wrote:
> Avoid arm_smmu_attach_dev() having to undo the changes to the
> smmu_domain->devices list, acquire the cdptr earlier so we don't need to
> handle that error.

I should probably mention this in the other patch, yet PATCH-14
adding arm_smmu_attach_prepare() to this function doesn't have a
rollback for CD table allocation. I assume we're fine with that?

> Now there is a clear break in arm_smmu_attach_dev() where all the
> prep-work has been done non-disruptively and we commit to making the HW
> change, which cannot fail.
> 
> This completes transforming arm_smmu_attach_dev() so that it does not
> disturb the HW if it fails.
> 
> Tested-by: Nicolin Chen <nicolinc at nvidia.com>
> Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
 
Reviewed-by: Nicolin Chen <nicolinc at nvidia.com>



More information about the linux-arm-kernel mailing list