Skip to content

Commit

Permalink
Merge tag 'dma-mapping-6.6-2023-10-28' of git://git.infradead.org/use…
Browse files Browse the repository at this point in the history
…rs/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
  • Loading branch information
Linus Torvalds committed Oct 28, 2023
2 parents db5cda7 + d509048 commit bd80d2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/dma/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,11 @@ static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
size_t pool_size;
size_t tlb_size;

if (nslabs > SLABS_PER_PAGE << MAX_ORDER) {
nslabs = SLABS_PER_PAGE << MAX_ORDER;
nareas = limit_nareas(nareas, nslabs);
}

pool_size = sizeof(*pool) + array_size(sizeof(*pool->areas), nareas);
pool = kzalloc(pool_size, gfp);
if (!pool)
Expand Down

0 comments on commit bd80d2e

Please sign in to comment.