RE: [PATCH v2 1/2] iommu: Use mutex instead of spinlock for iommu_device_list

From: Tian, Kevin
Date: Mon Jan 29 2024 - 03:04:48 EST


> From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Friday, January 26, 2024 6:54 PM
>
> The iommu_device_lock spinlock was used to protect the iommu device
> list. However, there is no requirement to access the iommu device
> list in interrupt context. Therefore, a mutex is sufficient.

I don't think that interrupt is the reason for spinlock otherwise
spin_lock_irqsave() should be used instead.

>
> This also prepares for the next change, which will iterate the iommu
> device list and call the probe callback within the locking area.
>

Given the touched paths are all slow paths:

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>