* [PATCH] swiotlb: Use the calculated number of areas
@ 2023-09-11 10:32 Ross Lagerwall
2023-09-13 12:13 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Ross Lagerwall @ 2023-09-11 10:32 UTC (permalink / raw)
To: iommu
Cc: Christoph Hellwig, Marek Szyprowski, Robin Murphy, Petr Tesarik,
Roberto Sassu, Ross Lagerwall
Commit 8ac04063354a ("swiotlb: reduce the number of areas to match
actual memory pool size") calculated the reduced number of areas in
swiotlb_init_remap() but didn't actually use the value. Replace usage of
default_nareas accordingly.
Fixes: 8ac04063354a ("swiotlb: reduce the number of areas to match actual memory pool size")
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
Compile-tested only since I saw this just from code inspection.
kernel/dma/swiotlb.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 394494a6b1f3..85dd94323b98 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -399,14 +399,13 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
}
mem->areas = memblock_alloc(array_size(sizeof(struct io_tlb_area),
- default_nareas), SMP_CACHE_BYTES);
+ nareas), SMP_CACHE_BYTES);
if (!mem->areas) {
pr_warn("%s: Failed to allocate mem->areas.\n", __func__);
return;
}
- swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false,
- default_nareas);
+ swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false, nareas);
add_mem_pool(&io_tlb_default_mem, mem);
if (flags & SWIOTLB_VERBOSE)
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] swiotlb: Use the calculated number of areas
2023-09-11 10:32 [PATCH] swiotlb: Use the calculated number of areas Ross Lagerwall
@ 2023-09-13 12:13 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2023-09-13 12:13 UTC (permalink / raw)
To: Ross Lagerwall
Cc: iommu, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
Petr Tesarik, Roberto Sassu
Thanks, applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-13 12:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11 10:32 [PATCH] swiotlb: Use the calculated number of areas Ross Lagerwall
2023-09-13 12:13 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.