iommu/dma: Relax locking in iommu_dma_prepare_msi()
authorRobin Murphy <robin.murphy@arm.com>
Mon, 9 Dec 2019 19:47:25 +0000 (19:47 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Jan 2020 11:21:38 +0000 (12:21 +0100)
commit2d26e06cb1be3384a16ba8fba9c9b7ee22bba22a
tree7e402ddc9196d502dae8dfcc1495983ddf3ca450
parent88184162e9c0677757b7a97b03bcd0ebde8a7cf5
iommu/dma: Relax locking in iommu_dma_prepare_msi()

[ Upstream commit c18647900ec864d401ba09b3bbd5b34f331f8d26 ]

Since commit ece6e6f0218b ("iommu/dma-iommu: Split iommu_dma_map_msi_msg()
in two parts"), iommu_dma_prepare_msi() should no longer have to worry
about preempting itself, nor being called in atomic context at all. Thus
we can downgrade the IRQ-safe locking to a simple mutex to avoid angering
the new might_sleep() check in iommu_map().

Reported-by: Qian Cai <cai@lca.pw>
Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/dma-iommu.c