arm64: Increase the swiotlb buffer size 64MB
With commit 3690951fc6
(arm64: Use swiotlb late initialisation), the
swiotlb buffer size is limited to MAX_ORDER_NR_PAGES. However, there are
platforms with 32-bit only devices that require bounce buffering via
swiotlb. This patch changes the swiotlb initialisation to an early 64MB
memblock allocation. In order to get the swiotlb buffer correctly
allocated (via memblock_virt_alloc_low_nopanic), this patch also defines
ARCH_LOW_ADDRESS_LIMIT to the maximum physical address capable of 32-bit
DMA.
Reported-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
@@ -348,8 +348,6 @@ static struct dma_map_ops swiotlb_dma_ops = {
|
||||
.mapping_error = swiotlb_dma_mapping_error,
|
||||
};
|
||||
|
||||
extern int swiotlb_late_init_with_default_size(size_t default_size);
|
||||
|
||||
static int __init atomic_pool_init(void)
|
||||
{
|
||||
pgprot_t prot = __pgprot(PROT_NORMAL_NC);
|
||||
@@ -411,21 +409,13 @@ out:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static int __init swiotlb_late_init(void)
|
||||
static int __init arm64_dma_init(void)
|
||||
{
|
||||
size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT);
|
||||
int ret;
|
||||
|
||||
dma_ops = &swiotlb_dma_ops;
|
||||
|
||||
return swiotlb_late_init_with_default_size(swiotlb_size);
|
||||
}
|
||||
|
||||
static int __init arm64_dma_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ret |= swiotlb_late_init();
|
||||
ret |= atomic_pool_init();
|
||||
ret = atomic_pool_init();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user