Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5296943yba; Wed, 10 Apr 2019 16:15:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmfevU3cwzfVKhlvcplOR08cythx5pKt2pbnfY7hswPWp3ukpxq/Aw/BYIBI266f1Tef6i X-Received: by 2002:a17:902:2702:: with SMTP id c2mr27798847plb.37.1554938153034; Wed, 10 Apr 2019 16:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554938153; cv=none; d=google.com; s=arc-20160816; b=XFkXi6ESi0yBasFH7wAEhq5m8QokHkOI2EGonVXJ9FBT5Oc7QuJFRkFIdalXLivVFM FeB6pr01M1D8yQIoln2fwiJCj1jfLms2x1+jrAm6H54p5VNn9kR3Xi+iEp+Q0TS0W00v ZiUnJOn+whXB2dMle03F1L6U1ag22qpCggv0y2LNsW53Z5HdAsw7W/mjNA8oobsqmigR Y0HX3y6O/8+C2Bi3YH+pDjfKQkoa0bXgqeYQKzmhi3irW6RJjd7ZO9UD8dLUpSFbJA0S ua+gVRDO0pOSdzPbkVQEFPZ/o/o8kMAdMSGHzFpOFIpYKKzKKoUHbw+GcqIWioGXBrff sFDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sNaP+432rMOAKfpdDBWbe8xpTEc36znVYg15CVLRLNQ=; b=vjZK63de/ItBX3/LbtLY8vYCWNfkuzFe62cqF/lCG77Zfp4ObmtFMJDVgbzC/rmLuV Q+/MYOiW6MyXY+lk+LFcCaezzhC2cLz12YyKAfDK95plvBb19uQjvtipiiQeX8wpM/Gk kEUF/rMvQPT4hRRKLAF7arpzAnrUWHvqSi/alHysh4Iw+HpDTJPcc3xLDxkTPfeNXkzG IE6zwm6gROZQhdQZueU+9v48OQV92OHqY2exAcVEvK5U6q44KlTs/TiB1VokANFOyuhl Cj/iIhocMj7A6uHXHWUm+JoSxsDJOJnNkhGIttF3XL0yvKQsAvUr3sDX9oB1+k2ih3bf OLMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b="lVC/sSd3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p6si33497220pgs.407.2019.04.10.16.15.37; Wed, 10 Apr 2019 16:15:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b="lVC/sSd3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726988AbfDJXN1 (ORCPT + 99 others); Wed, 10 Apr 2019 19:13:27 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:56366 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbfDJXNZ (ORCPT ); Wed, 10 Apr 2019 19:13:25 -0400 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 Cc: linux@armlinux.org.uk, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Agner 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 Content-Transfer-Encoding: 8bit X-Spam: Yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.21.0