From patchwork Sat Apr 15 17:01:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 9682311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 05F4460132 for ; Sat, 15 Apr 2017 17:32:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAD7E26E73 for ; Sat, 15 Apr 2017 17:32:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC3FE28449; Sat, 15 Apr 2017 17:32:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 30E8E26E73 for ; Sat, 15 Apr 2017 17:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Subject:To:From :Date:Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: List-Owner; bh=u8sIrIK6CgLVy7JgKvKFFG0FSD+QvHdxgbUUkHtXDfg=; b=aO6g7bh8LQqYW5 GxP2lj2Q7bKbdfANZ/JTp2M6NTMRahvIEQZrqdo+VI+HziRE/4VzZ3tFtFgJDOVf7yIxDRk7D/Cm6 0kkQYga49MeP8cxLId/2pjxy0HvUtdxFHVtuYxG5pUbfGZJaEnACDI4Ar/2IdKyVFqkw+Ihu6wQWB eCB7+Pmq5HB0//GVftGk+yN8KQSxpm3wIMQ5Kk2d9S3LBMusbEtzGD1i2AEH8qepj9Ej6zYvMUFwS u7IRAVrVEV3MLtsFIXlmxCPVtPQAsoSq5frjlXI5H6Uyw28cwMCaGbiaKnq1cqc+ozMuaH4HeQW3c UC/XtW7HdZpNX4QEUHgw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1czRYr-00074u-R8; Sat, 15 Apr 2017 17:32:37 +0000 Received: from galois.linutronix.de ([2a01:7a0:2:106d:700::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1czRYO-0006ap-W1 for linux-arm-kernel@lists.infradead.org; Sat, 15 Apr 2017 17:32:11 +0000 Received: from localhost ([127.0.0.1] helo=[127.0.1.1]) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1czRWQ-00084p-2X; Sat, 15 Apr 2017 19:30:06 +0200 Message-Id: <20170415171652.156858127@linutronix.de> User-Agent: quilt/0.63-1 Date: Sat, 15 Apr 2017 19:01:18 +0200 From: Thomas Gleixner To: LKML Subject: [patch 11/20] ARM/hw_breakpoint: Use cpuhp_setup_state_locked() References: <20170415170107.643253702@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline; filename=ARMhw_breakpoint_Use_cpuhp_setup_state_locked.patch X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170415_103209_205222_7E6C966B X-CRM114-Status: GOOD ( 12.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Peter Zijlstra , Sebastian Siewior , Will Deacon , Russell King , Steven Rostedt , Ingo Molnar , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sebastian Andrzej Siewior arch_hw_breakpoint_init() holds get_online_cpus() while registerring the hotplug callbacks. cpuhp_setup_state() invokes get_online_cpus() as well. This is correct, but prevents the conversion of the hotplug locking to a percpu rwsem. Use cpuhp_setup_state_locked() to avoid the nested call. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Will Deacon Cc: Mark Rutland Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org --- arch/arm/kernel/hw_breakpoint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c @@ -1098,8 +1098,9 @@ static int __init arch_hw_breakpoint_ini * assume that a halting debugger will leave the world in a nice state * for us. */ - ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "arm/hw_breakpoint:online", - dbg_reset_online, NULL); + ret = cpuhp_setup_state_locked(CPUHP_AP_ONLINE_DYN, + "arm/hw_breakpoint:online", + dbg_reset_online, NULL); unregister_undef_hook(&debug_reg_hook); if (WARN_ON(ret < 0) || !cpumask_empty(&debug_err_mask)) { core_num_brps = 0;