From patchwork Fri Jan 18 05:45:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pramod Kumar X-Patchwork-Id: 10769431 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 9711E1390 for ; Fri, 18 Jan 2019 05:44:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7613629BBD for ; Fri, 18 Jan 2019 05:44:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6853129BE2; Fri, 18 Jan 2019 05:44:30 +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 E10C229BBD for ; Fri, 18 Jan 2019 05:44:29 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=mruYmF2vDquEE3ggEeXFNTjopKlJAENeOdsRXHWaqWI=; b=QtV Sxt1C+jNV4ZcKWpYiOOCEmVtb82l4yMPjhrous3bceokRpXMrd/WZ1gOVLu3B+8OZRz4gkYqZaf7B qnFsI/Wp01H0dS1As/jul1eDDckciv+nhdOJ10RLPPuDIenivUBitlikfSnS9PcDw5hi9QrBW5zG0 ySAi7Tug582icIzWHINb2HXvdPOOP2fQyahFKeMUKXsZh45U8zBF1hgOrdxT2MAZzt0kB+BJF+1da gSBipGCtDxQ0Z0rdfOW57V1InqBzq+/v9LU06ZW9DwjSVrcUsOEg/viePmVE/+1HXmHxiEJp1nRQs yoA5/w1rJ+g3jDdugBg21/F0BrEen7A==; 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 1gkMx6-0004ON-JD; Fri, 18 Jan 2019 05:44:24 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkMx3-0004Ng-Di for linux-arm-kernel@lists.infradead.org; Fri, 18 Jan 2019 05:44:22 +0000 Received: by mail-pf1-x441.google.com with SMTP id r136so6018336pfc.6 for ; Thu, 17 Jan 2019 21:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=1GHCrIH/zhKjvR57yQojViA6vvVSllVOfQJXVhcIPV8=; b=SXS6zvSgz61eGAv+AUSQPQ6wGd+cifI1ReG8IIAjkcfzVHY/3CovtB/8eydebQ4gIt zSmEDiZIqGQpIePtIG19FbT36ChW54ES9DRZYdohs7GSnjD94HVMlmucXef3izKcnWI8 wTzAocoVkZC88/FlTk2jgcE8vDUqnsZenLBoM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1GHCrIH/zhKjvR57yQojViA6vvVSllVOfQJXVhcIPV8=; b=ocKanfG801R19rMxMErHD3nKN1YZUWAuYfP02adUysl9VtkCU/XGaFDVIQ7H5ClCZY MBbvyZ9q7YFn1H992Oea499QePAELhLpXDAgmyIDbMQj+H3Ys77+izpPjEese+jBmUfT xSDKyPLiL70hWkqtG69/qHdDefxrm1FBDkzC95sh9/o4S/uHakUToNlGZ+ofe91GqzFp 88cUjmiVMRcMIu4E0XQyk3aN/3eP8+UmaKTGcE1i2zuIHbo2bBiAQ+Yvcrcx2KgOpduI 4I9GXwn7avFLIxbsXvhfgNVo+KPCBfLB9jLRIJXlOAYbvvzQMcMetTxsOHjv8CVmAHip lAEg== X-Gm-Message-State: AJcUukeiZN0JuT2DoxtzzDD7dIYxfelxINqndUX0VK5RSqZTHYTnchYL eiTpnOKNNUg90xZYbP/8NAd25A== X-Google-Smtp-Source: ALg8bN49T6bfJ1cB6jKb8O0W5gsSDGCPeYkKhTQ8bC3uZz/f6qYeJnrPPuAyBV86a9zR6czQAf8k5Q== X-Received: by 2002:a63:68c4:: with SMTP id d187mr16071423pgc.11.1547790257873; Thu, 17 Jan 2019 21:44:17 -0800 (PST) Received: from pramodku-OptiPlex-7010.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 202sm4537444pfy.87.2019.01.17.21.44.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Jan 2019 21:44:17 -0800 (PST) From: Pramod Kumar To: Catalin Marinas , Will Deacon Subject: [PATCH INTERNAL RFC 1/1] arm64: Use PSCI calls for CPU stop when hotplug is supported Date: Fri, 18 Jan 2019 11:15:00 +0530 Message-Id: <1547790300-6190-1-git-send-email-pramod.kumar@broadcom.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190117_214421_466213_8AE1D970 X-CRM114-Status: GOOD ( 10.73 ) 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: Mark Rutland , Rob Herring , Lorenzo Pieralisi , Suzuki K Poulose , Steve Capper , linux-kernel@vger.kernel.org, Pramod Kumar , BCM Kernel Feedback , Sudeep Holla , Dave Martin , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 If CPU hotplug is supported, ipi_cpu_stop should use PSCI cpudie call to stop the CPU. This call ensures L1/L2 cache flush, CPUs cache-cohenrecy setting w.r.to interconnect. Apart from this, this gives control to f/w to reduce power consumption by take appropriate decesion on power rails for plugging-out core. Signed-off-by: Pramod Kumar Reviewed-by: Ray Jui Reviewed-by: Scott Branden --- arch/arm64/kernel/smp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 1598d6f..360e52b 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -822,8 +822,13 @@ static void ipi_cpu_stop(unsigned int cpu) local_daif_mask(); sdei_mask_local_cpu(); +#ifdef CONFIG_HOTPLUG_CPU + if (cpu_ops[cpu]->cpu_die) + cpu_ops[cpu]->cpu_die(cpu); +#else while (1) cpu_relax(); +#endif } #ifdef CONFIG_KEXEC_CORE