* [PATCH 09/18] sh: kill big kernel lock
@ 2010-09-14 19:35 Arnd Bergmann
2010-09-16 8:20 ` Paul Mundt
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2010-09-14 19:35 UTC (permalink / raw)
To: linux-sh
The only BKL user in arch/sh protects a single bit,
so we can trivially replace it with test_and_set_bit.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
---
arch/sh/kernel/ptrace_64.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index 5fd644d..178b6b0 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -20,7 +20,7 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
-#include <linux/smp_lock.h>
+#include <linux/bitops.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/user.h>
@@ -395,10 +395,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
asmlinkage int sh64_ptrace(long request, long pid, long addr, long data)
{
#define WPC_DBRMODE 0x0d104008
- static int first_call = 1;
+ static unsigned long first_call;
- lock_kernel();
- if (first_call) {
+ if (!test_and_set_bit(0, &first_call)) {
/* Set WPC.DBRMODE to 0. This makes all debug events get
* delivered through RESVEC, i.e. into the handlers in entry.S.
* (If the kernel was downloaded using a remote gdb, WPC.DBRMODE
@@ -408,9 +407,7 @@ asmlinkage int sh64_ptrace(long request, long pid, long addr, long data)
* the remote gdb.) */
printk("DBRMODE set to 0 to permit native debugging\n");
poke_real_address_q(WPC_DBRMODE, 0);
- first_call = 0;
}
- unlock_kernel();
return sys_ptrace(request, pid, addr, data);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 09/18] sh: kill big kernel lock
2010-09-14 19:35 [PATCH 09/18] sh: kill big kernel lock Arnd Bergmann
@ 2010-09-16 8:20 ` Paul Mundt
0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2010-09-16 8:20 UTC (permalink / raw)
To: linux-sh
On Tue, Sep 14, 2010 at 09:35:00PM +0200, Arnd Bergmann wrote:
> The only BKL user in arch/sh protects a single bit,
> so we can trivially replace it with test_and_set_bit.
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-16 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-14 19:35 [PATCH 09/18] sh: kill big kernel lock Arnd Bergmann
2010-09-16 8:20 ` Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).