]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: Avoid corrupting the upper 32-bit of phys_addr_t in ioremap
authorVincent Chen <vincentc@andestech.com>
Tue, 2 Oct 2018 08:52:31 +0000 (16:52 +0800)
committerPalmer Dabbelt <palmer@sifive.com>
Tue, 23 Oct 2018 00:02:56 +0000 (17:02 -0700)
commit22785d464691efcad519d2e8924850d536238ef1
treeb06c4c99ec6e728b6447a5a6c6d61bac60c84e78
parent16e9b1ff5c1fe29c1b0f5403a712cdde25f9fab1
RISC-V: Avoid corrupting the upper 32-bit of phys_addr_t in ioremap

For 32bit, the upper 32-bit of phys_addr_t will be flushed to zero
after AND with PAGE_MASK because the data type of PAGE_MASK is
unsigned long. To fix this problem, the page alignment is done by
subtracting the page offset instead of AND with PAGE_MASK.

Signed-off-by: Vincent Chen <vincentc@andestech.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/mm/ioremap.c