Skip to content

Commit 509d36a

Browse files
mips-hptsbogend
authored andcommitted
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: 6d0068a ("MIPS: Loongson64: Process ISA Node in DeviceTree") Signed-off-by: Huang Pei <[email protected]> Acked-by: Jiaxun Yang <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 84a0124 commit 509d36a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/loongson64/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int __init add_legacy_isa_io(struct fwnode_handle *fwnode, resource_size_
141141
return -ENOMEM;
142142

143143
range->fwnode = fwnode;
144-
range->size = size;
144+
range->size = size = round_up(size, PAGE_SIZE);
145145
range->hw_start = hw_start;
146146
range->flags = LOGIC_PIO_CPU_MMIO;
147147

0 commit comments

Comments
 (0)