Skip to content

Commit bd80d2e

Browse files
committed
Merge tag 'dma-mapping-6.6-2023-10-28' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping fix from Christoph Hellwig: - reduce the initialy dynamic swiotlb size to remove an annoying but harmless warning from the page allocator (Petr Tesarik) * tag 'dma-mapping-6.6-2023-10-28' of git://git.infradead.org/users/hch/dma-mapping: swiotlb: do not try to allocate a TLB bigger than MAX_ORDER pages
2 parents db5cda7 + d509048 commit bd80d2e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/dma/swiotlb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,11 @@ static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
678678
size_t pool_size;
679679
size_t tlb_size;
680680

681+
if (nslabs > SLABS_PER_PAGE << MAX_ORDER) {
682+
nslabs = SLABS_PER_PAGE << MAX_ORDER;
683+
nareas = limit_nareas(nareas, nslabs);
684+
}
685+
681686
pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), nareas);
682687
pool = kzalloc(pool_size, gfp);
683688
if (!pool)

0 commit comments

Comments
 (0)