Subject: [PATCH] kgdb: more barrier in blank weak function

From: Yinghai Lu <[email-masked]>
Date: Fri, 26 Dec 2008 21:06:52 -0800

Impact: fix panic possible panic etc

some compiler seems to inline the weak global function if no line in it

Signed-off-by: Yinghai Lu <[email-masked]>

diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index e4dcfb2..70d2e36 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -223,7 +223,7 @@ int __weak kgdb_skipexception(int exception, struct pt_regs *regs)
 void __weak
 kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
 {
-	return;
+	barrier();
 }
 
 /**
@@ -236,6 +236,7 @@ kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
  */
 void __weak kgdb_disable_hw_debug(struct pt_regs *regs)
 {
+	barrier();
 }
 
 /*