From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0D01C3DA6E for ; Mon, 8 Jan 2024 20:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=up3NvNcO9GTkHTNrbj7HQ3lG0VLMV0AWg+6oX89Iq0I=; b=ErC4o1028sLA9w lrnGFzYAURgDP1aXQhnKR6BAmP7Il+Nd55moeNFaaMF/9SDrOp+dGl77O6b2ekDvJ37PIOeTWo0a+ d+IilMjx/EwKaH4Ml64B3c9AaFWCeeokNGpYMq/9EzoFsePaGPHYfXU3sOUwucjTSSHU+QvJXhIsP X5UlA7s9w7gOkC8SwauGqKeBR+SpBJMFnwX95VIQ/z3ZisPvqSoom7/X9Y2q4uci8k8HbW/6yKy2C KOtXiKT39ZqgK2aqeTWT1HXCl9VnnbWBJnb4/b3yr0+luIwib03uNOuZncUOYI8dpw/rAYbQbvHn9 +qROYjFUhFOTWlFN0BuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rMwKv-006AeX-1I; Mon, 08 Jan 2024 20:35:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rMwKr-006Abg-2c for linux-arm-kernel@lists.infradead.org; Mon, 08 Jan 2024 20:35:03 +0000 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 13052C15; Mon, 8 Jan 2024 12:35:44 -0800 (PST) Received: from bogus (unknown [10.57.74.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0F4A43F73F; Mon, 8 Jan 2024 12:34:56 -0800 (PST) Date: Mon, 8 Jan 2024 20:31:50 +0000 From: Sudeep Holla To: Konrad Dybcio Cc: Mark Rutland , Sudeep Holla , Lorenzo Pieralisi , 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: <20240108203150.cx2kswpfcfmouv76@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> <20240103094442.mlh2pf3odof3ze3s@bogus> <5499a078-a4de-47fb-ad2c-aa478699eb77@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5499a078-a4de-47fb-ad2c-aa478699eb77@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240108_123501_961327_69F39A67 X-CRM114-Status: GOOD ( 17.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 08, 2024 at 04:47:05PM +0100, Konrad Dybcio wrote: > On 3.01.2024 10:44, Sudeep Holla wrote: > > > > But I don't like the Qualcomm specific changes. > > Is that because of the matching table, or due to the slightly more > convoluted way of suspending the platform through CPU_SUSPEND? > I would say both. I don't like this to be Qualcomm platform specific feature. Also advertising absence of system suspend on those platforms as presence of some special system suspend. It simply is not system suspend. The sysfs hides/abstracts and provides s2idle even when user request s2r on such platforms. We should advertise it as s2idle. I would do something like below patch, just a rough idea, not compiled or tested. This avoids any misleading or confusion IMO. However I am interested in knowing which are these drivers that rely on the pm_suspend_global_flags ? The reason I ask the x86 ACPI doesn't set the flags for s2idle. Also the core code explicitly calls pm_set_suspend_no_platform() in suspend_devices_and_enter(). What you want conflicts with both the above observations. I would like to involve Rafael and check what is the correct/expected way to use those flags. Regards, Sudeep --->8 diff --git i/drivers/firmware/psci/psci.c w/drivers/firmware/psci/psci.c index 0e622aa5ad58..b2559ae7668a 100644 --- i/drivers/firmware/psci/psci.c +++ w/drivers/firmware/psci/psci.c @@ -505,26 +505,42 @@ static int psci_system_suspend(unsigned long unused) return psci_to_linux_errno(err); } -static int psci_system_suspend_enter(suspend_state_t state) +static int psci_system_idle_prepare_late(void) { pm_set_resume_via_firmware(); + return 0; +} +#define psci_system_system_prepare_late psci_system_idle_prepare_late + +static int psci_system_suspend_enter(suspend_state_t state) +{ + psci_system_system_prepare_late(); return cpu_suspend(0, psci_system_suspend); } -static int psci_system_suspend_begin(suspend_state_t state) +static int psci_system_idle_begin(void) { pm_set_suspend_via_firmware(); - return 0; } +static int psci_system_suspend_begin(suspend_state_t state) +{ + return psci_system_idle_begin(); +} + static const struct platform_suspend_ops psci_suspend_ops = { .valid = suspend_valid_only_mem, .enter = psci_system_suspend_enter, .begin = psci_system_suspend_begin, }; +static const struct platform_s2idle_ops psci_s2idle_ops = { + .begin = psci_system_idle_begin, + .prepare_late = psci_system_idle_prepare_late, +}; + static void __init psci_init_system_reset2(void) { int ret; @@ -546,6 +562,8 @@ static void __init psci_init_system_suspend(void) if (ret != PSCI_RET_NOT_SUPPORTED) suspend_set_ops(&psci_suspend_ops); + + s2idle_set_ops(&psci_s2idle_ops); } static void __init psci_init_cpu_suspend(void) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel