swiotlb: don't override user specified size in swiotlb_adjust_size
PATCH 1/1 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 shoul not overwrite it.
--- kernel/dma/swiotlb.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/dma/swiotlb.c +2 -0
@@ -118,6 +118,8 @@ void __init swiotlb_adjust_size(unsigned long size)* architectures such as those supporting memory encryption to * adjust/expand SWIOTLB size for their use. */ +if (default_nslabs !=IO_TLB_DEFAULT_SIZE >>IO_TLB_SHIFT ) +return ; size =ALIGN (size,IO_TLB_SIZE ); default_nslabs =ALIGN (size >>IO_TLB_SHIFT ,IO_TLB_SEGSIZE );pr_info ("SWIOTLB bounce buffer size adjusted to %luMB" , size >>20 );
Signature · 6 lines
2.30.2 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Quoted 5 lines · Christoph Hellwig
If the user already specified a swiotlb size on the command line,
swiotlb_adjust_sizeshoul not overwrite it.Fixes 2cbc2776efe4 ("swiotlb: remove swiotlb_nr_tbl")Reported-by Tom Lendacky <[email protected]>
Thanks, Christoph!
Quoted 11 lines
Signed-off-by Christoph Hellwig <[email protected]>--- kernel/dma/swiotlb.c | 2 ++ 1 file changed, 2 insertions(+)kernel/dma/swiotlb.c +0
-0
kernel/dma/swiotlb.c void __init swiotlb_adjust_size(unsigned long size) · line 125
Quoted 8 lines
kernel/dma/swiotlb.c +2
-0@@ -118,6 +118,8 @@ void __init swiotlb_adjust_size(unsigned long size)* architectures such as those supporting memory encryption to * adjust/expand SWIOTLB size for their use. */ +if (default_nslabs !=IO_TLB_DEFAULT_SIZE >>IO_TLB_SHIFT ) +return ; size =ALIGN (size,IO_TLB_SIZE ); default_nslabs =ALIGN (size >>IO_TLB_SHIFT ,IO_TLB_SEGSIZE );pr_info ("SWIOTLB bounce buffer size adjusted to %luMB" , size >>20 );
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Quoted 10 lines · Tom Lendacky
Quoted 5 lines · Christoph Hellwig
If the user already specified a swiotlb size on the command line,
swiotlb_adjust_sizeshoul not overwrite it.Fixes 2cbc2776efe4 ("swiotlb: remove swiotlb_nr_tbl")Reported-by Tom Lendacky <[email protected]>Thanks, Christoph!
Tested-by Tom Lendacky <[email protected]>
Awesome! I put on the stable/for-linus-5.13 and will send a GIT PULL to Linus later on this week.
Thank you!
Quoted 6 lines
Quoted 6 lines
Signed-off-by Christoph Hellwig <[email protected]>--- kernel/dma/swiotlb.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 14 lines
Quoted 6 lines
kernel/dma/swiotlb.c +0
-0kernel/dma/swiotlb.c void __init swiotlb_adjust_size(unsigned long size) · line 125
Quoted 8 lines
kernel/dma/swiotlb.c +2
-0@@ -118,6 +118,8 @@ void __init swiotlb_adjust_size(unsigned long size)* architectures such as those supporting memory encryption to * adjust/expand SWIOTLB size for their use. */ +if (default_nslabs !=IO_TLB_DEFAULT_SIZE >>IO_TLB_SHIFT ) +return ; size =ALIGN (size,IO_TLB_SIZE ); default_nslabs =ALIGN (size >>IO_TLB_SHIFT ,IO_TLB_SEGSIZE );pr_info ("SWIOTLB bounce buffer size adjusted to %luMB" , size >>20 );
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu