Commit bd80d2ef authored by Linus Torvalds's avatar Linus Torvalds

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
parents db5cda7f d5090484
...@@ -678,6 +678,11 @@ static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev, ...@@ -678,6 +678,11 @@ static struct io_tlb_pool *swiotlb_alloc_pool(struct device *dev,
size_t pool_size; size_t pool_size;
size_t tlb_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_size = sizeof(*pool) + array_size(sizeof(*pool->areas), nareas);
pool = kzalloc(pool_size, gfp); pool = kzalloc(pool_size, gfp);
if (!pool) if (!pool)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment