public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch 0/2] ARM: Disable outer cache before kexec call
Date: Thu, 1 Jul 2010 22:08:07 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1007012126440.4507@localhost.localdomain> (raw)
In-Reply-To: <20100701172128.GB15162@n2100.arm.linux.org.uk>

On Thu, 1 Jul 2010, Russell King - ARM Linux wrote:
> On Thu, Jul 01, 2010 at 06:06:53PM +0100, Russell King - ARM Linux wrote:
> > On Thu, Jul 01, 2010 at 10:08:37PM +0530, Shilimkar, Santosh wrote:
>
> Right, something like this.  I've not made an effort to fix the L2 bits,
> but I have marked the places where attention is required.  The interesting
> bit is the first two files.

I filled in the L2 bits for l2x0 in the following way:

Index: linux-2.6/arch/arm/mm/cache-l2x0.c
===================================================================
--- linux-2.6.orig/arch/arm/mm/cache-l2x0.c
+++ linux-2.6/arch/arm/mm/cache-l2x0.c
@@ -103,6 +103,18 @@ static void l2x0_cache_sync(void)
 	spin_unlock_irqrestore(&l2x0_lock, flags);
 }
 
+static inline void l2x0_flush_all(void)
+{
+	unsigned long flags;
+
+	/* invalidate all ways */
+	spin_lock_irqsave(&l2x0_lock, flags);
+	writel(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY);
+	cache_wait(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask);
+	cache_sync();
+	spin_unlock_irqrestore(&l2x0_lock, flags);
+}
+
 static inline void l2x0_inv_all(void)
 {
 	unsigned long flags;
@@ -262,6 +274,7 @@ void __init l2x0_init(void __iomem *base
 	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_cache_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",

Now I added outer_flush_all() calls to the places Russell pointed out.

Unfortunately that works just 5 times in a row, then the box stops
dead _after_ the decompressor jumps into the kernel. With current
mainline we fail in the decompressor itself. I guess we need the same
magic in the decompressor as well.

Adding the L2 disable function on top of these patches works like a
charm.

Seriously I think that keeping L2 enabled has enough unknown side
effects which might be dealt with by some random cache flushes, but
that's not a real solution to the underlying problem.

As a matter of sanity I think we should add the L2 disable
functionality. It's logical and it _DOES_ work. Further it solves a
real world problem as kexec is broken on any L2 enabled system AFAICT.

The sillyness of OMAP3 can be dealt with by those who invented that
insanity w/o imposing their wreckage on everyone.

Thanks,

	tglx

      parent reply	other threads:[~2010-07-01 20:08 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 16:05 [patch 0/2] ARM: Disable outer cache before kexec call Thomas Gleixner
2010-07-01 16:05 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
2010-07-01 16:05 ` [patch 2/2] arm: Implement l2x0 cache disable function Thomas Gleixner
     [not found]   ` <AANLkTillHUsJF8brOtHh8tl9Us493GsWfpjhXXsFExY7@mail.gmail.com>
2010-07-02 11:23     ` srinidhi
2010-07-02 11:47   ` Catalin Marinas
2010-07-02 15:29     ` Thomas Gleixner
2010-07-02 16:10       ` Catalin Marinas
2010-07-02 16:39         ` Thomas Gleixner
2010-07-02 16:51           ` Shilimkar, Santosh
2010-07-02 16:54           ` Catalin Marinas
2010-07-02 17:23             ` Russell King - ARM Linux
2010-07-03  7:01             ` Shilimkar, Santosh
2010-07-04 14:07               ` Catalin Marinas
2010-07-04 15:31                 ` Shilimkar, Santosh
2010-07-04 19:09               ` Russell King - ARM Linux
2010-07-05  9:12                 ` Catalin Marinas
2010-07-02 17:21         ` Russell King - ARM Linux
2010-07-02 16:48       ` Shilimkar, Santosh
2010-07-01 16:14 ` [patch 0/2] ARM: Disable outer cache before kexec call Catalin Marinas
2010-07-01 16:28   ` Thomas Gleixner
2010-07-01 16:35     ` Catalin Marinas
2010-07-01 16:52       ` Thomas Gleixner
2010-07-01 17:14         ` Catalin Marinas
2010-07-02 10:58         ` Tony Lindgren
2010-07-01 16:38     ` Shilimkar, Santosh
2010-07-01 16:41       ` Catalin Marinas
2010-07-01 16:44         ` Shilimkar, Santosh
2010-07-01 17:06       ` Russell King - ARM Linux
2010-07-01 17:21         ` Russell King - ARM Linux
2010-07-01 17:34           ` Catalin Marinas
2010-07-01 17:48             ` Russell King - ARM Linux
2010-07-01 20:08           ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.1007012126440.4507@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox