]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/amd: Convert dev_data lock from spinlock to mutex
authorVasant Hegde <vasant.hegde@amd.com>
Wed, 30 Oct 2024 06:35:53 +0000 (06:35 +0000)
committerJoerg Roedel <jroedel@suse.de>
Wed, 30 Oct 2024 10:06:45 +0000 (11:06 +0100)
commite843aedbeb82b17a5fe6172449bff133fc8b68a1
tree71f364bb71e8c6e837de48314809a7daa2bc5972
parent4b18ef8491b06e353e8801705092cc292582cb7a
iommu/amd: Convert dev_data lock from spinlock to mutex

Currently in attach device path it takes dev_data->spinlock. But as per
design attach device path can sleep. Also if device is PRI capable then
it adds device to IOMMU fault handler queue which takes mutex. Hence
currently PRI enablement is done outside dev_data lock.

Covert dev_data lock from spinlock to mutex so that it follows the
design and also PRI enablement can be done properly.

Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20241030063556.6104-10-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/iommu.c