From: Sudeep Holla <sudeep.holla@arm.com>
To: Konrad Dybcio <konradybcio@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Sudeep Holla <sudeep.holla@arm.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Marijn Suijten <marijn.suijten@somainline.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Bjorn Andersson <andersson@kernel.org>
Subject: Re: [PATCH 2/2] firmware/psci: Set pm_set_resume/suspend_via_firmware() on qcom
Date: Mon, 8 Jan 2024 20:31:50 +0000 [thread overview]
Message-ID: <20240108203150.cx2kswpfcfmouv76@bogus> (raw)
In-Reply-To: <5499a078-a4de-47fb-ad2c-aa478699eb77@kernel.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
prev parent reply other threads:[~2024-01-08 20:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-27 22:15 [PATCH 0/2] Advertise pm_resume/suspend_via_firmware with PSCI Konrad Dybcio
2023-12-27 22:15 ` [PATCH 1/2] firmware/psci: Set pm_set_resume/suspend_via_firmware() for SYSTEM_SUSPEND Konrad Dybcio
2023-12-28 10:25 ` Sudeep Holla
2023-12-27 22:15 ` [PATCH 2/2] firmware/psci: Set pm_set_resume/suspend_via_firmware() on qcom Konrad Dybcio
2023-12-28 10:28 ` Sudeep Holla
2023-12-28 11:47 ` Konrad Dybcio
2023-12-28 11:50 ` Sudeep Holla
2023-12-28 12:16 ` Konrad Dybcio
2023-12-28 12:43 ` Sudeep Holla
2024-01-02 18:17 ` Konrad Dybcio
2024-01-03 9:44 ` Sudeep Holla
2024-01-08 15:47 ` Konrad Dybcio
2024-01-08 20:31 ` Sudeep Holla [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240108203150.cx2kswpfcfmouv76@bogus \
--to=sudeep.holla@arm.com \
--cc=andersson@kernel.org \
--cc=konradybcio@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=mark.rutland@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).