Skip to content

Commit aa85ae0

Browse files
Nobuhiro Iwamatsugregkh
authored andcommitted
sh: Fix cached/uncaced address calculation in 29bit mode
commit dfd3b59 upstream. 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> Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent d8f0e58 commit aa85ae0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎arch/sh/include/asm/page.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ typedef struct page *pgtable_t;
141141
#endif /* !__ASSEMBLY__ */
142142

143143
#ifdef CONFIG_UNCACHED_MAPPING
144+
#if defined(CONFIG_29BIT)
145+
#define UNCAC_ADDR(addr) P2SEGADDR(addr)
146+
#define CAC_ADDR(addr) P1SEGADDR(addr)
147+
#else
144148
#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start)
145149
#define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET)
150+
#endif
146151
#else
147152
#define UNCAC_ADDR(addr) ((addr))
148153
#define CAC_ADDR(addr) ((addr))

0 commit comments

Comments
 (0)