提交 2993f3f4 编写于 作者: F Florian Fainelli 提交者: Zheng Zengkai

ARM: Qualify enabling of swiotlb_init()

mainline inclusion
from mainline-v5.13-rc1
commit fcf04489
category: bugfix
bugzilla: 106749 https://gitee.com/openeuler/kernel/issues/I4DDEL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fcf044891c84e38fc90eb736b818781bccf94e38

-----------------------------------------------

We do not need a SWIOTLB unless we have DRAM that is addressable beyond
the arm_dma_limit. Compare max_pfn with arm_dma_pfn_limit to determine
whether we do need a SWIOTLB to be initialized.

Fixes: ad3c7b18 ("arm: use swiotlb for bounce buffering on LPAE configs")
Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: NPeng Liu <liupeng256@huawei.com>
Reviewed-by: Ntong tiangen <tongtiangen@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 1a537fe8
......@@ -378,7 +378,11 @@ static void __init free_highpages(void)
void __init mem_init(void)
{
#ifdef CONFIG_ARM_LPAE
swiotlb_init(1);
if (swiotlb_force == SWIOTLB_FORCE ||
max_pfn > arm_dma_pfn_limit)
swiotlb_init(1);
else
swiotlb_force = SWIOTLB_NO_FORCE;
#endif
set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册