MIPS: loongson64: fix bug when PAGE_SIZE > 16KB
authorHuang Pei <huangpei@loongson.cn>
Wed, 24 Mar 2021 03:24:51 +0000 (11:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:30 +0000 (09:50 +0200)
commit0f69f9596ba0b1a22c0a9db5b7772dc86f3c577e
tree838d434863a2d7013a911ac74288235bf04059c9
parentda40d5fec5d70e5018523fc78243e5102d86731b
MIPS: loongson64: fix bug when PAGE_SIZE > 16KB

[ Upstream commit 509d36a941a3466b78d4377913623d210b162458 ]

When page size larger than 16KB, arguments "vaddr + size(16KB)" in
"ioremap_page_range(vaddr, vaddr + size,...)" called by
"add_legacy_isa_io" is not page-aligned.

As loongson64 needs at least page size 16KB to get rid of cache alias,
and "vaddr" is 64KB-aligned, and 64KB is largest page size supported,
rounding "size" up to PAGE_SIZE is enough for all page size supported.

Fixes: 6d0068ad15e4 ("MIPS: Loongson64: Process ISA Node in DeviceTree")
Signed-off-by: Huang Pei <huangpei@loongson.cn>
Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/loongson64/init.c