From patchwork Tue Dec 11 21:23:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 10724793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96EF6112E for ; Tue, 11 Dec 2018 21:24:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82AC92ADAE for ; Tue, 11 Dec 2018 21:24:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7502A2B2C8; Tue, 11 Dec 2018 21:24:08 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 25DDB2ADAE for ; Tue, 11 Dec 2018 21:24:07 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x4YaLEt6b11oBJDQ3WWAYpBIJ8aDjZ4hoGbdZqJG1N0=; b=DVmoxBThUgPdqJ Hh44/wK9ESiGf4GCkjwMJzFL9AfFGk67fTeNBv7zTrp/823Ga7yjrWLafqR4BZuXYN5nlfibrjYrN 02AnlHt/pKyZjuGKtBzDq/WMTg8awHbbK21W+Txz87DQ4m/At/yomO/KZubKMRVfd/lRWPCt7T40u /IRhNtv/gTspVB+G4iq/SzP9+JQgjDkTP8Ud/uJGFzxfP30W3j86wcwsGvgeCERwK+Zx60tOgPvkM bwD/FWDfz2h6RhV4AJQkqcqhwhkYsgqpfyUCfGn90l419okpUSGVdh6ziU2ktC5N+0kgqapSFLHgl +XtzALNibPwysyjTlalw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWpVa-0008UC-KK; Tue, 11 Dec 2018 21:24:02 +0000 Received: from galois.linutronix.de ([2a01:7a0:2:106d:700::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWpVW-0008Ta-Sa for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 21:24:00 +0000 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1gWpUw-00084d-Lk; Tue, 11 Dec 2018 22:23:22 +0100 Date: Tue, 11 Dec 2018 22:23:22 +0100 From: Sebastian Andrzej Siewior To: Linus Walleij Subject: [PATCH 1/3 v2] arm: versatile: Convert boot_lock to raw Message-ID: <20181211212322.co4ljpolo4bvgxe3@linutronix.de> References: <20181207102749.15205-1-bigeasy@linutronix.de> <20181207102749.15205-2-bigeasy@linutronix.de> <20181207130012.GX6920@n2100.armlinux.org.uk> <20181209004138.GC9507@n2100.armlinux.org.uk> <20181210143718.plwd36vdxxd7q2el@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_132359_069188_74470DB2 X-CRM114-Status: GOOD ( 14.85 ) 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: ext Tony Lindgren , viresh kumar , David Brown , Xu Wei , Manivannan Sadhasivam , linux-samsung-soc , Viresh Kumar , Russell King , Krzysztof Kozlowski , Maxime Ripard , Chen-Yu Tsai , Kukjin Kim , Andy Gross , Arnd Bergmann , linux-arm-msm@vger.kernel.org, Thomas Gleixner , Linux-OMAP , Linux ARM , Barry Song , Frank Rowand , Patrice CHOTARD , shiraz hashim , Andreas =?utf-8?q?F=C3=A4rbe?= =?utf-8?q?r?= 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 The arm boot_lock is used by the secondary processor startup code. The locking task is the idle thread, which has idle->sched_class == &idle_sched_class. idle_sched_class->enqueue_task == NULL, so if the idle task blocks on the lock, the attempt to wake it when the lock becomes available will fail: try_to_wake_up() ... activate_task() enqueue_task() p->sched_class->enqueue_task(rq, p, flags) Fix by converting boot_lock to a raw spin lock. Cc: Russell King Cc: Linus Walleij Signed-off-by: Frank Rowand Link: http://lkml.kernel.org/r/4E77B952.3010606@am.sony.com Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- arch/arm/plat-versatile/platsmp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/plat-versatile/platsmp.c b/arch/arm/plat-versatile/platsmp.c index c2366510187a8..6b60f582b738c 100644 --- a/arch/arm/plat-versatile/platsmp.c +++ b/arch/arm/plat-versatile/platsmp.c @@ -32,7 +32,7 @@ static void write_pen_release(int val) sync_cache_w(&pen_release); } -static DEFINE_SPINLOCK(boot_lock); +static DEFINE_RAW_SPINLOCK(boot_lock); void versatile_secondary_init(unsigned int cpu) { @@ -45,8 +45,8 @@ void versatile_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ - spin_lock(&boot_lock); - spin_unlock(&boot_lock); + raw_spin_lock(&boot_lock); + raw_spin_unlock(&boot_lock); } int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) @@ -57,7 +57,7 @@ int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) * Set synchronisation state between this boot processor * and the secondary one */ - spin_lock(&boot_lock); + raw_spin_lock(&boot_lock); /* * This is really belt and braces; we hold unintended secondary @@ -87,7 +87,7 @@ int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ - spin_unlock(&boot_lock); + raw_spin_unlock(&boot_lock); return pen_release != -1 ? -ENOSYS : 0; }