Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7024135rdb; Wed, 3 Jan 2024 01:48:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTTzD+owARp6oiP8xKpqolLuCE3lmAJ7LWzOILnAC2VIFBFlu4okEUFjdsg7p+tYLVLw95 X-Received: by 2002:a05:6808:18a4:b0:3bc:2868:b942 with SMTP id bi36-20020a05680818a400b003bc2868b942mr257901oib.48.1704275319299; Wed, 03 Jan 2024 01:48:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704275319; cv=none; d=google.com; s=arc-20160816; b=OIQvKUq2n0FG0o/LUUO5HSstTmUj85CCpfOi6KHZtG7p6yYRFmmmQZQNDx7/2MsIs0 5YGGToArJeshapK6EHzE7zoW+TTfCijla2WQtLwIRDJnLkMIzoVfUwR/dQwlboenCbs3 B66xJdU+Z9TWHYOFOHGWXuUhrDQdpXDHKk5Wk1YTztRydjNDLjP2KOcOdb1t+bU+2EsN og0/gmB+80V05Mlx807UV/2AxlEp14ipUAo8oych0aIjU2HgvpGzzmlWU3rxJdFI8l1l 0A5wCQVw7rA8Pfgz7LEqwEZP/605AiUqR3kZHWvgY82CgF1Hk/raaELnlv1AOJLINehk EZjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=Xzx6yBJfIQZQHAjg69pe5tMH3m4Z48zVTX8ZhaeNDEk=; fh=mP0SNjh1X9rimZykphb0KCgh6RFkNVwJfQq5IcFwHCk=; b=JHWX+EwPw6WR7cGRpzLmS5TDEGfaHX0N/mdIJZHlyL05fgiMHXoAteCKK3yUEwwiqZ yXWZ/pCQZbIPwuM5yTWkRk6d0JNO+GvtL99NDZMEwUwuNo2dnnF/H7dDN41fZUl7sI8J 47L1gtp/XSs1Y1OdKtLUiFe+qcMZ1l9Qa4H25auCWa3aBGaNYs3zQaZFfSrUG+2Hp2cL UvyumpXoukNMCt6o9jnGyILZquxd6GsDBzNVo6NMiXOw4OCweXA74R7Er5HixK8BE7wz Kz8IhmRzygS+gM6qsSLxR+6tncNOUKgw8Eo+Evr243ft6vB1QWa/vXoqom0AlwweaZOb MxEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v9-20020a0cdd89000000b006794ec8bf24si28477162qvk.384.2024.01.03.01.48.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 01:48:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0E7D11C231E3 for ; Wed, 3 Jan 2024 09:48:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 021401862A; Wed, 3 Jan 2024 09:48:03 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFC9F182DD for ; Wed, 3 Jan 2024 09:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 62A10C15; Wed, 3 Jan 2024 01:48:39 -0800 (PST) Received: from bogus (unknown [10.57.74.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9649A3F7A6; Wed, 3 Jan 2024 01:47:50 -0800 (PST) Date: Wed, 3 Jan 2024 09:44:42 +0000 From: Sudeep Holla To: Konrad Dybcio Cc: Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Marijn Suijten , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bjorn Andersson Subject: Re: [PATCH 2/2] firmware/psci: Set pm_set_resume/suspend_via_firmware() on qcom Message-ID: <20240103094442.mlh2pf3odof3ze3s@bogus> References: <20231227-topic-psci_fw_sus-v1-0-6910add70bf3@linaro.org> <20231227-topic-psci_fw_sus-v1-2-6910add70bf3@linaro.org> <20231228102801.fzaubcjq5thfwgxg@bogus> <20231228115053.zlypgc5uxxvghi4a@bogus> <376d3040-b9ed-4574-90d7-fb864d694e3c@linaro.org> <20231228124348.mmtceqeuean7ly6y@bogus> <7e31d489-de96-42f0-a72a-a581859e7131@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e31d489-de96-42f0-a72a-a581859e7131@linaro.org> On Tue, Jan 02, 2024 at 07:17:50PM +0100, Konrad Dybcio wrote: > On 28.12.2023 13:43, Sudeep Holla wrote: > > On Thu, Dec 28, 2023 at 01:16:28PM +0100, Konrad Dybcio wrote: > >> On 28.12.2023 12:50, Sudeep Holla wrote: > >>> On Thu, Dec 28, 2023 at 12:47:51PM +0100, Konrad Dybcio wrote: > >>>> On 28.12.2023 11:28, Sudeep Holla wrote: > >>>>> On Wed, Dec 27, 2023 at 11:15:31PM +0100, Konrad Dybcio wrote: > >>>>>> Most Qualcomm platforms implementing PSCI (ab)use CPU_SUSPEND for > >>>>>> entering various stages of suspend, across the SoC. These range from a > >>>>>> simple WFI to a full-fledged power collapse of the entire chip > >>>>>> (mostly, anyway). > >>>>>> > >>>>>> Some device drivers are curious to know whether "the firmware" (which is > >>>>>> often assumed to be ACPI) takes care of suspending or resuming the > >>>>>> platform. Set the flag that reports this behavior on the aforementioned > >>>>>> chips. > >>>>>> > >>>>>> Some newer Qualcomm chips ship with firmware that actually advertises > >>>>>> PSCI SYSTEM_SUSPEND, so the compatible list should only grow slightly. > >>>>>> > >>>>> > >>>>> NACK, just use suspend-to-idle if SYSTEM_SUSPEND is not advertised. It is > >>>>> designed for such platforms especially on x86/ACPI which don't advertise > >>>>> Sx states. I see no reason why that doesn't work on ARM platforms as well. > >>>> > >>>> Not sure if I got the message through well, but the bottom line is, on > >>>> Qualcomm platforms the "idle" states aren't actually just "idle" (read: > >>>> they're not like S0ix). All but the most shallow ones shut down quite a > >>>> chunk of the entire SoC, with the lowest ones being essentially S3 with > >>>> power being cut off from the entire chip, except for the memory rail. > >>>> > >>> > >>> No I understood that and S2I is exactly what you need. > >>> Have you checked if S2I already works as intended on these platforms ? > >> Yes, simple CPU idling works OOTB and the SoC power collapse only works > >> given the developer doesn't cut corners when bringing up the platform > >> (read: works on some of the ones we support, trying hard to expand that > >> group!) > >> > >>> What extra do you achieve with this hack by advertising fake S2R ? > >> Uh.. unless I misunderstood something, I'm not advertising s2ram.. > >> Quite the opposite, I'm making sure only s2idle is allowed. > >> > > > > Right, I didn't notice that in suspend_valid_all(), it can be rename > > suspend_valid_s2i or something. "All" indicates all state is valid. > > > > Anyways that is not the main point. IIUC S2I must still work if there is > > at-least one CPU idle state other than WFI without these changes. Right ? > > Yes, and it does > Thanks for the confirmation. > > > > If all these changes is to support S2I wih WFI only, then we can look at > > some generic solution as there were previous attempts to do something > > similar on other platforms IIRC. > > No, I'm just interested in setting the resume/suspend_via_firmware() > markers and the PSCI driver seems like a good place for it, be it on Agreed and your PATCH 1/2 does that exactly and hence I have acked it already. > all platforms with SYSTEM_SUSPEND and Qualcomm which sneaked equivalent > functionality into the CPU_SUSPEND call. > But I don't like the Qualcomm specific changes. -- Regards, Sudeep