Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2752536imu; Thu, 17 Jan 2019 21:46:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN5+sk3ofEQS2zwUhKkeyYgOeUMKycl774erLKha9QN5Y7R0IS+jkkHQA5rDwGTFWsZAq2+x X-Received: by 2002:a17:902:8484:: with SMTP id c4mr17479878plo.59.1547790416558; Thu, 17 Jan 2019 21:46:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547790416; cv=none; d=google.com; s=arc-20160816; b=DPLZ2S7hFwsnLh/tgCUUGWSy6qwQKx84Sye+tA44i411GChbFIliv3OAn7EGvInABo kJkDQGdQROVPTcaET6Prgr6q+2iUb0IWLevKNZSgy55wCRqyZLVZjCm2pwW4x2+4ZObj bSQK5jUsLGii5vorURXb4xIoyrxOF63PYgcO+ylfni+aAMDqoj2E2jFHafrZCx9Eri07 BleZVXZXkMVoRxCP2AARdvucbyXO3b2HVrpjGUCjiWcQ5LevQl5RXMjgIZjIenuuSM7N LIkiVnfxEKvZl7eKhGataOzIsCobIBjjCkXX2jCHhQsQlJQyqdjpH16AI4Ut0vJWREmE VyLw== 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=HALASxq9nLskZBDh7ulGUuv21kVtBYHEVOTW2SZ3epzB/EkxGSp0SWqjylgY6Y816m kb6SCvsPYYLrPzJC/qwkImzBHHp7smNY0yMGyFD+7g/RVZkPN4EaUqQuHPgAvrazWgO+ +ePRmCVuiF0rnBtvOWeTAmyBqeITnzR8v3lsboz2FZUtMsYwzxvdz3u5xDEFZ+voSGV4 VVwlz9cQtYFef/JAageeCGpFwL6SkZGrfRMma0AyqJ/R93/e/1Zb3HKgF8II2Rr3wzq6 QM2s/6ZKsN0dQNtctjMEvfnfPfPj98hsZTVOlcihW/n+it3+9MXyE20k43hp4P8G02JZ Y8bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=SXS6zvSg; 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 j20si3299979pgb.520.2019.01.17.21.46.38; Thu, 17 Jan 2019 21:46:56 -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=SXS6zvSg; 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 S1726955AbfARFoT (ORCPT + 99 others); Fri, 18 Jan 2019 00:44:19 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39686 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbfARFoT (ORCPT ); Fri, 18 Jan 2019 00:44:19 -0500 Received: by mail-pg1-f196.google.com with SMTP id w6so5513598pgl.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=XMQgjiceskNvhiegY799wrWVNxCu5PRpW5/QlEaGBVkGKYqb/e8NlfsmFHNssgxVfP yM2/YT2QiSfP5Lslw+pd0fDy1ln8f3XiY7sEJ8ABDHMNsrwqe11N3qav0OVoFqb1sqf2 epcZECsc+ofVpT/TmCm8h/JNawQ15hOcRtDMJoBz4Shk/ll1yCuG5dzBSR+8CC1X1Pyu 3fqHdIPOlGvs2WYPv0b8URKI6J7CBSVTIeFvNELtHV1TjBNHwqI+b5zi/KToS13omMon +QScQPZ8OIunoPLtQ90OblIEs4zpkJELnB4K1kYiDUC2Ysmq6mD8RedoUi5OqeXfQUep B7Ww== X-Gm-Message-State: AJcUukdNS86KnzHs/E4zY2G8aAZ7HR1QT8WJ7ZsI+Pb8ZRTi+7522rkM t9IQjU/NJhFc4ePjgtpaqpLRO8y2a5kykA== 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 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 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 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