Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2987869ybt; Mon, 29 Jun 2020 12:12:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD3FXNkYUrp/8qXNq+x2T0FdHIkGWQdcr4xBC6K/ALXgotK3FoWfPHgO44VjEPW0ziEWUu X-Received: by 2002:a17:907:20ba:: with SMTP id pw26mr14909831ejb.425.1593457948094; Mon, 29 Jun 2020 12:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593457948; cv=none; d=google.com; s=arc-20160816; b=IYApI1em6q5oAKbEqbrhWS6Ari9VYanpFfIHvRfTbxLHJHLlbYQPEQ5J1RrhlHntgT v3vTUWgUV6vm797XkQsvnbRQs4IvORAleLvV6CULZl6SbUWuDSRtuM9y90pfdsKnaTqs xzgQlXPOpMbVC3s6wYsDpZXfltwD57pDMrmBnTbtbsbUG0s+6fYxfqG303Jl24exUWMt oIN1463PoX5zEiP2jD+rH0EftLEuY1C6o+zBo7yL8D+6zG/9cmKkJRQt7C3EM8T3tvKD Ql13JVQY/iHBK4Uers2ipv0IjRRQBCMXpycVVkfJHGpKLjJfF1w4Si0UGgGBDZ56EnlL OEZg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=IKHw8ZJJH6E9u6f/nnLYBeikX7qs/f5gbNE4LfnRaEo=; b=AoFhq/S4lUl73hC7KejH8JFnvMqdEDvjlg0iYO/VhO0z/G92bd8nN2T1KkTfjrsFQQ fs63glUS8DIyHtjvcEHff2P5JN7Uynvv9bLwqApm8KBSj4qGJyEjD2egaTLXaC0R893g HjbBoPeS1uBfPS7V8OpBunvxQNKtK62EjQRVxY+WtB1R/ycspGNKP1EomO2YlqEUryNJ +cLgddekc3h+E6lqzCSsChIEdmtYTEghskOucATuO6Pr/5ehCxKC3rXLh4SdIif39hqx m5CcKBvZY67wYVDISuLIgMl9Ulf5790/IqShdJFAaLog05oad83pxcqTfrxbqQv9ZFrz eRqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g26si220384edu.253.2020.06.29.12.12.04; Mon, 29 Jun 2020 12:12:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726637AbgF2TKA (ORCPT + 99 others); Mon, 29 Jun 2020 15:10:00 -0400 Received: from foss.arm.com ([217.140.110.172]:38490 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729895AbgF2TJ4 (ORCPT ); Mon, 29 Jun 2020 15:09:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A226715AD; Mon, 29 Jun 2020 09:42:13 -0700 (PDT) Received: from bogus (unknown [10.37.8.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8DAED3F71E; Mon, 29 Jun 2020 09:42:10 -0700 (PDT) Date: Mon, 29 Jun 2020 17:42:07 +0100 From: Sudeep Holla To: Mark Brown Cc: Geert Uytterhoeven , Yoshihiro Shimoda , "ulf.hansson@linaro.org" , "lgirdwood@gmail.com" , "magnus.damm@gmail.com" , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , Sudeep Holla Subject: Re: [PATCH/RFC v4 2/4] regulator: fixed: add regulator_ops members for suspend/resume Message-ID: <20200629164207.GB27911@bogus> References: <1593163942-5087-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> <1593163942-5087-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> <20200626143914.GE5289@sirena.org.uk> <20200629125756.GC5499@sirena.org.uk> <20200629134011.GA23284@bogus> <20200629150728.GA27911@bogus> <20200629161450.GE5499@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200629161450.GE5499@sirena.org.uk> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 05:14:50PM +0100, Mark Brown wrote: > On Mon, Jun 29, 2020 at 04:07:28PM +0100, Sudeep Holla wrote: > > On Mon, Jun 29, 2020 at 04:15:39PM +0200, Geert Uytterhoeven wrote: > > > > This is all about how to know what exactly PSCI is powering down during > > > SYSTEM_SUSPEND. In this specific case, it is about knowing if the eMMC > > > is powered down or not, as Linux should follow a specific procedure to > > > prepare the eMMC for that, and Linux should not if that isn't the case. > > > OK, unless you are optimising, you shouldn't care then what PSCI does. > > If you don't need eMMC, just suspend/power it off before you enter system/ > > psci suspend. > > That only works if the power off procedure doesn't require that power be > removed as part of the procedure. There's a reasonable argument that > specs that have such requirements are unhelpful but that doesn't mean > that nobody will make hardware with such requrements which creates > problems for generic code that needs to control that hardware if it > can't discover the power state over suspend. > Fair enough. > > > I had a quick look at the latest revision of the PSCI specification, and > > > it doesn't look like anything has changed in that area since my old patch > > > series from 2017. So it still boils down to: we don't know what a > > > specific PSCI implementation will do, as basically anything is > > > compliant, so the only safe thing is to assume the worst. > > > The specification states clearly: > > "... all devices in the system must be in a state that is compatible > > with entry into the system state. These preconditions are beyond the scope > > of this specification and are therefore not described here." > > "Prior to the call, the OS must disable all sources of wakeup other than > > those it needs to support for its implementation of suspend to RAM." > > This gets a bit circular for a generic OS since the OS needs some way to > figure out what it's supposed to do on a given platform - for example > the OS may be happy to use wakeup sources that the firmware is just > going to cut power on. > While I understand the sentiments here, PSCI is targeted to address CPU power state management mainly and system states like suspend/reset and poweroff which involves last CPU. This is one of the reason it is out of the scope of the specification. Here is my understanding. DT specifies all the wakeup sources. Linux can configure those and user may choose to enable a subset of them is wakeup. As stated in the spec and also based on what we already do in the kernel, we disable all other wakeup sources. The PSCI firmware can then either read those from the interrupt controller or based on static platform understanding, must not disable those wakeup sources. > > I see nothing has been fixed in the firmware too and we are still > > discussing the same after 3 years ????. Clearly we should start trusting > > firmware and built capability to fix and replace it if there are bugs > > just like kernel and stop hacking around in the kernel to deal with > > just broken platform/psci firmware. > > This isn't just an issue of buggy firmware as far as I can see, it's > also a lack of ability for the OS and firmware to communicate > information about their intentions to each other. As things stand you'd > need to put static information in the DT. It is easy for DT to get out of sync with firmware unless it is generated by the same firmware. That's the reason why I am against such multiple sources of information. I understand ACPI has more flexibility and I did discuss this in LPC few years back and people were happy to have simple model as I have mentioned above. I was pushing to add more clarity to the specification but as I mentioned it was rejected as it is more a cpu and system centric spec and avoids talking about devices which I kind of agree. Each device or platform having its specific property in DT is not scalable. Not sure if it is a generic problem. If it is, I would like to understand more details on such lack of ability for communtication between OS and firmware. -- Regards, Sudeep