Skip to contentSkip to conversation

ARM: l2x0: kexex, cleanup and optimisation

PATCH New Santosh Shilimkar 7 participants 23 messages Sep 7, 2010 – Jun 18, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

This series is just repost adding Catalin's ack to the patches and combining Thomas's two rebased kexec patches.
It's generated against the mainline 2.6.36-rc3 + Catalin's "[PATCH 0/9] Various patches for 2.6.37-rc1" series.

Santosh Shilimkar (4):
omap4: l2x0: Override the default l2x0_disable
ARM: l2x0: Fix coding-style in the cache-l2x0.h
ARM: l2x0: Determine the cache size
ARM: l2x0: Optimise the range based operations

Thomas Gleixner (2):
arm: Disable outer (L2) cache in kexec
arm: Implement l2x0 cache disable functions

 arch/arm/include/asm/hardware/cache-l2x0.h |    9 +++-
 arch/arm/include/asm/outercache.h          |   24 +++++++++++
 arch/arm/kernel/machine_kexec.c            |    3 +
 arch/arm/mach-omap2/omap4-common.c         |   13 ++++++
 arch/arm/mm/cache-l2x0.c                   |   63 ++++++++++++++++++++++++++-
 5 files changed, 106 insertions(+), 6 deletions(-)
#1 lore raw

PATCH 1/6 arm: Disable outer (L2) cache in kexec

From: Thomas Gleixner <[[email protected]]>

kexec does not disable the outer cache before disabling the inner caches in cpu_proc_fin(). So L2 is enabled across the kexec jump. When the new kernel enables chaches again, it randomly crashes.

Disabling L2 before calling cpu_proc_fin() cures the problem.

Disabling L2 requires the following new functions: flush_all(), inv_all() and disable(). Add them to outer_cache_fns and call them from the kexec code.

---
 arch/arm/include/asm/outercache.h |   24 ++++++++++++++++++++++++
 arch/arm/kernel/machine_kexec.c   |    3 +++
 2 files changed, 27 insertions(+), 0 deletions(-)
arch/arm/include/asm/outercache.h +24 -0
index 25f76ba..fc19009 100644
@@ -25,6 +25,9 @@ struct outer_cache_fns {
 	void (*inv_range)(unsigned long, unsigned long);
 	void (*clean_range)(unsigned long, unsigned long);
 	void (*flush_range)(unsigned long, unsigned long);
+	void (*flush_all)(void);
+	void (*inv_all)(void);
+	void (*disable)(void);
 #ifdef CONFIG_OUTER_CACHE_SYNC
 	void (*sync)(void);
 #endif
@@ -50,6 +53,24 @@ static inline void outer_flush_range(unsigned long start, unsigned long end)
 		outer_cache.flush_range(start, end);
 }
 
+static inline void outer_flush_all(void)
+{
+	if (outer_cache.flush_all)
+		outer_cache.flush_all();
+}
+
+static inline void outer_inv_all(void)
+{
+	if (outer_cache.inv_all)
+		outer_cache.inv_all();
+}
+
+static inline void outer_disable(void)
+{
+	if (outer_cache.disable)
+		outer_cache.disable();
+}
+
 #else
 
 static inline void outer_inv_range(unsigned long start, unsigned long end)
@@ -58,6 +79,9 @@ static inline void outer_clean_range(unsigned long start, unsigned long end)
 { }
 static inline void outer_flush_range(unsigned long start, unsigned long end)
 { }
+static inline void outer_flush_all(void) { }
+static inline void outer_inv_all(void) { }
+static inline void outer_disable(void) { }
 
 #endif
 
arch/arm/kernel/machine_kexec.c +3 -0
index 1fc74cb..3a8fd51 100644
@@ -78,7 +78,10 @@ void machine_kexec(struct kimage *image)
 	local_fiq_disable();
 	setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
 	flush_cache_all();
+	outer_flush_all();
+	outer_disable();
 	cpu_proc_fin();
+	outer_inv_all();
 	flush_cache_all();
 	cpu_reset(reboot_code_buffer_phys);
 }
Signature · 1 line
1.6.0.4
#2 lore raw

PATCH 2/6 arm: Implement l2x0 cache disable functions

From: Thomas Gleixner <[[email protected]]>

Add flush_all, inv_all and disable functions to the l2x0 code. These functions are called from kexec code to prevent random crashes in the new kernel.

Platforms like OMAP which control L2 enable/disable via SMI mode can override the outer_cache.disable() function to implement their own.

---
 arch/arm/mm/cache-l2x0.c |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)
arch/arm/mm/cache-l2x0.c +27 -1
index edb43ff..9310d61 100644
@@ -112,12 +112,26 @@ static void l2x0_cache_sync(void)
 	spin_unlock_irqrestore(&l2x0_lock, flags);
 }
 
-static inline void l2x0_inv_all(void)
+static void l2x0_flush_all(void)
+{
+	unsigned long flags;
+
+	/* clean all ways */
+	spin_lock_irqsave(&l2x0_lock, flags);
+	writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY);
+	cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask);
+	cache_sync();
+	spin_unlock_irqrestore(&l2x0_lock, flags);
+}
+
+static void l2x0_inv_all(void)
 {
 	unsigned long flags;
 
 	/* invalidate all ways */
 	spin_lock_irqsave(&l2x0_lock, flags);
+	/* Invalidating when L2 is enabled is a nono */
+	BUG_ON(readl(l2x0_base + L2X0_CTRL) & 1);
 	writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY);
 	cache_wait_way(l2x0_base + L2X0_INV_WAY, l2x0_way_mask);
 	cache_sync();
@@ -215,6 +229,15 @@ static void l2x0_flush_range(unsigned long start, unsigned long end)
 	spin_unlock_irqrestore(&l2x0_lock, flags);
 }
 
+static void l2x0_disable(void)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&l2x0_lock, flags);
+	writel(0, l2x0_base + L2X0_CTRL);
+	spin_unlock_irqrestore(&l2x0_lock, flags);
+}
+
 void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
 {
 	__u32 aux;
@@ -272,6 +295,9 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
 	outer_cache.clean_range = l2x0_clean_range;
 	outer_cache.flush_range = l2x0_flush_range;
 	outer_cache.sync = l2x0_cache_sync;
+	outer_cache.flush_all = l2x0_flush_all;
+	outer_cache.inv_all = l2x0_inv_all;
+	outer_cache.disable = l2x0_disable;
 
 	printk(KERN_INFO "%s cache controller enabled\n", type);
 	printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x\n",
Signature · 1 line
1.6.0.4
#3 lore raw

PATCH 3/6 omap4: l2x0: Override the default l2x0_disable

The machine_kexec() calls outer_disable which can crash on OMAP4 becasue of trustzone restrictions.

This patch overrides the default l2x0_disable with a OMAP4 specific implementation taking care of trustzone

---
 arch/arm/mach-omap2/omap4-common.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap4-common.c +13 -0
index 13dc979..b557cc2 100644
@@ -44,6 +44,13 @@ void __init gic_init_irq(void)
 }
 
 #ifdef CONFIG_CACHE_L2X0
+
+static void omap4_l2x0_disable(void)
+{
+	/* Disable PL310 L2 Cache controller */
+	omap_smc1(0x102, 0x0);
+}
+
 static int __init omap_l2_cache_init(void)
 {
 	/*
@@ -66,6 +73,12 @@ static int __init omap_l2_cache_init(void)
 	 */
 	l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
 
+	/*
+	 * Override default outer_cache.disable with a OMAP4
+	 * specific one
+	*/
+	outer_cache.disable = omap4_l2x0_disable;
+
 	return 0;
 }
 early_initcall(omap_l2_cache_init);
Signature · 1 line
1.6.0.4
#4 lore raw

PATCH 4/6 ARM: l2x0: Fix coding-style in the cache-l2x0.h

Replace tab with space after #define to be consisten with other define in the file. Also move the bit mask below the register offsets.

---
 arch/arm/include/asm/hardware/cache-l2x0.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/include/asm/hardware/cache-l2x0.h +5 -3
index 6bcba48..d833355 100644
@@ -21,9 +21,6 @@
 #define __ASM_ARM_HARDWARE_L2X0_H
 
 #define L2X0_CACHE_ID			0x000
-#define   L2X0_CACHE_ID_PART_MASK	(0xf << 6)
-#define   L2X0_CACHE_ID_PART_L210	(1 << 6)
-#define   L2X0_CACHE_ID_PART_L310	(3 << 6)
 #define L2X0_CACHE_TYPE			0x004
 #define L2X0_CTRL			0x100
 #define L2X0_AUX_CTRL			0x104
@@ -54,6 +51,11 @@
 #define L2X0_LINE_TAG			0xF30
 #define L2X0_DEBUG_CTRL			0xF40
 
+/* Registers shifts and masks */
+#define L2X0_CACHE_ID_PART_MASK		(0xf << 6)
+#define L2X0_CACHE_ID_PART_L210		(1 << 6)
+#define L2X0_CACHE_ID_PART_L310		(3 << 6)
+
 #ifndef __ASSEMBLY__
 extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask);
 #endif
Signature · 1 line
1.6.0.4
#5 lore raw

PATCH 5/6 ARM: l2x0: Determine the cache size

The cache size is needed for to optimise range based maintainance operations

---
 arch/arm/include/asm/hardware/cache-l2x0.h |    1 +
 arch/arm/mm/cache-l2x0.c                   |   13 +++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
arch/arm/include/asm/hardware/cache-l2x0.h +1 -0
index d833355..4633d2a 100644
@@ -55,6 +55,7 @@
 #define L2X0_CACHE_ID_PART_MASK		(0xf << 6)
 #define L2X0_CACHE_ID_PART_L210		(1 << 6)
 #define L2X0_CACHE_ID_PART_L310		(3 << 6)
+#define L2X0_AUX_CTRL_WAY_SIZE_MASK	(0x3 << 17)
 
 #ifndef __ASSEMBLY__
 extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask);
arch/arm/mm/cache-l2x0.c +11 -2
index 9310d61..87b487e 100644
@@ -28,6 +28,7 @@
 static void __iomem *l2x0_base;
 static DEFINE_SPINLOCK(l2x0_lock);
 static uint32_t l2x0_way_mask;	/* Bitmask of active ways */
+static uint32_t l2x0_size;
 
 static inline void cache_wait_way(void __iomem *reg, unsigned long mask)
 {
@@ -242,6 +243,7 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
 {
 	__u32 aux;
 	__u32 cache_id;
+	__u32 way_size = 0;
 	int ways;
 	const char *type;
 
@@ -276,6 +278,13 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
 	l2x0_way_mask = (1 << ways) - 1;
 
 	/*
+	 * L2 cache Size =  Way size * Number of ways
+	 */
+	way_size = (aux & L2X0_AUX_CTRL_WAY_SIZE_MASK) >> 17;
+	way_size = 1 << (way_size + 3);
+	l2x0_size = ways * way_size;
+
+	/*
 	 * Check if l2x0 controller is already enabled.
 	 * If you are booting from non-secure mode
 	 * accessing the below registers will fault.
@@ -300,6 +309,6 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
 	outer_cache.disable = l2x0_disable;
 
 	printk(KERN_INFO "%s cache controller enabled\n", type);
-	printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x\n",
-			 ways, cache_id, aux);
+	printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d KB\n",
+			ways, cache_id, aux, l2x0_size);
 }
Signature · 1 line
1.6.0.4
#6 lore raw

PATCH 6/6 ARM: l2x0: Optimise the range based operations

For the big buffers which are in excess of cache size, the maintaince operations by PA are very slow. For such buffers the maintainace operations can be speeded up by using the WAY based method.

---
 arch/arm/mm/cache-l2x0.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/mm/cache-l2x0.c +22 -0
index 87b487e..143a39f 100644
@@ -125,6 +125,18 @@ static void l2x0_flush_all(void)
 	spin_unlock_irqrestore(&l2x0_lock, flags);
 }
 
+static void l2x0_clean_all(void)
+{
+	unsigned long flags;
+
+	/* clean all ways */
+	spin_lock_irqsave(&l2x0_lock, flags);
+	writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_WAY);
+	cache_wait_way(l2x0_base + L2X0_CLEAN_WAY, l2x0_way_mask);
+	cache_sync();
+	spin_unlock_irqrestore(&l2x0_lock, flags);
+}
+
 static void l2x0_inv_all(void)
 {
 	unsigned long flags;
@@ -183,6 +195,11 @@ static void l2x0_clean_range(unsigned long start, unsigned long end)
 	void __iomem *base = l2x0_base;
 	unsigned long flags;
 
+	if ((end - start) >= l2x0_size) {
+		l2x0_clean_all();
+		return;
+	}
+
 	spin_lock_irqsave(&l2x0_lock, flags);
 	start &= ~(CACHE_LINE_SIZE - 1);
 	while (start < end) {
@@ -208,6 +225,11 @@ static void l2x0_flush_range(unsigned long start, unsigned long end)
 	void __iomem *base = l2x0_base;
 	unsigned long flags;
 
+	if ((end - start) >= l2x0_size) {
+		l2x0_flush_all();
+		return;
+	}
+
 	spin_lock_irqsave(&l2x0_lock, flags);
 	start &= ~(CACHE_LINE_SIZE - 1);
 	while (start < end) {
Signature · 1 line
1.6.0.4
#7 lore raw

PATCH 6/6 ARM: l2x0: Optimise the range based operations

Quoted 3 lines · Santosh Shilimkar

For the big buffers which are in excess of cache size, the maintaince operations by PA are very slow. For such buffers the maintainace operations can be speeded up by using the WAY based method.

This causes my Versatile Express to corrupt MMC transfers. Reverting both this and the 'Determine cache size' patches makes it work again.

(Note that just reverting this one doesn't result in a working situation.)

Good boot:

L310 cache controller enabled
l2x0: 8 ways, CACHE_ID 0x410000c3, AUX_CTRL 0x02460000
...
mmci-pl18x mb:mmci: mmc0: MMCI rev 0 cfg 00 at 0x0000000010005000 irq 41,42 aaci-pl041 mb:aaci: ARM AC'97 Interface at 0x0000000010004000, irq 43, fifo 512 ALSA device list:
#0: ARM AC'97 Interface at 0x0000000010004000, irq 43
TCP cubic registered
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card at address e624
mmcblk0: mmc0:e624 SD02G 1.89 GiB
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
mmcblk0: p1
Initalizing network drop monitor service
Waiting 5sec before mounting root device...
port 1 high speed

Bad boot (with just 'Determine cache size' patch applied):

L310 cache controller enabled
l2x0: 8 ways, CACHE_ID 0x410000c3, AUX_CTRL 0x02460000, Cache size: 512 KB
...
mmci-pl18x mb:mmci: mmc0: MMCI rev 0 cfg 00 at 0x0000000010005000 irq 41,42 aaci-pl041 mb:aaci: ARM AC'97 Interface at 0x0000000010004000, irq 43, fifo 512 ALSA device list:
#0: ARM AC'97 Interface at 0x0000000010004000, irq 43
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card at address e624
mmcblk0: mmc0:e624 SD02G 1.89 GiB
TCP cubic registered
NET: Registered protocol family 17
mmcblk0: retrying using single block read
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
mmcblk0: error -5 transferring data, sector 0, nr 8, card status 0x900 Initalizing network drop monitor service
<random garbage>
mmcblk0: error -5 transferring data, sector 1, nr 7, card status 0x900
end_request: I/O error, dev mmcblk0, sector 1
Buffer I/O error on device mmcblk0, logical block 0
port 1 high speed

-5 is -EIO, which is a FIFO overrun error, so somehow these changes are causing the CPU or bus accesses to be slower.

#8 lore raw

PATCH 6/6 ARM: l2x0: Optimise the range based operations

Quoted 9 lines

-----Original Message-----
From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
Sent: Tuesday, October 05, 2010 2:53 AM
To: Shilimkar, Santosh
Cc: linux-arm-kernel at lists.infradead.org; catalin.marinas at arm.com; tglx at linutronix.de; linux-omap at vger.kernel.org
Subject: Re: [PATCH 6/6] ARM: l2x0: Optimise the range based operations

On Tue, Sep 07, 2010 at 01:27:23PM +0530, Santosh Shilimkar wrote:

Quoted 9 lines
Quoted 3 lines

For the big buffers which are in excess of cache size, the maintaince operations by PA are very slow. For such buffers the maintainace operations can be speeded up by using the WAY based method.

This causes my Versatile Express to corrupt MMC transfers. Reverting both this and the 'Determine cache size' patches makes it work again.

(Note that just reverting this one doesn't result in a working situation.)

Mostly MMC buffers are smaller than 512KB so the optimization won't even be invoked.

Quoted 50 lines

Good boot:

L310 cache controller enabled
l2x0: 8 ways, CACHE_ID 0x410000c3, AUX_CTRL 0x02460000
...
mmci-pl18x mb:mmci: mmc0: MMCI rev 0 cfg 00 at 0x0000000010005000 irq 41,42
aaci-pl041 mb:aaci: ARM AC'97 Interface at 0x0000000010004000, irq 43, fifo 512
ALSA device list:
#0: ARM AC'97 Interface at 0x0000000010004000, irq 43
TCP cubic registered
mmc0: host does not support reading read-only switch. assuming write- enable.
mmc0: new SD card at address e624
mmcblk0: mmc0:e624 SD02G 1.89 GiB
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
mmcblk0: p1
Initalizing network drop monitor service
Waiting 5sec before mounting root device...
port 1 high speed

Bad boot (with just 'Determine cache size' patch applied):

L310 cache controller enabled
l2x0: 8 ways, CACHE_ID 0x410000c3, AUX_CTRL 0x02460000, Cache size: 512 KB
...
mmci-pl18x mb:mmci: mmc0: MMCI rev 0 cfg 00 at 0x0000000010005000 irq 41,42
aaci-pl041 mb:aaci: ARM AC'97 Interface at 0x0000000010004000, irq 43, fifo 512
ALSA device list:
#0: ARM AC'97 Interface at 0x0000000010004000, irq 43
mmc0: host does not support reading read-only switch. assuming write- enable.
mmc0: new SD card at address e624
mmcblk0: mmc0:e624 SD02G 1.89 GiB
TCP cubic registered
NET: Registered protocol family 17
mmcblk0: retrying using single block read
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
mmcblk0: error -5 transferring data, sector 0, nr 8, card status 0x900 Initalizing network drop monitor service
<random garbage>
mmcblk0: error -5 transferring data, sector 1, nr 7, card status 0x900
end_request: I/O error, dev mmcblk0, sector 1
Buffer I/O error on device mmcblk0, logical block 0
port 1 high speed

Quoted 2 lines

-5 is -EIO, which is a FIFO overrun error, so somehow these changes are causing the CPU or bus accesses to be slower.

I don't see the problem on OMAP MMC.
May be some how additional check is making these operations touch slower which lead to the under run.

Will have a look at it again. May for this merge window you can drop 'Optimise the range based operations' and ''Determine cache size' patches.

Regards,
Santosh

#9 lore raw

PATCH 6/6 ARM: l2x0: Optimise the range based operations

Quoted 9 lines

-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Shilimkar, Santosh
Sent: Tuesday, October 05, 2010 10:25 AM
To: Russell King - ARM Linux
Cc: linux-arm-kernel at lists.infradead.org; catalin.marinas at arm.com; tglx at linutronix.de; linux-omap at vger.kernel.org
Subject: RE: [PATCH 6/6] ARM: l2x0: Optimise the range based operations

[....]

Quoted 7 lines
Quoted 7 lines

mmcblk0: error -5 transferring data, sector 1, nr 7, card status 0x900
end_request: I/O error, dev mmcblk0, sector 1
Buffer I/O error on device mmcblk0, logical block 0
port 1 high speed

-5 is -EIO, which is a FIFO overrun error, so somehow these changes are causing the CPU or bus accesses to be slower.

Quoted 8 lines

I don't see the problem on OMAP MMC.
May be some how additional check is making these operations touch slower which lead to the under run.

Will have a look at it again. May for this merge window you can drop 'Optimise the range based operations' and 'Determine cache size' patches.

The Pl310 cache way size given in KB and 'Determine cache size' missed to include that. Have updated the git tree with refreshed patch. Here is the updated patch..

----------------------

#10 lore raw

PATCH 6/6 ARM: l2x0: Optimise the range based operations

In reply to Santosh Shilimkar
Quoted 11 lines · Santosh Shilimkar

For the big buffers which are in excess of cache size, the maintaince operations by PA are very slow. For such buffers the maintainace operations can be speeded up by using the WAY based method.

---
 arch/arm/mm/cache-l2x0.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/mm/cache-l2x0.c +0 -0

[..]

arch/arm/mm/cache-l2x0.c static void l2x0_flush_range(unsigned long start, unsigned long end) · line 235

Quoted 12 lines
arch/arm/mm/cache-l2x0.c +5 -0
@@ -208,6 +225,11 @@ static void l2x0_flush_range(unsigned long start, unsigned long end)
 	void __iomem *base = l2x0_base;
 	unsigned long flags;
 
+	if ((end - start) >= l2x0_size) {
+		l2x0_flush_all();
+		return;
+	}
+
 	spin_lock_irqsave(&l2x0_lock, flags);
 	start &= ~(CACHE_LINE_SIZE - 1);
 	while (start < end) {

I wonder if this is safe. Are the L2 controller clean&invalidate operations atomic in relation to CPU stores? The PL310 TRM says that clean and invalidate by way is a background operation. About background operations the TRM says that the targeted ways are locked for allocations but read or write hits are permitted to access the way. So is the following sequence possible?

1. L2 controller cleans a way
2. A CPU writes to the same way
3. L2 controller invalidates the way

This would result in loss of data. This would mean that the optimization is not safe if several cores are active.

--
Antti P Miettinen
http://www.iki.fi/~ananaza/

maintainer
#11 lore raw

PATCH 3/6 omap4: l2x0: Override the default l2x0_disable

In reply to Santosh Shilimkar
Quoted 5 lines · Santosh Shilimkar

The machine_kexec() calls outer_disable which can crash on OMAP4 becasue of trustzone restrictions.

This patch overrides the default l2x0_disable with a OMAP4 specific implementation taking care of trustzone

<snip>

Quoted 13 lines
arch/arm/mach-omap2/omap4-common.c +6 -0
@@ -66,6 +73,12 @@ static int __init omap_l2_cache_init(void)
 
 	 */
 	l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
 
+	/*
+	 * Override default outer_cache.disable with a OMAP4
+	 * specific one
+	*/
+	outer_cache.disable = omap4_l2x0_disable;
+
 	return 0;
 }
Quoted 1 line

early_initcall(omap_l2_cache_init);

Just to be sure.. No outer_cache functions get set unless l2x0_init gets called, right? So omap2 and omap3 functions always stay NULL with omap3_defconfig?

Tony

#12 lore raw

PATCH 3/6 omap4: l2x0: Override the default l2x0_disable

Quoted 22 lines

-----Original Message-----
From: Tony Lindgren [mailto:tony at atomide.com]
Sent: Thursday, September 16, 2010 5:52 AM
To: Shilimkar, Santosh
Cc: linux-arm-kernel at lists.infradead.org; tglx at linutronix.de; catalin.marinas at arm.com; linux-omap at vger.kernel.org
Subject: Re: [PATCH 3/6] omap4: l2x0: Override the default l2x0_disable

Quoted 5 lines · Santosh Shilimkar

The machine_kexec() calls outer_disable which can crash on OMAP4 becasue of trustzone restrictions.

This patch overrides the default l2x0_disable with a OMAP4 specific implementation taking care of trustzone

<snip>

Quoted 5 lines
arch/arm/mach-omap2/omap4-common.c +0 -0
@@ -66,6 +73,12 @@ static int __init omap_l2_cache_init(void)
 
 	 */
 	l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
 
Quoted 14 lines
Quoted 9 lines
arch/arm/mach-omap2/omap4-common.c +6 -0
+	/*
+	 * Override default outer_cache.disable with a OMAP4
+	 * specific one
+	*/
+	outer_cache.disable = omap4_l2x0_disable;
+
 	return 0;
 }

early_initcall(omap_l2_cache_init);

Just to be sure.. No outer_cache functions get set unless l2x0_init gets called, right? So omap2 and omap3 functions always stay NULL with omap3_defconfig?

Yes.

#13 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

In reply to Santosh Shilimkar

2010/9/7 Santosh Shilimkar <[email protected]>:

Quoted 11 lines

This series is just repost adding Catalin's ack to the patches and combining Thomas's two rebased kexec patches.
It's generated against the mainline 2.6.36-rc3 + Catalin's "[PATCH 0/9] Various patches for 2.6.37-rc1" series.

Santosh Shilimkar (4):
?omap4: l2x0: Override the default l2x0_disable
?ARM: l2x0: Fix coding-style in the cache-l2x0.h
?ARM: l2x0: Determine the cache size
?ARM: l2x0: Optimise the range based operations

Quoted 3 lines

Thomas Gleixner (2):
?arm: Disable outer (L2) cache in kexec
?arm: Implement l2x0 cache disable functions

FWIW:

Can you also include the patch by Per Fransson I sent off to Thomas and the list just a few days ago with the subject "[PATCH] ARM: ux500 specific L2 cache code"
in this patch series?

Yours,
Linus Walleij

#14 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

Quoted 22 lines

-----Original Message-----
From: Linus Walleij [mailto:linus.ml.walleij at gmail.com]
Sent: Tuesday, September 07, 2010 11:49 PM
To: Shilimkar, Santosh
Cc: linux-arm-kernel at lists.infradead.org; catalin.marinas at arm.com; tglx at linutronix.de; linux-omap at vger.kernel.org; per.xx.fransson at stericsson.com
Subject: Re: [PATCH 0/6] ARM: l2x0: kexex, cleanup and optimisation

2010/9/7 Santosh Shilimkar <[email protected]>:

Quoted 11 lines

This series is just repost adding Catalin's ack to the patches and combining Thomas's two rebased kexec patches.
It's generated against the mainline 2.6.36-rc3 + Catalin's "[PATCH 0/9] Various patches for 2.6.37-rc1" series.

Santosh Shilimkar (4):
?omap4: l2x0: Override the default l2x0_disable
?ARM: l2x0: Fix coding-style in the cache-l2x0.h
?ARM: l2x0: Determine the cache size
?ARM: l2x0: Optimise the range based operations

Quoted 7 lines
Quoted 3 lines

Thomas Gleixner (2):
?arm: Disable outer (L2) cache in kexec
?arm: Implement l2x0 cache disable functions

FWIW:

Thanks !!

Quoted 5 lines

Can you also include the patch by Per Fransson I sent off to Thomas and the list just a few days ago with the subject "[PATCH] ARM: ux500 specific L2 cache code"
in this patch series?

Basically I plan to push all these patches to RMK's patch system after getting his OK. I can push your patch along with that.

Is that ok with you ?

Regards,
Santosh

#15 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

2010/9/8 Shilimkar, Santosh <[email protected]>:

Quoted 5 lines

Basically I plan to push all these patches to RMK's patch system after getting his OK. I can push your patch along with that.

Is that ok with you ?

Yep seems like a plan, thanks!

Yours,
Linus Walleij

#16 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

In reply to Shilimkar, Santosh
Quoted 10 lines · Santosh
Quoted 4 lines

Can you also include the patch by Per Fransson I sent off to Thomas and the list just a few days ago with the subject "[PATCH] ARM: ux500 specific L2 cache code"
in this patch series?

Basically I plan to push all these patches to RMK's patch system after getting his OK. I can push your patch along with that.

Is that ok with you ?

Or rather a pull request. AFAIK (unless this was fixed recently) the patch system doesn't handle the "From: " line to set the correct patch author.

Signature · 1 line
Catalin
#17 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

Quoted 19 lines

-----Original Message-----
From: Catalin Marinas [mailto:catalin.marinas at arm.com]
Sent: Wednesday, September 08, 2010 8:31 PM
To: Shilimkar, Santosh
Cc: Linus Walleij; linux-arm-kernel at lists.infradead.org; tglx at linutronix.de; linux-omap at vger.kernel.org; per.xx.fransson at stericsson.com
Subject: RE: [PATCH 0/6] ARM: l2x0: kexex, cleanup and optimisation

Quoted 9 lines · Santosh
Quoted 4 lines

Can you also include the patch by Per Fransson I sent off to Thomas and the list just a few days ago with the subject "[PATCH] ARM: ux500 specific L2 cache code"
in this patch series?

Basically I plan to push all these patches to RMK's patch system after getting his OK. I can push your patch along with that.

Quoted 6 lines
Quoted 1 line

Is that ok with you ?

Or rather a pull request. AFAIK (unless this was fixed recently) the patch system doesn't handle the "From: " line to set the correct patch author.

Oh Yes... pull request-is also doable... I have all these patches pilled up here already ...
http://dev.omapzoom.org/?p=santosh/kernel-omap4-base.git;a=shortlog;h=refs/heads/l2x0-for-rmk

Regards,
Santosh

#18 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

Quoted 12 lines · Santosh
Quoted 12 lines · Santosh
Quoted 10 lines
Quoted 4 lines

Can you also include the patch by Per Fransson I sent off to Thomas and the list just a few days ago with the subject "[PATCH] ARM: ux500 specific L2 cache code"
in this patch series?

Basically I plan to push all these patches to RMK's patch system after getting his OK. I can push your patch along with that.

Is that ok with you ?

Quoted 7 lines
Quoted 4 lines

Or rather a pull request. AFAIK (unless this was fixed recently) the patch system doesn't handle the "From: " line to set the correct patch author.

Oh Yes... pull request-is also doable... I have all these patches pilled up here already ...
http://dev.omapzoom.org/?p=santosh/kernel-omap4-base.git;a=shortlog;h=refs/heads/l2x0-for-rmk

Well, regarding my patches, I'm only OK for you to submit the cache-l2x0.c one named:

"ARM: Improve the L2 cache performance when PL310 is used"

The other patches I'll push separately.

Thanks.

Signature · 1 line
Catalin
#19 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

Quoted 30 lines

-----Original Message-----
From: Catalin Marinas [mailto:catalin.marinas at arm.com]
Sent: Wednesday, September 08, 2010 8:56 PM
To: Shilimkar, Santosh
Cc: Linus Walleij; linux-arm-kernel at lists.infradead.org; tglx at linutronix.de; linux-omap at vger.kernel.org; per.xx.fransson at stericsson.com
Subject: RE: [PATCH 0/6] ARM: l2x0: kexex, cleanup and optimisation

Quoted 10 lines · Santosh
Quoted 10 lines · Santosh
Quoted 9 lines
Quoted 4 lines

Can you also include the patch by Per Fransson I sent off to Thomas and the list just a few days ago with the subject "[PATCH] ARM: ux500 specific L2 cache code"
in this patch series?

Basically I plan to push all these patches to RMK's patch system after getting his OK. I can push your patch along with that.

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

Is that ok with you ?

Or rather a pull request. AFAIK (unless this was fixed recently) the patch system doesn't handle the "From: " line to set the correct patch author.

Oh Yes... pull request-is also doable... I have all these patches pilled

up

Quoted 2 lines

here already ...
http://dev.omapzoom.org/?p=santosh/kernel-omap4-

Quoted 9 lines

base.git;a=shortlog;h=refs/heads/l2x0-for-rmk

Well, regarding my patches, I'm only OK for you to submit the cache-l2x0.c one named:

"ARM: Improve the L2 cache performance when PL310 is used"

The other patches I'll push separately.

Sure.

#20 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

Quoted 45 lines

-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Shilimkar, Santosh
Sent: Wednesday, September 08, 2010 8:59 PM
To: Catalin Marinas
Cc: Linus Walleij; linux-arm-kernel at lists.infradead.org; tglx at linutronix.de; linux-omap at vger.kernel.org; per.xx.fransson at stericsson.com
Subject: RE: [PATCH 0/6] ARM: l2x0: kexex, cleanup and optimisation

Quoted 9 lines

-----Original Message-----
From: Catalin Marinas [mailto:catalin.marinas at arm.com]
Sent: Wednesday, September 08, 2010 8:56 PM
To: Shilimkar, Santosh
Cc: Linus Walleij; linux-arm-kernel at lists.infradead.org; tglx at linutronix.de; linux-omap at vger.kernel.org; per.xx.fransson at stericsson.com
Subject: RE: [PATCH 0/6] ARM: l2x0: kexex, cleanup and optimisation

Quoted 15 lines
Quoted 14 lines · Santosh
Quoted 14 lines · Santosh
Quoted 10 lines
Quoted 4 lines

Can you also include the patch by Per Fransson I sent off to Thomas and the list just a few days ago with the subject "[PATCH] ARM: ux500 specific L2 cache code"
in this patch series?

Basically I plan to push all these patches to RMK's patch system after getting his OK. I can push your patch along with that.

Is that ok with you ?

Or rather a pull request. AFAIK (unless this was fixed recently) the patch system doesn't handle the "From: " line to set the correct

patch

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

author.

Oh Yes... pull request-is also doable... I have all these patches

pilled

Quoted 5 lines

up

Quoted 2 lines

here already ...
http://dev.omapzoom.org/?p=santosh/kernel-omap4-

base.git;a=shortlog;h=refs/heads/l2x0-for-rmk

Quoted 9 lines
Quoted 7 lines

Well, regarding my patches, I'm only OK for you to submit the cache-l2x0.c one named:

"ARM: Improve the L2 cache performance when PL310 is used"

The other patches I'll push separately.

Sure.

Here is the updated branch including "Per Fransson" patch.
http://dev.omapzoom.org/?p=santosh/kernel-omap4-base.git;a=shortlog;h=refs/heads/l2x0-pull-rmk

Regards,
Santosh

#22 lore raw

cover ARM: l2x0: kexex, cleanup and optimisation

Tony,

Quoted 9 lines

-----Original Message-----
From: Catalin Marinas [mailto:catalin.marinas at arm.com]
Sent: Wednesday, September 08, 2010 9:20 PM
To: Shilimkar, Santosh
Cc: Linus Walleij; Russell King - ARM Linux; linux-arm- kernel at lists.infradead.org; tglx at linutronix.de; linux- omap at vger.kernel.org; per.xx.fransson at stericsson.com
Subject: RE: [PATCH 0/6] ARM: l2x0: kexex, cleanup and optimisation

Quoted 7 lines
Quoted 2 lines · Santosh

Here is the updated branch including "Per Fransson" patch.
http://dev.omapzoom.org/?p=santosh/kernel-omap4-

base.git;a=shortlog;h=refs/heads/l2x0-pull-rmk

It looks fine to me.

Are you ok if " [PATCH 3/6] omap4: l2x0: Override the default l2x0_disable" patch gets merged via Russell's tree?

http://dev.omapzoom.org/?p=santosh/kernel-omap4-base.git;a=blobdiff;f=arch/arm/mach-omap2/omap4-common.c;h=b557cc2c4b10e2ba4b6c4d6e3397611fb2de5952;hp=13dc9794dcc2ea68fe9115cff7be9cd8c074a484;hb=e1612fb084e78d5cba127f360803863e87a1e0cd;hpb=32ff2ccc0ca4d22c211fc5f5cc71b3d9a950c8c3

Regards,
Santosh