All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: MM: bugfix: initialize spinlock for init_mm.context
@ 2010-09-17  4:54 MyungJoo Ham
  2010-09-17  8:45 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: MyungJoo Ham @ 2010-09-17  4:54 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 arch/arm/include/asm/mmu.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index 68870c7..c18540b 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -13,6 +13,10 @@ typedef struct {
 
 #ifdef CONFIG_CPU_HAS_ASID
 #define ASID(mm)	((mm)->context.id & 255)
+
+/* init_mm.context.id_lock should be initialized. */
+#define INIT_MM_CONTEXT(name)                                                 \
+	.context.id_lock    = __SPIN_LOCK_UNLOCKED(name.context.list_lock),
 #else
 #define ASID(mm)	(0)
 #endif
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] ARM: MM: bugfix: initialize spinlock for init_mm.context
  2010-09-17  4:54 [PATCH] ARM: MM: bugfix: initialize spinlock for init_mm.context MyungJoo Ham
@ 2010-09-17  8:45 ` Catalin Marinas
  0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2010-09-17  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2010-09-17 at 13:54 +0900, MyungJoo Ham wrote:
> 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>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-17  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-17  4:54 [PATCH] ARM: MM: bugfix: initialize spinlock for init_mm.context MyungJoo Ham
2010-09-17  8:45 ` Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.