]> git.baikalelectronics.ru Git - kernel.git/commit
swiotlb: use the right nslabs-derived sizes in swiotlb_init_late
authorChristoph Hellwig <hch@lst.de>
Wed, 11 May 2022 06:24:10 +0000 (08:24 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 13 May 2022 10:49:27 +0000 (12:49 +0200)
commit7440c246a78bab9cd6433067e6003d4fe08b0744
tree2cfd32b0c4fc1fa4206212b791983f394e55980e
parente3faddf23061eb2f242a3e0b1c27fbceca402b47
swiotlb: use the right nslabs-derived sizes in swiotlb_init_late

nslabs can shrink when allocations or the remap don't succeed, so make
sure to use it for all sizing.  For that remove the bytes value that
can get stale and replace it with local calculations and a boolean to
indicate if the originally requested size could not be allocated.

Fixes: 18aab185d56a ("swiotlb: remove swiotlb_init_with_tbl and swiotlb_init_late_with_tbl")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
kernel/dma/swiotlb.c