From patchwork Thu Jun 25 14:02:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Andrianov X-Patchwork-Id: 6675371 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A178FC05AC for ; Thu, 25 Jun 2015 14:01:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26FAA206D4 for ; Thu, 25 Jun 2015 14:01:17 +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 8E4CC205DE for ; Thu, 25 Jun 2015 14:01:13 +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 1Z87g9-0001SO-U7; Thu, 25 Jun 2015 13:58:57 +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 1Z87g7-0001Pl-46 for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2015 13:58:56 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t5PDwI7c024504; Thu, 25 Jun 2015 08:58:18 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5PDwIIn009259; Thu, 25 Jun 2015 08:58:18 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Thu, 25 Jun 2015 08:58:18 -0500 Received: from uda0794637.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5PDwIEN019359; Thu, 25 Jun 2015 08:58:18 -0500 From: Vitaly Andrianov To: , , , Subject: [PATCH] keystone: psci: adds cpu_die implementation Date: Thu, 25 Jun 2015 10:02:50 -0400 Message-ID: <1435240970-30869-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-20150625_065855_317642_028327AF X-CRM114-Status: GOOD ( 10.22 ) X-Spam-Score: -8.3 (--------) 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=-5.6 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 using psci api Signed-off-by: Vitaly Andrianov --- arch/arm/mach-keystone/platsmp.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c index 5f46a7c..2c40cc0 100644 --- a/arch/arm/mach-keystone/platsmp.c +++ b/arch/arm/mach-keystone/platsmp.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "keystone.h" @@ -51,7 +52,38 @@ static inline void __cpuinit keystone_smp_secondary_initmem(unsigned int cpu) {} #endif + +#ifdef CONFIG_HOTPLUG_CPU +static void keystone_cpu_die(unsigned int cpu) +{ +#ifdef CONFIG_ARM_PSCI + struct psci_power_state pwr_state = {0, 0, 0}; + + pr_info("keystone_cpu_die(%d) from %d using PSCI\n", cpu, + smp_processor_id()); + + if (psci_ops.cpu_off) + psci_ops.cpu_off(pwr_state); +#else + /* + * We may want to add here a direct smc call to monitor + * if the kernel doesn't support PSCI API + */ +#endif + + /* + * 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 };