Subject: [PATCH] jump-label: initialize jump-label subsystem somewhat later

From: David Daney <[email-masked]>
Date: Wed, 14 Dec 2011 08:48:35 -0800

From: David Daney <[email-masked]>

commit 97ce2c88f9ad42e3c60a9beb9fca87abf3639faa breaks MIPS.

The jump-lable initialization does I-Cache flushing after modifying
code.  On MIPS this is done by calling through the function pointer
flush_icache_range().  This function pointer is initialized mm_init().

As things stand, we cannot be calling jump_label_init() until after
mm_init() completes, so we move the call down to satisfy this
constraint.

Signed-off-by: David Daney <[email-masked]>
---
 init/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/init/main.c b/init/main.c
index 217ed23..8c6a155 100644
--- a/init/main.c
+++ b/init/main.c
@@ -513,8 +513,6 @@ asmlinkage void __init start_kernel(void)
 		   __stop___param - __start___param,
 		   &unknown_bootoption);
 
-	jump_label_init();
-
 	/*
 	 * These use large bootmem allocations and must precede
 	 * kmem_cache_init()
@@ -526,6 +524,8 @@ asmlinkage void __init start_kernel(void)
 	trap_init();
 	mm_init();
 
+	jump_label_init();
+
 	/*
 	 * Set up the scheduler prior starting any interrupts (such as the
 	 * timer interrupt). Full topology setup happens at smp_init()
-- 
1.7.2.3

---

From: Peter Zijlstra <[email-masked]>
Date: Wed, 14 Dec 2011 17:51:10 +0100

> mm_init() completes, so we move the call down to satisfy this

I'm fine as long as it stays before sched_init(), which it does. Jeremy
is this still early enough for you?

---

From: David Daney <[email-masked]>
Date: Wed, 14 Dec 2011 09:17:05 -0800

On 12/14/2011 08:51 AM, Peter Zijlstra wrote:
>> From: David Daney<[email-masked]>
>>

Actually I misspoke, for MIPS we need jump_label_init() after 
trap_init(), not mm_init().

> is this still early enough for you?

Just tested a revised patch that moves it to between trap_init() and 
mm_init(), I propose that we do that instead.

New patch in a couple of minutes.

David Daney

---

From: Sergei Shtylyov <[email-masked]>
Date: Wed, 14 Dec 2011 21:31:49 +0300

Hello.

> commit 97ce2c88f9ad42e3c60a9beb9fca87abf3639faa breaks MIPS.

    Please also specify that commit's summary (in parens).

> The jump-lable initialization does I-Cache flushing after modifying

    Label.

> flush_icache_range().  This function pointer is initialized mm_init().

    "By" missing?

> Signed-off-by: David Daney<[email-masked]>

WBR, Sergei