]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
LoongArch: Consolidate early_ioremap()/ioremap_prot()
authorHuacai Chen <chenhuacai@loongson.cn>
Sun, 9 Nov 2025 08:02:00 +0000 (16:02 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Mon, 10 Nov 2025 00:37:06 +0000 (08:37 +0800)
commit43a9e6a10bdde32445ad2725f568e08a94e51dc9
tree6a282086659c99a00dc91fbda6e9b9e4979b853c
parent4e67526840fc55917581b90f6a4b65849a616dd8
LoongArch: Consolidate early_ioremap()/ioremap_prot()

1. Use phys_addr_t instead of u64, which can work for both 32/64 bits.
2. Check whether the input physical address is above TO_PHYS_MASK (and
   return NULL if yes) for the DMW version.

Note: In theory early_ioremap() also need the TO_PHYS_MASK checking, but
the UEFI BIOS pass some DMW virtual addresses.

Cc: stable@vger.kernel.org
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/io.h
arch/loongarch/mm/ioremap.c