]> git.ipfire.org Git - people/arne_f/kernel.git/commit
swiotlb: respect min_align_mask
authorJianxiong Gao <jxgao@google.com>
Thu, 29 Apr 2021 17:33:14 +0000 (17:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 May 2021 09:11:24 +0000 (11:11 +0200)
commitfd1feb280dfa47f9d141cbe32af5d3d9e99dcf5a
tree8885963a50ec78a2a8934760c16de7692c9c2c21
parent825b7efe7129844876d2a3ca89489f7013d1f89e
swiotlb: respect min_align_mask

commit: 1f221a0d0dbf0e48ef3a9c62871281d6a7819f05

swiotlb: respect min_align_mask

Respect the min_align_mask in struct device_dma_parameters in swiotlb.

There are two parts to it:
 1) for the lower bits of the alignment inside the io tlb slot, just
    extent the size of the allocation and leave the start of the slot
     empty
 2) for the high bits ensure we find a slot that matches the high bits
    of the alignment to avoid wasting too much memory

Based on an earlier patch from Jianxiong Gao <jxgao@google.com>.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Jianxiong Gao <jxgao@google.com>
Tested-by: Jianxiong Gao <jxgao@google.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jianxiong Gao <jxgao@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/dma/swiotlb.c