From patchwork Tue Sep 14 19:35:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 180282 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8EJZaCC004283 for ; Tue, 14 Sep 2010 19:35:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754860Ab0INTff (ORCPT ); Tue, 14 Sep 2010 15:35:35 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:64879 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754832Ab0INTfe (ORCPT ); Tue, 14 Sep 2010 15:35:34 -0400 Received: from localhost.localdomain (port-92-200-37-189.dynamic.qsc.de [92.200.37.189]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MMpaR-1OvsXj3oxb-008hP6; Tue, 14 Sep 2010 21:35:33 +0200 From: Arnd Bergmann To: arnd@arndb.de Cc: Paul Mundt , linux-sh@vger.kernel.org Subject: [PATCH 09/18] sh: kill big kernel lock Date: Tue, 14 Sep 2010 21:35:00 +0200 Message-Id: <1284492909-7147-10-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1284492909-7147-1-git-send-email-arnd@arndb.de> References: <1284492909-7147-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:h9RtdM+69XpqFfOAzwmODqg5+lFXwvey8iCfc4p6luT ooGZuEzh3ujYFjCMYSPCGqQ4aXM/IgA1yTZJZV2Bxo3IE1eo1b dWfyRMItTaAyCe9tEu7ujkCjd43sFOaPDG1dGsB/BOFM85f+/e JskrJVEFak3ytdypNPXROTwC9OPwY17/Gi6mLkdgDYTmqtJklw SFP9GqtHlWE9U1P+Z+/lQ== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Sep 2010 19:35:36 +0000 (UTC) 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 #include #include -#include +#include #include #include #include @@ -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); }