[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4-v2-ce66f632bd0d+484-iommu_map_gfp_jgg@nvidia.com>
Date: Wed, 18 Jan 2023 14:00:38 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Lu Baolu <baolu.lu@...ux.intel.com>,
Joerg Roedel <joro@...tes.org>,
Kevin Tian <kevin.tian@...el.com>,
Matthew Rosato <mjrosato@...ux.ibm.com>,
Robin Murphy <robin.murphy@....com>
Cc: Alex Williamson <alex.williamson@...hat.com>,
ath10k@...ts.infradead.org, ath11k@...ts.infradead.org,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
dri-devel@...ts.freedesktop.org, iommu@...ts.linux.dev,
kvm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org, linux-media@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-remoteproc@...r.kernel.org,
linux-s390@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-tegra@...r.kernel.org, linux-wireless@...r.kernel.org,
netdev@...r.kernel.org, nouveau@...ts.freedesktop.org,
Niklas Schnelle <schnelle@...ux.ibm.com>,
virtualization@...ts.linux-foundation.org
Subject: [PATCH v2 04/10] iommu/dma: Use the gfp parameter in __iommu_dma_alloc_noncontiguous()
Change the sg_alloc_table_from_pages() allocation that was hardwired to
GFP_KERNEL to use the gfp parameter like the other allocations in this
function.
Auditing says this is never called from an atomic context, so it is safe
as is, but reads wrong.
Signed-off-by: Jason Gunthorpe <jgg@...dia.com>
---
drivers/iommu/dma-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 8c2788633c1766..e4bf1bb159f7c7 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -822,7 +822,7 @@ static struct page **__iommu_dma_alloc_noncontiguous(struct device *dev,
if (!iova)
goto out_free_pages;
- if (sg_alloc_table_from_pages(sgt, pages, count, 0, size, GFP_KERNEL))
+ if (sg_alloc_table_from_pages(sgt, pages, count, 0, size, gfp))
goto out_free_iova;
if (!(ioprot & IOMMU_CACHE)) {
--
2.39.0
Powered by blists - more mailing lists