summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2019-10-18 11:00:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-22 12:50:42 +0100
commit8b47e324af717ea0dbde257b0a84042982746404 (patch)
treec2d2608f8369b942b4d2bd5ee87889dc53c33f4a
parent7519069f1fb8140a3994bc35ba46df83ccd9de5f (diff)
iommu/amd: Pass gfp flags to iommu_map_page() in amd_iommu_map()
commit 3057fb9377eb5e73386dd0d8804bf72bdd23e391 upstream. A recent commit added a gfp parameter to amd_iommu_map() to make it callable from atomic context, but forgot to pass it down to iommu_map_page() and left GFP_KERNEL there. This caused sleep-while-atomic warnings and needs to be fixed. Reported-by: Qian Cai <cai@lca.pw> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: 781ca2de89ba ("iommu: Add gfp parameter to iommu_ops::map") Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/iommu/amd_iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 5e269f3dca3dd..b79309928d786 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3114,7 +3114,7 @@ static int amd_iommu_map(struct iommu_domain *dom, unsigned long iova,
prot |= IOMMU_PROT_IW;
mutex_lock(&domain->api_lock);
- ret = iommu_map_page(domain, iova, paddr, page_size, prot, GFP_KERNEL);
+ ret = iommu_map_page(domain, iova, paddr, page_size, prot, gfp);
mutex_unlock(&domain->api_lock);
domain_flush_np_cache(domain, iova, page_size);