Skip to content

Commit dfc06b3

Browse files
Christoph Hellwigkonradwilk
authored andcommitted
swiotlb: don't override user specified size in swiotlb_adjust_size
If the user already specified a swiotlb size on the command line, swiotlb_adjust_size should not overwrite it. Fixes: 2cbc277 ("swiotlb: remove swiotlb_nr_tbl") Reported-by: Tom Lendacky <[email protected]> Tested-by: Tom Lendacky <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
1 parent 95b079d commit dfc06b3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/dma/swiotlb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ void __init swiotlb_adjust_size(unsigned long size)
118118
* architectures such as those supporting memory encryption to
119119
* adjust/expand SWIOTLB size for their use.
120120
*/
121+
if (default_nslabs != IO_TLB_DEFAULT_SIZE >> IO_TLB_SHIFT)
122+
return;
121123
size = ALIGN(size, IO_TLB_SIZE);
122124
default_nslabs = ALIGN(size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE);
123125
pr_info("SWIOTLB bounce buffer size adjusted to %luMB", size >> 20);

0 commit comments

Comments
 (0)