Skip to content
Snippets Groups Projects
Commit fe4d7086 authored by Tom Murphy's avatar Tom Murphy Committed by Greg Kroah-Hartman
Browse files

iommu: Add gfp parameter to iommu_ops::map

[ Upstream commit 781ca2de ]

Add a gfp_t parameter to the iommu_ops::map function.
Remove the needless locking in the AMD iommu driver.

The iommu_ops::map function (or the iommu_map function which calls it)
was always supposed to be sleepable (according to Joerg's comment in
this thread: https://lore.kernel.org/patchwork/patch/977520/

 ) and so
should probably have had a "might_sleep()" since it was written. However
currently the dma-iommu api can call iommu_map in an atomic context,
which it shouldn't do. This doesn't cause any problems because any iommu
driver which uses the dma-iommu api uses gfp_atomic in it's
iommu_ops::map function. But doing this wastes the memory allocators
atomic pools.

Signed-off-by: default avatarTom Murphy <murphyt7@tcd.ie>
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Stable-dep-of: b7e08a5a ("RDMA/usnic: use iommu_map_atomic() under spin_lock()")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4a779187
No related branches found
No related tags found
No related merge requests found
Showing
with 77 additions and 26 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment