Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Fix cached/uncaced address calculation in 29bit mode

In the case of 29bit mode, CAC/UNCAC_ADDR does not return a right address.
This revises this problem by using P1SEGADDR and P2SEGADDR in 29bit mode.

Reported-by: Yutaro Ebihara <ebiharaml@si-linux.co.jp>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Simon Horman <horms@verge.net.au>
Cc: stable@kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Nobuhiro Iwamatsu and committed by
Paul Mundt
dfd3b596 1a67a573

+5
+5
arch/sh/include/asm/page.h
··· 151 151 #endif /* !__ASSEMBLY__ */ 152 152 153 153 #ifdef CONFIG_UNCACHED_MAPPING 154 + #if defined(CONFIG_29BIT) 155 + #define UNCAC_ADDR(addr) P2SEGADDR(addr) 156 + #define CAC_ADDR(addr) P1SEGADDR(addr) 157 + #else 154 158 #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start) 155 159 #define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET) 160 + #endif 156 161 #else 157 162 #define UNCAC_ADDR(addr) ((addr)) 158 163 #define CAC_ADDR(addr) ((addr))