]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu: Swap the order of setting group->pasid_array and calling attach op of iommu...
authorYi Liu <yi.l.liu@intel.com>
Wed, 26 Feb 2025 01:18:49 +0000 (17:18 -0800)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 28 Feb 2025 14:07:14 +0000 (10:07 -0400)
commit5e9f822c9c683ae884fa5e71df41d1647b2876c6
tree0670ee78533f9fefa08118fafdff3858a29609c1
parente1ea9d30d84c65e96eba27b240be5b6798350490
iommu: Swap the order of setting group->pasid_array and calling attach op of iommu drivers

The current implementation stores entry to the group->pasid_array before
the underlying iommu driver has successfully set the new domain. This can
lead to issues where PRIs are received on the new domain before the attach
operation is completed.

This patch swaps the order of operations to ensure that the domain is set
in the underlying iommu driver before updating the group->pasid_array.

Link: https://patch.msgid.link/r/20250226011849.5102-5-yi.l.liu@intel.com
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommu.c