Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1028891imu; Wed, 23 Jan 2019 09:37:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN6kHEP4YbhOYnk2v/RmEoOFp/aWgU6S79GGWmajp8RISwWlB5KhwkDroXS1VS9B4CxEyAVT X-Received: by 2002:a62:ca05:: with SMTP id n5mr2844861pfg.154.1548265043240; Wed, 23 Jan 2019 09:37:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548265043; cv=none; d=google.com; s=arc-20160816; b=FM3kwOC7kLoExBRGUPY8cOEQHW/YaHR/GgVFVMpTYI0sb6FXXwdDiX/YQ7YDao6+6c fi68EnoI63RNliwc/qEfjRrTz3/fvtBhFmtPJJsqnyer5fjrI6q3inwtBAOmWhJokCmF 6BLADkb0O9THQMnR2ydfTXgiIXohsngBoXWDYVWDjKB80RbtiLi4c9rNLHxZBdE2hZAS RRNblxG3NYLOi5ZDFgjW6rvVE8rR9+BcG/3gau9uH7GjP6WXB+Gk69C5Y2FU1RnP0kL8 JrOzVHwblfokqZY+xAg/Piw+K2Dbv8w6N6mIC9x5oKKIULJkQSSKm3DOHhl2/HfSCxeb lVRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=6g2DJLKaGuoEpF+/s++VNprbIbxqpzeweBIioHdC3ZM=; b=z/uF+SgfdBj59Gp74TDUo1iSrZRnpDT9TgHhdIm56G+ztwKlmSbl2LoF9lEsDCF/j2 hvzxaSw5Yy/cS9q0lSxjmj6GGKKZs31gGrDcdWv65wODvt8qyKI8xWNMxsGd5EOr6hXJ usg7ICW6AgLkrAtZpyT9kOEgrpxHN2NbQBTaaUIMxx19TZUV0BPAR597ygxe/yvQAHGL ONpN6pfMa+E67tqLyWBkLoBIZjtgkBJd+aK8bZ5PsG4J7bhM4C5EerRTeInTA8WkmCwK nZkbMTzwdaav3jlJpKMuzmAKSaw+E0Llb01hycreO1kVjUCq6oMROsOZ5gthNcKXxHNb PODQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x23si13597574pgj.247.2019.01.23.09.36.47; Wed, 23 Jan 2019 09:37:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726267AbfAWRdt (ORCPT + 99 others); Wed, 23 Jan 2019 12:33:49 -0500 Received: from foss.arm.com ([217.140.101.70]:44998 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbfAWRdt (ORCPT ); Wed, 23 Jan 2019 12:33:49 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AB296EBD; Wed, 23 Jan 2019 09:33:48 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 71C663F5C1; Wed, 23 Jan 2019 09:33:46 -0800 (PST) Date: Wed, 23 Jan 2019 17:33:44 +0000 From: Mark Rutland To: Scott Branden Cc: Pramod Kumar , Sudeep Holla , Catalin Marinas , Will Deacon , Suzuki K Poulose , Dave Martin , Rob Herring , Lorenzo Pieralisi , Steve Capper , BCM Kernel Feedback , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 1/1] arm64: Use PSCI calls for CPU stop when hotplug is supported Message-ID: <20190123173343.GC55887@lakrids.cambridge.arm.com> References: <1547790380-6276-1-git-send-email-pramod.kumar@broadcom.com> <20190118113242.GA8928@e107155-lin> <20190123164801.GA55887@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 23, 2019 at 09:05:26AM -0800, Scott Branden wrote: > Hi Mark, > > Hopefully I can shed some light on the use case inline. > > On 2019-01-23 8:48 a.m., Mark Rutland wrote: > > On Mon, Jan 21, 2019 at 11:30:02AM +0530, Pramod Kumar wrote: > > > On Mon, Jan 21, 2019 at 11:28 AM Pramod Kumar > > > wrote: > > > > > > 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. > > In this example is Linux running on the server, or on the accelerator? > Accelerator > > > > What precisely are you trying to back up from DDR, and why? > Data in DDR is being written to disk at this time (disk is connected to > accelerator) > > > > What is responsible for backing up that contents? > > A low power M-class processor and DMA engine which continues necessary > operations to transfer DDR memory to disk. > > The high power processors on the accelerator running linux needed to be > halted ASAP on this power loss event and M0 take over. Graceful shutdown of > linux and other peripherals is unnecessary (and we don't have the power > necessary to do so). If graceful shutdown of Linux is not required (and is in fact undesireable), why is Linux involved at all in this shutdown process? For example, why is this not a secure interrupt taken to EL3, which can (gracefully) shut down the CPUs regardless? > > > 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 > > > which ultimately switch to ATF to flush out all the CPUs caches and comes > > > out of coherency domain so that its power rails could be switched-off. > > If you're stopping CPUs from completely arbitrary states, what is the > > benefit of saving the RAM contents? > > Some of the RAM contains data that was in the process of being written to > disk by the accelerator. Ok, so this isn't actually about backing up RAM contents; it's about completing pending I/O. I'm still confused as to how that works. How do you avoid leaving the disk in some corrupt state if data runs out partway through? > This data must be saved to disk and the high power CPUs consume too much > power to continue performing this operation. > > > CPUs might be running with IRQs disabled for an arbitrarily long time, > > In an embedded linux system we control everything running. Sure, and that complete control allows you to do something better than this RFC, AFAICT. Thanks, Mark.