From patchwork Wed Apr 10 23:14:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 10894865 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 393ED139A for ; Wed, 10 Apr 2019 23:15:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D68D28B9B for ; Wed, 10 Apr 2019 23:15:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11ACA28BBE; Wed, 10 Apr 2019 23:15:22 +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=ham 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 B4F2F28B9B for ; Wed, 10 Apr 2019 23:15:21 +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:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pY/UlX0MdXbFGxGAw5wugseWvL1uS1NmPwoax4mx2PU=; b=lHhMb2Doq0+cPX H0M+pgDPFiqhJf9PqO4rm8CX13RFczt2juJStwcZ2XpdcygQKq0nHkQL3y8FEGT8nA0FMLaRNIalZ WTYSUYMhhuDYPVzmNPIILSp0Mf8isq+rtfEzNQXlhEb1mqI07PNMOsmu3C03y85KlcBsQhMBHWNKI TZeZJBqZYjwSsbMkn3cRi1Ns5jX0ydKagRPlEpYOYgAi6sYY8n68CBNNdh1kZv1WDSZgsN6NoHNsm liExZRwuNadDS/ggV3NHfE2L0b+B6EfMDZ1cECmVN42Nt3zGHn+FzF0OSel0WZ6uiu+YCQ5KTc/PL kvWnpqFHMXtBOVRE1Y4w==; 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 1hEMR2-0006ur-59; Wed, 10 Apr 2019 23:15:16 +0000 Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEMPI-0003jK-QS for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2019 23:13:34 +0000 Received: from zyt.lan (unknown [IPv6:2a02:169:3465::360]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 7D1EE5C0F1A; Thu, 11 Apr 2019 01:13:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1554938003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=sNaP+432rMOAKfpdDBWbe8xpTEc36znVYg15CVLRLNQ=; b=lVC/sSd3a56Z9ev2QaMhtCgNCro+LOLc3OAFOY+94SsXC9znbF/6h+S/NzqnKIojYMMZ1y 1iJjd8ZtoqvFqpjxffYsrU/SnXRELuPeFbjAVMZEeVN6kqtqtOr0n7K5TeEx/qCUMDtBB/ 7bsWqNPpVorMX03z3Tlt4/h9JzLBvlU= From: Stefan Agner To: shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH] ARM: imx: use generic function to exit coherency Date: Thu, 11 Apr 2019 01:14:12 +0200 Message-Id: <3f58c55e48c28f41e92883e81c675b8478af6a5e.1554937960.git.stefan@agner.ch> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Spam: Yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190410_161329_698547_88433C01 X-CRM114-Status: GOOD ( 11.99 ) 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: linux-kernel@vger.kernel.org, Stefan Agner , linux@armlinux.org.uk, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, 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 The common ARM architecture code provides a generic function to exit coherency called v7_exit_coherency_flush(). Replace the machine specific implementation using the generic function. Tested on a i.MX 6Dual by hotplugging the secondary CPU under load through sysfs several 1000 times. Tested-by: Stefan Agner Signed-off-by: Stefan Agner --- arch/arm/mach-imx/hotplug.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-imx/hotplug.c b/arch/arm/mach-imx/hotplug.c index b35e99cc5e5b..7a74a9b89a49 100644 --- a/arch/arm/mach-imx/hotplug.c +++ b/arch/arm/mach-imx/hotplug.c @@ -12,32 +12,12 @@ #include #include +#include #include #include #include "common.h" -static inline void cpu_enter_lowpower(void) -{ - unsigned int v; - - asm volatile( - "mcr p15, 0, %1, c7, c5, 0\n" - " mcr p15, 0, %1, c7, c10, 4\n" - /* - * Turn off coherency - */ - " mrc p15, 0, %0, c1, c0, 1\n" - " bic %0, %0, %3\n" - " mcr p15, 0, %0, c1, c0, 1\n" - " mrc p15, 0, %0, c1, c0, 0\n" - " bic %0, %0, %2\n" - " mcr p15, 0, %0, c1, c0, 0\n" - : "=&r" (v) - : "r" (0), "Ir" (CR_C), "Ir" (0x40) - : "cc"); -} - /* * platform-specific code to shutdown a CPU * @@ -45,7 +25,7 @@ static inline void cpu_enter_lowpower(void) */ void imx_cpu_die(unsigned int cpu) { - cpu_enter_lowpower(); + v7_exit_coherency_flush(louis); /* * We use the cpu jumping argument register to sync with * imx_cpu_kill() which is running on cpu0 and waiting for