ARM: 6490/1: MM: bugfix: initialize spinlock for init_mm.context

init_mm used at kernel/sched.c:idle_task_exit() has spin_lock
(init_mm.context.id_lock) that is not initialized when spin_lock/unlock
is called at an ARM machine. Note that mm_struct.context.id_lock is
usually initialized except for the instance of init_mm at
linux/arch/arm/mm/context.c

Not initializing this spinlock incurs "BUG: pinlock bad magic"
warning when spinlock debug is enabled. We have observed such
instances when testing PM in S5PC210 machines.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by MyungJoo Ham and committed by Russell King 28c22d7d 932c42b2

+4
+4
arch/arm/include/asm/mmu.h
··· 13 14 #ifdef CONFIG_CPU_HAS_ASID 15 #define ASID(mm) ((mm)->context.id & 255) 16 #else 17 #define ASID(mm) (0) 18 #endif
··· 13 14 #ifdef CONFIG_CPU_HAS_ASID 15 #define ASID(mm) ((mm)->context.id & 255) 16 + 17 + /* init_mm.context.id_lock should be initialized. */ 18 + #define INIT_MM_CONTEXT(name) \ 19 + .context.id_lock = __SPIN_LOCK_UNLOCKED(name.context.id_lock), 20 #else 21 #define ASID(mm) (0) 22 #endif