Skip to contentSkip to conversation

mips/traps: use CKSEG1ADDR for uncache handler

PATCH In review Sebastian Andrzej Siewior 2 participants 3 messages Apr 27, 2010 – Apr 29, 2010 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mips/traps: use CKSEG1ADDR for uncache handler

since "MIPS: Calculate proper ebase value for 64-bit kernels" my mips toy did not boot anymore.
Before that commit we always touched xkphys/shared as ebase and computed xphsys/unchached for that area. After that commit ebase become 32bit compat address and convert does not work anymore. So I guess now want to touch the 32bit compat unmapped & uncached area for this. CKSEG1ADDR does just in 32bit and 64bit.

---
 arch/mips/kernel/traps.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
arch/mips/kernel/traps.c +1 -6
index 4e00f9b..1b57f18 100644
@@ -1557,12 +1557,7 @@ static char panic_null_cerr[] __cpuinitdata =
 void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
 	unsigned long size)
 {
-#ifdef CONFIG_32BIT
-	unsigned long uncached_ebase = KSEG1ADDR(ebase);
-#endif
-#ifdef CONFIG_64BIT
-	unsigned long uncached_ebase = TO_UNCAC(ebase);
-#endif
+	unsigned long uncached_ebase = CKSEG1ADDR(ebase);
 
 	if (!addr)
 		panic(panic_null_cerr);
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 8 lines · Sebastian Andrzej Siewior

since "MIPS: Calculate proper ebase value for 64-bit kernels" my mips toy did not boot anymore.
Before that commit we always touched xkphys/shared as ebase and computed xphsys/unchached for that area. After that commit ebase become 32bit compat address and convert does not work anymore. So I guess now want to touch the 32bit compat unmapped & uncached area for this. CKSEG1ADDR does just in 32bit and 64bit.

Just tested it in 32bit and 64bit kernel on my YeeLoong netbook, both of them work well.

BTW: there is another patch[1] sent to this mailing list Yesterday, differ from your method, it tries to provide a TO_UNCAC() for 32bit kernel, but seems yours is lighter.

[1] http://patchwork.linux-mips.org/project/linux-mips/list/
[1/2] MIPS: Fixup and cleanup of TO_PHYS(), TO_CAC(), TO_UNCAC()
http://patchwork.linux-mips.org/patch/1146/
[2/2] MIPS: Cleanup of set_uncached_handler()
http://patchwork.linux-mips.org/patch/1147/

Regards,
Wu Zhangjin

Quoted 23 lines
---
 arch/mips/kernel/traps.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
arch/mips/kernel/traps.c +1 -6
index 4e00f9b..1b57f18 100644
@@ -1557,12 +1557,7 @@ static char panic_null_cerr[] __cpuinitdata =
 void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
 	unsigned long size)
 {
-#ifdef CONFIG_32BIT
-	unsigned long uncached_ebase = KSEG1ADDR(ebase);
-#endif
-#ifdef CONFIG_64BIT
-	unsigned long uncached_ebase = TO_UNCAC(ebase);
-#endif
+	unsigned long uncached_ebase = CKSEG1ADDR(ebase);
 
 	if (!addr)
 		panic(panic_null_cerr);
#2 lore raw
Quoted 2 lines · * Wu Zhangjin | 2010-04-28 23:45:22 [+0800]:

Just tested it in 32bit and 64bit kernel on my YeeLoong netbook, both of them work well.

The interresting part is what happens on IP27.

Quoted 3 lines

BTW: there is another patch[1] sent to this mailing list Yesterday, differ from your method, it tries to provide a TO_UNCAC() for 32bit kernel, but seems yours is lighter.

I haven't seen much users of TO_UNCAC() in tree so I wasn't sure what the parameter of TO_UNCAC() can/should be.

Quoted 3 lines

Regards,
Wu Zhangjin

Sebastian