From: Huang Pei Date: Wed, 24 Mar 2021 03:24:51 +0000 (+0800) Subject: MIPS: loongson64: fix bug when PAGE_SIZE > 16KB X-Git-Tag: accepted/tizen/unified/20230118.172025~7338^2~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=509d36a941a3466b78d4377913623d210b162458;p=platform%2Fkernel%2Flinux-rpi.git MIPS: loongson64: fix bug when PAGE_SIZE > 16KB 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 Acked-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer --- diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c index d5a1edd..76e0a96 100644 --- a/arch/mips/loongson64/init.c +++ b/arch/mips/loongson64/init.c @@ -141,7 +141,7 @@ static int __init add_legacy_isa_io(struct fwnode_handle *fwnode, resource_size_ return -ENOMEM; range->fwnode = fwnode; - range->size = size; + range->size = size = round_up(size, PAGE_SIZE); range->hw_start = hw_start; range->flags = LOGIC_PIO_CPU_MMIO;