Skip to contentSkip to conversation

iommu/io-pgtable-arm: Fix pgtable allocation in selftest

PATCH New Jean-Philippe Brucker 2 participants 2 messages Jun 18, 2018 – Jun 19, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/io-pgtable-arm: Fix pgtable allocation in selftest

Commit 4b123757eeaa ("iommu/io-pgtable-arm: Make allocations NUMA-aware") added a NUMA hint to page table allocation, but the pgtable selftest doesn't provide an SMMU device parameter. Since dev_to_node doesn't accept a NULL argument, add a special case for selftest.

---
 drivers/iommu/io-pgtable-arm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm.c +2 -1
index 010a254305dd..88641b4560bc 100644
@@ -237,7 +237,8 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp,
 	void *pages;
 
 	VM_BUG_ON((gfp & __GFP_HIGHMEM));
-	p = alloc_pages_node(dev_to_node(dev), gfp | __GFP_ZERO, order);
+	p = alloc_pages_node(dev ? dev_to_node(dev) : NUMA_NO_NODE,
+			     gfp | __GFP_ZERO, order);
 	if (!p)
 		return NULL;
 
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/1 iommu/io-pgtable-arm: Fix pgtable allocation in selftest

Quoted 9 lines · Jean-Philippe Brucker

Commit 4b123757eeaa ("iommu/io-pgtable-arm: Make allocations NUMA-aware") added a NUMA hint to page table allocation, but the pgtable selftest doesn't provide an SMMU device parameter. Since dev_to_node doesn't accept a NULL argument, add a special case for selftest.

---
 drivers/iommu/io-pgtable-arm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Thanks, I'll pick this up.

Will