Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp362739imu; Tue, 22 Jan 2019 20:52:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN6hdEKm+hjdeW9HGoqyoVRKRDk2KAPpIxQWvgpFMUQcfs6d+aKf6kqaAHbaU+4Mj9N1Wfmk X-Received: by 2002:a17:902:8a95:: with SMTP id p21mr789634plo.183.1548219167530; Tue, 22 Jan 2019 20:52:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548219167; cv=none; d=google.com; s=arc-20160816; b=dWexmXYAWQAnwPe8KWnfKzV1GOZF4JxvYhrG8TYBhhy5HZrJYOcidI0H7RuLxf6un6 6aR/CJPMPOxFFVaL3VfqRFI6kOduuGzAoZussTF3ZlfK/CrSj8R6CUEFC+WXzZMZsv6e MYHOf0Spru0wUlEnYB0cju+AX4AzJiKtZhDmAPQEKbxHIpcT8YhNNNdRpPkAQrFM2g/h RGftGC2GjJOSiZ6JSh0SiP4XozcJWJz0A7ERJlGADiCd74l5uxuJ1uccNg2YAOZLRic9 LadjypzOpD5daeIenIq9xPKBGwpOHB3MYMnXr2fKhYsynJ//inP+WYpyTnPhBYKus+dR 0SkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=h7AFpoW1OJISLjtuUgEaf+hEQBevXpMX4q7t19fZ9Wg=; b=JFoox4L7tkGili6ff75ngKCe5YcUyy+TMgAPyP44DkW2fBEtqrqn8wL/P73Tv8FrJI KMBtRfiQUHjXAywISMwY8LzrnJPDMHcoJYvkSfPMlL7vPlBCDLvoZQpr/IDry1edoq1k ZYimRrf4C30Xhmcr6Wl2MTervGDNB1TvFzP652dgzpYKfPf88yVPxRmT3CEs8sRgWKyf qzm2ElvEXV4pgxp8lh7eILt3EuZNtfNeku096okd0E7/fUE0mV1jGqezB4W9lUztPyc0 NG4LfDRi4q6K2b8cSAWn8O4IqZ/3uFligYGcmBhB2rI/pjdHdb/3UrRMRmujk1A22JPO SzNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=USJlPe1w; 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 s84si19516217pgs.306.2019.01.22.20.52.31; Tue, 22 Jan 2019 20:52:47 -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=USJlPe1w; 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 S1726039AbfAWEvR (ORCPT + 99 others); Tue, 22 Jan 2019 23:51:17 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:39382 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbfAWEvR (ORCPT ); Tue, 22 Jan 2019 23:51:17 -0500 Received: by mail-ot1-f68.google.com with SMTP id n8so825956otl.6 for ; Tue, 22 Jan 2019 20:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h7AFpoW1OJISLjtuUgEaf+hEQBevXpMX4q7t19fZ9Wg=; b=USJlPe1wxD1C6SXpCm93y8NpbgWM07sGNXpWuJjtSnGbPsJ+wYZp3dC/a+kfvpFtUi NmkBrNZoABfM+unuOFIZUfiP3KZJZRFEYzPJ3hopBK1rdosSjIm8HxfElpsI4F9qzH1z bZRQ8MBMmcV3SY2Ab6S/Vn5gqN+8M7PL1wMpY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h7AFpoW1OJISLjtuUgEaf+hEQBevXpMX4q7t19fZ9Wg=; b=kuOIGL76nOoSr5Fj0vA3L4F40XedcCKwbPS98Lk2k238t8w6k9FTjNSqOBdi5toZpV OY68yO1zeuB+3fRA4gk5jKoSYSQQ5Gy9RIGIXWlKL8FlGSoLPStHgFNauc4fg3hkrbta +RrHxLvK6xhevdVovaglHrx+jHap22llqmm9MMFqI0pm0yd0BuU5WRktXZfnkFxHdP1i Xx49nFNiD6dSIbab8E61i1wHY4ooDvMpSwKHfi0KpWeRABxCtCihbtts75Idt0dkRugw qNeaqdyxGz4980HqNHJLqK8xcP+n2/eXfbVBNxa1XtWrKM524ZmC5DUo4JjM7//Fdoe/ b2wA== X-Gm-Message-State: AJcUukf1EBDbGH7+S1NX1/WHuK5yqCLqnioZjt2E/waB6Vy6+J2isnVA zGqfrEZJEVADFlcCS5BKHVChL2b6EaKC4WytLJ1MLQ== X-Received: by 2002:a9d:4:: with SMTP id 4mr519114ota.174.1548219076241; Tue, 22 Jan 2019 20:51:16 -0800 (PST) MIME-Version: 1.0 References: <1547790380-6276-1-git-send-email-pramod.kumar@broadcom.com> <20190118113242.GA8928@e107155-lin> <20190121112248.GA27784@e107155-lin> In-Reply-To: <20190121112248.GA27784@e107155-lin> From: Pramod Kumar Date: Wed, 23 Jan 2019 10:21:05 +0530 Message-ID: Subject: Re: [PATCH RFC 1/1] arm64: Use PSCI calls for CPU stop when hotplug is supported To: Sudeep Holla Cc: Catalin Marinas , Will Deacon , Suzuki K Poulose , Dave Martin , Mark Rutland , Rob Herring , Lorenzo Pieralisi , Steve Capper , BCM Kernel Feedback , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Sudeep for reviewing. Please see my comment inline below. On Mon, Jan 21, 2019 at 4:52 PM Sudeep Holla wrote: > > On Mon, Jan 21, 2019 at 11:28:27AM +0530, Pramod Kumar wrote: > > On Fri, Jan 18, 2019 at 5:02 PM Sudeep Holla wrote: > > > On Fri, Jan 18, 2019 at 11:16:20AM +0530, Pramod Kumar wrote: > > > > 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. > > > > > > Firstly, this is not specific to PSCI and I don't see any PSCI calls as > > > $subject claims. > > > > I had seen all the other cpu ops methods where only PSCI supports only > > cpu_die features hence used PSCI reference in my subject line to be more > > clear where this die gets converted in last. > > > > OK, but since you are not directly dealing with PSCI APIs, it's misleading. > I can re-phrase my commit message which links explanation to PSCI. > > > Next, you fail to explain why do you have to ensure > > > caches are cleaned and why do you need that in ipi_cpu_stop ? > > > What's the use case ? > > > > > Need comes from a specific use case where one Accelerator card(SoC) is > > plugged in a sever over a PCIe interface. This Card gets supply from a > > battery, which could provide very less power for a very small time, in case > > of any power loss. Once Card switches to battery, this has to reduce its > > power consumption to its lowest point and back-up the DDR contents asap > > before battery gets fully drained off. > > > > OK, but I was expecting the complete call path for this use-case. OK. Once power loss happens, Application processor gets interrupt and it has to switch to MCU asap so that it can switch-off all irrelevant power domain to reduce battery drain. flow is like this- Power loss interrupt --> interrupt handler -> send IPI to stop all secondary CPUs-> switch primary CPU to ATF which ultimately transition to MCU where all power off action is taken. > > > Since battery can provide limited power for a very short time hence need to > > transition to lowest power. As per the transition process , CPUs power > > domain has to be off but before that it needs to flush out its content to > > system memory(L3) so that content could be backed-up by a MCU, a controller > > consuming very less power. Since we can not afford plugging-out every > > individual CPUs in sequence hence uses ipi_cpu_stop for all other CPUs > > So, you are randomly using ipi_cpu_stop for something it's not supposed to > be used. What do you exactly want to achieve in that context where you need > to save power ? Need to back-up DDR from MCU which will require L1/L2 content gets flushed before CPUs getting shutdown. >Why system off or reset not sufficient ? System off or reset is not sufficient as we can not afford that much delay in transition. Flushing L1/L2 contents to System memory and Bringing out CPUs Clusters out of coherency domain before shutting down Clusters puts rest of system in sane state. If cluster are not being taken out properly from coherency domain before shutting down, it could lead system un-reliable for rest parts. > -- > Regards, > Sudeep >