Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp996911imu; Wed, 23 Jan 2019 09:08:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN4/ocbaPBfhZsQumJ7a2FS2ThCfwWQ6dPLfXAeVJmLN8F8BpBnTRkD97QsvPFgBkj9slXWl X-Received: by 2002:a17:902:7005:: with SMTP id y5mr2995559plk.7.1548263328815; Wed, 23 Jan 2019 09:08:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548263328; cv=none; d=google.com; s=arc-20160816; b=pWwj/z0jMl0L4l4WmGBaQ4J9gIMxn2CoIwqVrnY2hEr02cJbGELSBM5ZS90mHurAHO 8iNku12IvfpeLZhl3XnX2MWnha+72egLaCkY3PblewyZhYqkbbuNMuY0V0WDXfDjjkiT eXmEKITSeddsD9QWrGIKQYMliHPBdFQ1MjY0tTTGQBI+4RXfrOrw2S3hupT1tDTGvo2W QcIuVqomv4pAP1CEfFr/ihLNAyRZyE3ukHutD+UdZWUKNP8r+DC0Wr/OU51QFNnaoHY/ 4a/hNPo0XSzOZvVokq1yktq8YhMjbQ1Aj53UH7y332O3BnqI70Aa+USGilWnusygEyV8 AOEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=9kGPd+msbQEtf+/mpliwMm45Bffv6BgyFfK78q4Emdg=; b=qbXxSbpWOKZL0W0g+Cuh4wZEcPMdPH42+kjO4UZSC/NFTsGry2eKdPtRkQ6psKH8Pq z5+FCBZ/Cwb+PVTR4NzOhu/yV7e7S1I1ljDql+YhLWXURCHnmx0/xnhn2Ot00ZGL1KJT ZI5qbGjcjeGSkxxBiTmo88XnDeKG9/IKRpD/7LlQNCQ1Yb01jNIg56I8694bU0DcdZQS 1uQ5Rn7jWWG2kG0kLH4NKor6DimBVK4pfJhUlSpwld2+xXcUrQTS73C6p2zfXihvrKtl 3pOJllnSDYwTJDo+Rw4gWEQxNV0Nb09Yz1Ujx0/ZX3jfdTLgQBLmHPIthro+gl2PnY8q 34qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=NbEBAxuC; 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 l5si18348079plt.5.2019.01.23.09.08.24; Wed, 23 Jan 2019 09:08:48 -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=NbEBAxuC; 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 S1726875AbfAWRFe (ORCPT + 99 others); Wed, 23 Jan 2019 12:05:34 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40464 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbfAWRFd (ORCPT ); Wed, 23 Jan 2019 12:05:33 -0500 Received: by mail-pl1-f193.google.com with SMTP id u18so1469342plq.7 for ; Wed, 23 Jan 2019 09:05:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=9kGPd+msbQEtf+/mpliwMm45Bffv6BgyFfK78q4Emdg=; b=NbEBAxuCGV8mVJp5AnFAZh3b7FGGsVP7v7iApo6vCCWbPhUeWcKfuPdF6fZiHXsgg+ oNBhqfOcfBdakmYvaaKT5HaNqPl9DRyCw4/O9w7SXKm+tdBPdnZ/5/5R++vdh1Ps40mI x929V51TBBMlvN7cM48wWpdnZyf+Tby1qjSBc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=9kGPd+msbQEtf+/mpliwMm45Bffv6BgyFfK78q4Emdg=; b=dbErk8mWtz57ULIvEjx613RLccnnsOTN2zPzRjyxNNRRQv+BGbnN86DiroTtujwt5+ 4Up5D4pVbAHC9PvZrQPJZVLMzz1LhjFKv7S3rVEB5LpAWg/JsRG6dz/RYbhaDxcqadlK dQ+f+64SVkV+UgEfUudgZObgfzoDAnvUBhxHzJrfMsZ4SKEQq5/Qh6XDaiDqDkRAAiM+ R+gvNkbJIrRctkE5fzCTI4cQDg+5ylZM4ew3ULzhIK+pSMwczbrXhil5BmTyNVHqR1ez beHB56aD4uE/P7uLDjZ1nDsrTLg/CO8Z8jUh+JIC6HJofpoM8hL/Oag9LFtRJ438bhD/ 1Xxw== X-Gm-Message-State: AJcUukeTHSeMOo5VfdRwLcnG/FYFlkMlHULmvn8awOaqfuKen6q8UGQF QPFAdi4Os3nLAqkGaYPZxgw4dwWF7Iv84Xs0MklDfe2LntNNLRed4Cj0hB48HXGkH6uicy3ArMV BZ0rkIfXUmafNniFVW/C911bEhE3ye6BvG7srNjb4gu9LPF5Q6biz7vT+3dIsG4IOnOWU52VY1w q9iljj1sDzdvQ= X-Received: by 2002:a17:902:ab84:: with SMTP id f4mr2891888plr.207.1548263132502; Wed, 23 Jan 2019 09:05:32 -0800 (PST) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id c9sm40089382pfc.92.2019.01.23.09.05.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 09:05:31 -0800 (PST) Subject: Re: [PATCH RFC 1/1] arm64: Use PSCI calls for CPU stop when hotplug is supported To: Mark Rutland , Pramod Kumar Cc: 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 References: <1547790380-6276-1-git-send-email-pramod.kumar@broadcom.com> <20190118113242.GA8928@e107155-lin> <20190123164801.GA55887@lakrids.cambridge.arm.com> From: Scott Branden Message-ID: Date: Wed, 23 Jan 2019 09:05:26 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190123164801.GA55887@lakrids.cambridge.arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). > >> 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. 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. But good point - we'll need to ensure interrupts are not disabled for too long. > so there's no guarantee that all of them will be turned off before power > is lost. > > I'm very confused as to what you're trying to achieve here. > > Thanks, > Mark. Regards,  Scott