Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2753434imu; Thu, 17 Jan 2019 21:48:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN67pEPEVl38Xp15rspbRGp5jMXbCUI6Rminh++9o2+lk612pnOdWQj6Zd0qbmYN49EmwcbK X-Received: by 2002:a63:2e88:: with SMTP id u130mr16547608pgu.9.1547790504605; Thu, 17 Jan 2019 21:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547790504; cv=none; d=google.com; s=arc-20160816; b=BCx+qXmsw6RDA+lOT/E0JabgPBM0DsZrbmpc+DIDuTGKUEShRxI5qyXriEcumL6C5W xF/dAGof5pbP1GoerBlRFad1r8U7yX1t3s2qDAXiTdmkEy+bXmttJm5/v6WRmAemoddj W4+FE2Nyp9dl84zDDPej+nrcO3DGV6PYor1OY1cFT+YcbehgJKCisJfAVzx5MCatOl1t 9yD4DuPyg+4gaGfYaqZU7W0lyMLAhXRQehOvxwIFBXMhfFyyrDyoqXF2Eb53i1pDG9fp 3qSu+RoMwO/FAZpn2VxReEZ2ogWTHe9eGV/zxpon/anuM8qz9EuO3LwO3D+Xmno+qF5d fVYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=1GHCrIH/zhKjvR57yQojViA6vvVSllVOfQJXVhcIPV8=; b=vFUkyawKfYUyksJqeEo0OJjGCyO6G4DCiMTO2V+KrfuHLxwEsqsY39TLgAO3diljiO eR6KOZRyFNAAFuLsjQosf6t676nXmGlmvhPvbG6Tod3KkKQ/aECYk3qcflqDKCmWmQ5V lXrFSyrTBnS2b00NoOsgLAc+r3DL0S0sKnVUZOYiV6gZvwVBwND+XaYh+2S1GPQq6FHB b0ug8vL2vFRZtYPp/1SWjSeHAor7NYsreW/U9LBR0M89mxUREPavB2EEGlPBevyTXgYV q12vXm2jFfKohhswFd5VzboYS332BiTK3W0BaI5nga0iPt+d2Tl7gDNlSnyyvwfTTyxi MKGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Lqot3MN3; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si3850272plg.390.2019.01.17.21.48.08; Thu, 17 Jan 2019 21:48:24 -0800 (PST) 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=@broadcom.com header.s=google header.b=Lqot3MN3; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727132AbfARFpe (ORCPT + 99 others); Fri, 18 Jan 2019 00:45:34 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34209 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726962AbfARFpe (ORCPT ); Fri, 18 Jan 2019 00:45:34 -0500 Received: by mail-pl1-f194.google.com with SMTP id w4so5857698plz.1 for ; Thu, 17 Jan 2019 21:45:34 -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=Lqot3MN3q/rP4POvMC+G9EZaYGDfxuBoX+U8QsEsosKnYg7V2G5vgPMewV1LuxoaWM 5I+GuZidL0D3+YAYzdtfP7zZWCRfRprwQRk9mtmuhiXW9WpEF7rlrpCg1puvAxHjbPDz pLlMMlKTjZzaMPRCLvBiCERwMhZ2H6hFWarxQ= 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=IY2BqibJL1ktxMPGr+Odl6kbqdIJZzEPnv2TvwZoPaasMCqD2JJguLW36nLOHR/H8y AjgeIv/wB0YkuKfcocJ1j0ucoZchTAsse5MMwA0rS0YubYfMqOZmuIZmy/2hYJzGoO9B UoCKSKTSom0DsydH/ke439ObB9gGAeKTpHs4ZHguymbkZjkpeK67maD2FPV6J7uHUlsl KBZ/xrQw7NI1HQdesWUqHjB1OAmzC9zVL/hWrcVCX7Ge5CagTDYB6lEIyIzHZjdWJi+y MMkz/02wXrG0oCgxW+EM6KPsgZmelp6rPQpPajELfhX3vYpsuqNDNyffqTPvDoUdfajg S6Pw== X-Gm-Message-State: AJcUukdtvw3L+rwyF3/wAs5+xCUKANrLnSpYZ0q7ehfVqYYTn+L9B+8o BKq8Vxyx47MzGZuJp0i3UJysxQ== X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr18011684plo.316.1547790333630; Thu, 17 Jan 2019 21:45:33 -0800 (PST) Received: from pramodku-OptiPlex-7010.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id l5sm476264pfi.56.2019.01.17.21.45.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Jan 2019 21:45:33 -0800 (PST) From: Pramod Kumar To: Catalin Marinas , Will Deacon Cc: Suzuki K Poulose , Sudeep Holla , Dave Martin , Mark Rutland , Rob Herring , Lorenzo Pieralisi , Steve Capper , BCM Kernel Feedback , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Pramod Kumar Subject: [PATCH RFC 1/1] arm64: Use PSCI calls for CPU stop when hotplug is supported Date: Fri, 18 Jan 2019 11:16:20 +0530 Message-Id: <1547790380-6276-1-git-send-email-pramod.kumar@broadcom.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 1.9.1