linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Dybcio <konradybcio@kernel.org>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Mark Rutland <mark.rutland@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 16:47:05 +0100	[thread overview]
Message-ID: <5499a078-a4de-47fb-ad2c-aa478699eb77@kernel.org> (raw)
In-Reply-To: <20240103094442.mlh2pf3odof3ze3s@bogus>

On 3.01.2024 10:44, Sudeep Holla wrote:
> 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.

Is that because of the matching table, or due to the slightly more
convoluted way of suspending the platform through CPU_SUSPEND?

If the former, I can think of other solutions. If the latter, I'm
open to keep convincing you :D There are probably things I skipped
over when explaining how it's wired up..

Konrad

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-01-08 15:47 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 [this message]
2024-01-08 20:31                   ` Sudeep Holla

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=5499a078-a4de-47fb-ad2c-aa478699eb77@kernel.org \
    --to=konradybcio@kernel.org \
    --cc=andersson@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 \
    --cc=sudeep.holla@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).