Skip to content

Commit dfd3b59

Browse files
Nobuhiro Iwamatsupmundt
authored andcommitted
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>
1 parent 1a67a57 commit dfd3b59

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
@@ -151,8 +151,13 @@ typedef struct page *pgtable_t;
151151
#endif /* !__ASSEMBLY__ */
152152

153153
#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
154158
#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start)
155159
#define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET)
160+
#endif
156161
#else
157162
#define UNCAC_ADDR(addr) ((addr))
158163
#define CAC_ADDR(addr) ((addr))

0 commit comments

Comments
 (0)