swiotlb: Make SWIOTLB_NO_FORCE perform no allocation
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 23 Mar 2021 01:53:49 +0000 (18:53 -0700)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 1 Apr 2021 20:46:38 +0000 (20:46 +0000)
commit2726bf3ff2520dba61fafc90a055640f7ad54e05
tree97e589d7005a07c5b58f4f0f6650f0c0a1645469
parentfcf044891c84e38fc90eb736b818781bccf94e38
swiotlb: Make SWIOTLB_NO_FORCE perform no allocation

When SWIOTLB_NO_FORCE is used, there should really be no allocations of
default_nslabs to occur since we are not going to use those slabs. If a
platform was somehow setting swiotlb_no_force and a later call to
swiotlb_init() was to be made we would still be proceeding with
allocating the default SWIOTLB size (64MB), whereas if swiotlb=noforce
was set on the kernel command line we would have only allocated 2KB.

This would be inconsistent and the point of initializing default_nslabs
to 1, was intended to allocate the minimum amount of memory possible, so
simply remove that minimal allocation period.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
kernel/dma/swiotlb.c