iommu/vt-d: Acquiring lock in domain ID allocation helpers
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 12 Jul 2022 00:08:57 +0000 (08:08 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 15 Jul 2022 08:21:37 +0000 (10:21 +0200)
commit2c3262f9e881ae403b6d92a7e4824531cdb63829
tree01416c41fbd3be7ef0bae96446f568bac133afcf
parentffd5869d935303b3e8dedf0d6fbe202ace66c653
iommu/vt-d: Acquiring lock in domain ID allocation helpers

The iommu->lock is used to protect the per-IOMMU domain ID resource.
Moving the lock into the ID alloc/free helpers makes the code more
compact. At the same time, the device_domain_lock is irrelevant to
the domain ID resource, remove its assertion as well.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20220706025524.2904370-7-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c