From patchwork Mon Jun 29 17:52:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Andrianov X-Patchwork-Id: 6690711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1D26E9F1C1 for ; Mon, 29 Jun 2015 17:50:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50D63201EC for ; Mon, 29 Jun 2015 17:50:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E00C201F2 for ; Mon, 29 Jun 2015 17:50:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9dAz-0004WI-JX; Mon, 29 Jun 2015 17:49:01 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9dAu-0004PV-Sh for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2015 17:48:57 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t5THmDkV001779; Mon, 29 Jun 2015 12:48:13 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5THmD0h023901; Mon, 29 Jun 2015 12:48:13 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Mon, 29 Jun 2015 12:48:10 -0500 Received: from uda0794637.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5THm3AS027874; Mon, 29 Jun 2015 12:48:05 -0500 From: Vitaly Andrianov To: , , , , , , Subject: [PATCH] keystone: adds cpu_die implementation Date: Mon, 29 Jun 2015 13:52:32 -0400 Message-ID: <1435600352-32733-1-git-send-email-vitalya@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150629_104857_071402_FBA4BD73 X-CRM114-Status: GOOD ( 10.37 ) X-Spam-Score: -7.5 (-------) Cc: Vitaly Andrianov X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit add cpu_die implementation Signed-off-by: Vitaly Andrianov --- The discussion of the "keystone: psci: adds cpu_die implementation" commit shows that if PCSI is enabled platform code doesn't need that implementation at all. Having PSCI commands in DTB should be sufficient. Unfortunately Keystone with LPAE enable requires some additional development. To support HOTPLUG_CPU w/o PSCI we need platform implementation of the cpu_die(), which is added by this patch. arch/arm/mach-keystone/keystone.h | 1 + arch/arm/mach-keystone/platsmp.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/arch/arm/mach-keystone/keystone.h b/arch/arm/mach-keystone/keystone.h index cd04a1c..93549cf 100644 --- a/arch/arm/mach-keystone/keystone.h +++ b/arch/arm/mach-keystone/keystone.h @@ -12,6 +12,7 @@ #define __KEYSTONE_H__ #define KEYSTONE_MON_CPU_UP_IDX 0x00 +#define KEYSTONE_MON_CPU_DIE_IDX 0x84000002 #ifndef __ASSEMBLER__ diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c index 5f46a7c..4e5bdde 100644 --- a/arch/arm/mach-keystone/platsmp.c +++ b/arch/arm/mach-keystone/platsmp.c @@ -51,7 +51,31 @@ static inline void __cpuinit keystone_smp_secondary_initmem(unsigned int cpu) {} #endif + +#ifdef CONFIG_HOTPLUG_CPU +static void keystone_cpu_die(unsigned int cpu) +{ + int error; + + pr_debug("keystone-smp: cpu_die %d\n", cpu); + + error = keystone_cpu_smc(KEYSTONE_MON_CPU_DIE_IDX, cpu, 0); + if (error) + pr_err("CPU %d die failed with %d\n", cpu, error); + + /* + * we shouldn't come here. But in case something went + * wrong the code below prevents kernel from crush + */ + while (1) + cpu_do_idle(); +} +#endif + struct smp_operations keystone_smp_ops __initdata = { .smp_boot_secondary = keystone_smp_boot_secondary, .smp_secondary_init = keystone_smp_secondary_initmem, +#ifdef CONFIG_HOTPLUG_CPU + .cpu_die = keystone_cpu_die, +#endif };