Skip to contentSkip to conversation

ARM Feroceon: fix kexec by setting outer_cache.inv_all

PATCH Superseded Elijah Ragozin 2 participants 5 messages Mar 25, 2013 – Apr 10, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM Feroceon: fix kexec by setting outer_cache.inv_all

On Feroceon the L2 cache becomes non-coherent with the CPU when the L1 caches are disabled. Thus the L2 needs to be invalidated after both L1 caches are disabled.

On kexec before the starting the code for relocation the kernel, the L1 caches are disabled in cpu_froc_fin (cpu_v7_proc_fin for Feroceon), but after L2 cache is never invalidated, because inv_all is not set in cache-feroceon-l2.c.
So kernel relocation and decompression may has (and usually has) errors. Setting the function enables L2 invalidation and fixes the issue.

---
  arch/arm/mm/cache-feroceon-l2.c | 1 +
  1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/arch/arm/mm/cache-feroceon-l2.c
index e0b0e7a..09f8851 100644

arch/arm/mm/cache-feroceon-l2.c +1 -0
@@ -342,6 +342,7 @@ void __init feroceon_l2_init(int __l2_wt_override)
      outer_cache.inv_range = feroceon_l2_inv_range;
      outer_cache.clean_range = feroceon_l2_clean_range;
      outer_cache.flush_range = feroceon_l2_flush_range;
+    outer_cache.inv_all = l2_inv_all;
 
      enable_l2();
 
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH RESEND v2 1/1 ARM Feroceon: fix kexec by setting outer_cache.inv_all

On Feroceon the L2 cache becomes non-coherent with the CPU when the L1 caches are disabled. Thus the L2 needs to be invalidated after both L1 caches are disabled.

On kexec before the starting the code for relocation the kernel, the L1 caches are disabled in cpu_froc_fin (cpu_v7_proc_fin for Feroceon), but after L2 cache is never invalidated, because inv_all is not set in cache-feroceon-l2.c.
So kernel relocation and decompression may has (and usually has) errors. Setting the function enables L2 invalidation and fixes the issue.

---
  arch/arm/mm/cache-feroceon-l2.c | 1 +
  1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/arch/arm/mm/cache-feroceon-l2.c
index e0b0e7a..09f8851 100644

arch/arm/mm/cache-feroceon-l2.c +1 -0
@@ -342,6 +342,7 @@ void __init feroceon_l2_init(int __l2_wt_override)
  	outer_cache.inv_range = feroceon_l2_inv_range;
  	outer_cache.clean_range = feroceon_l2_clean_range;
  	outer_cache.flush_range = feroceon_l2_flush_range;
+	outer_cache.inv_all = l2_inv_all;
  
  	enable_l2();
  
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH RESEND v2 1/1 ARM Feroceon: fix kexec by setting outer_cache.inv_all

On Feroceon the L2 cache becomes non-coherent with the CPU when the L1 caches are disabled. Thus the L2 needs to be invalidated after both L1 caches are disabled.

On kexec before the starting the code for relocation the kernel, the L1 caches are disabled in cpu_froc_fin (cpu_v7_proc_fin for Feroceon), but after L2 cache is never invalidated, because inv_all is not set in cache-feroceon-l2.c.
So kernel relocation and decompression may has (and usually has) errors. Setting the function enables L2 invalidation and fixes the issue.

---
  arch/arm/mm/cache-feroceon-l2.c | 1 +
  1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/arch/arm/mm/cache-feroceon-l2.c
index e0b0e7a..09f8851 100644

arch/arm/mm/cache-feroceon-l2.c +1 -0
@@ -342,6 +342,7 @@ void __init feroceon_l2_init(int __l2_wt_override)
  	outer_cache.inv_range = feroceon_l2_inv_range;
  	outer_cache.clean_range = feroceon_l2_clean_range;
  	outer_cache.flush_range = feroceon_l2_flush_range;
+	outer_cache.inv_all = l2_inv_all;
  
  	enable_l2();
  
Signature · 1 line
1.8.1.4
Acked-by on v2 1/1
#3 lore raw
Quoted 11 lines · Elijah Ragozin

On Feroceon the L2 cache becomes non-coherent with the CPU when the L1 caches are disabled. Thus the L2 needs to be invalidated after both L1 caches are disabled.

On kexec before the starting the code for relocation the kernel, the L1 caches are disabled in cpu_froc_fin (cpu_v7_proc_fin for Feroceon), but after L2 cache is never invalidated, because inv_all is not set in cache-feroceon-l2.c.
So kernel relocation and decompression may has (and usually has) errors. Setting the function enables L2 invalidation and fixes the issue.

Quoted 4 lines
---
 arch/arm/mm/cache-feroceon-l2.c | 1 +
 1 file changed, 1 insertion(+)

fwiw,

Please put this in Russell King's patch tracker so he can pull it in.

thx,

Jason.

#4 lore raw
Quoted 18 lines · Jason Cooper
Quoted 11 lines · Elijah Ragozin

On Feroceon the L2 cache becomes non-coherent with the CPU when the L1 caches are disabled. Thus the L2 needs to be invalidated after both L1 caches are disabled.

On kexec before the starting the code for relocation the kernel, the L1 caches are disabled in cpu_froc_fin (cpu_v7_proc_fin for Feroceon), but after L2 cache is never invalidated, because inv_all is not set in cache-feroceon-l2.c.
So kernel relocation and decompression may has (and usually has) errors. Setting the function enables L2 invalidation and fixes the issue.

Quoted 4 lines
---
  arch/arm/mm/cache-feroceon-l2.c | 1 +
  1 file changed, 1 insertion(+)

fwiw,

Quoted 8 lines

Please put this in Russell King's patch tracker so he can pull it in.

thx,

Jason.

Jason,

thank you for reviewing and acking,
I just put the patch to the Russell King's patch tracker.

Signature · 2 lines
Best Regards,
Illia Ragozin.