diff mbox series

[v4,05/22] MIPS: Fix set_uncached_handler for ebase in XKPHYS

Message ID 20231208161249.1827174-6-gregory.clement@bootlin.com (mailing list archive)
State Superseded
Headers show
Series Add support for the Mobileye EyeQ5 SoC | expand

Commit Message

Gregory CLEMENT Dec. 8, 2023, 4:12 p.m. UTC
From: Jiaxun Yang <jiaxun.yang@flygoat.com>

ebase may be in XKPHYS if memblock unable to allocate memory
within KSEG0 physical range.

To map ebase into uncached space we just convert it back to
physical address and then use platform's TO_UNCAC helper
to create mapping.

Co-developed-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
Co-developed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
 arch/mips/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sergey Shtylyov Dec. 8, 2023, 5:22 p.m. UTC | #1
On 12/8/23 7:12 PM, Gregory CLEMENT wrote:

> From: Jiaxun Yang <jiaxun.yang@flygoat.com>
> 
> ebase may be in XKPHYS if memblock unable to allocate memory

   Is unable...

> within KSEG0 physical range.
> 
> To map ebase into uncached space we just convert it back to
> physical address and then use platform's TO_UNCAC helper
> to create mapping.
> 
> Co-developed-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
> Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
> Co-developed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>

  Hm, too many decelopers for such simple patch... :-)

[...]

MBR, Sergey
Sergey Shtylyov Dec. 8, 2023, 5:22 p.m. UTC | #2
On 12/8/23 7:12 PM, Gregory CLEMENT wrote:

> From: Jiaxun Yang <jiaxun.yang@flygoat.com>
> 
> ebase may be in XKPHYS if memblock unable to allocate memory

   Is unable...

> within KSEG0 physical range.
> 
> To map ebase into uncached space we just convert it back to
> physical address and then use platform's TO_UNCAC helper
> to create mapping.
> 
> Co-developed-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
> Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
> Co-developed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>

  Hm, too many developers for such simple patch... :-)

[...]

MBR, Sergey
diff mbox series

Patch

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 60c513c51684f..230728d76d11f 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -2346,7 +2346,7 @@  static const char panic_null_cerr[] =
 void set_uncached_handler(unsigned long offset, void *addr,
 	unsigned long size)
 {
-	unsigned long uncached_ebase = CKSEG1ADDR(ebase);
+	unsigned long uncached_ebase = TO_UNCAC(__pa(ebase));
 
 	if (!addr)
 		panic(panic_null_cerr);