Skip to content

Commit

Permalink
iommu/amd: Pass gfp flags to iommu_map_page() in amd_iommu_map()
Browse files Browse the repository at this point in the history
commit 3057fb9 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: 781ca2d ("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>
  • Loading branch information
Joerg Roedel authored and Greg Kroah-Hartman committed Feb 22, 2023
1 parent 7519069 commit 8b47e32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8b47e32

Please sign in to comment.