From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Christoph Hellwig <hch@lst.de>,
Ulf Hansson <ulf.hansson@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Bjorn Helgaas <helgaas@kernel.org>,
kbusch@kernel.org, axboe@kernel.dk, sagi@grimberg.me,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, andersson@kernel.org,
konradybcio@kernel.org, Len Brown <len.brown@intel.com>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH] nvme-pci: Shutdown the device if D3Cold is allowed by the user
Date: Thu, 26 Dec 2024 21:52:15 +0530 [thread overview]
Message-ID: <20241226162215.vnhidukzkzfhuwt2@thinkpad> (raw)
In-Reply-To: <a514f047-d56e-40a1-ad36-b655cc8cddb7@oss.qualcomm.com>
On Sat, Dec 21, 2024 at 12:17:02PM +0100, Konrad Dybcio wrote:
> On 21.12.2024 4:38 AM, Manivannan Sadhasivam wrote:
> > On Fri, Dec 20, 2024 at 04:15:21PM +0100, Konrad Dybcio wrote:
> >> On 16.12.2024 5:42 PM, Rafael J. Wysocki wrote:
> >>> On Mon, Dec 16, 2024 at 5:23 PM Christoph Hellwig <hch@lst.de> wrote:
> >>>>
> >>>> On Sat, Dec 14, 2024 at 12:00:23PM +0530, Manivannan Sadhasivam wrote:
> >>>>> We need a PM core API that tells the device drivers when it is safe to powerdown
> >>>>> the devices. The usecase here is with PCIe based NVMe devices but the problem is
> >>>>> applicable to other devices as well.
> >>>>
> >>>> Maybe I'm misunderstanding things, but I think the important part is
> >>>> to indicate when a suspend actually MUST put the device into D3. Because
> >>>> doing that should always be safe, but not always optimal.
> >>>
> >>> I'm not aware of any cases when a device must be put into D3cold
> >>> (which I think is what you mean) during system-wide suspend.
> >>>
> >>> Suspend-to-idle on x86 doesn't require this, at least not for
> >>> correctness. I don't think any platforms using DT require it either.
> >>
> >> That would be correct.
> >>
> >> The Qualcomm platform (or class of platforms) we're looking at with this
> >> specific issue requires PCIe (implying NVMe) shutdown for S2RAM.
> >>
> >> The S2RAM entry mechanism is unfortunately misrepresented as an S2Idle
> >> state by Linux as of today, and I'm trying really hard to convince some
> >> folks to let me describe it correctly, with little success so far..
> >>
> >
> > Perhaps you should say 'S2RAM is misrepresented as S2Idle by the firmware as of
> > today'...
> >
> > But I'll leave it up to the PSCI folks to decide whether it makes sense to
> > expose PSCI SYSTEM_SUSPEND through CPU_SUSPEND or not.
>
> The firmware happily performs the actions required to put the platform
> in S2RAM, but the interface used to request entry (CPU_SUSPEND) is
> mostly used for entering CPU/cluster idle states on arm64.
>
> (although the PSCI spec also clearly states that using CPU_SUSPEND for
> system-level low power states is allowed *plus* the reference
> implementation literally just calls CPU_SUSPEND internally whenever
> the """proper""" SYSTEM_SUSPEND call is used, anyway)
>
Ok, sounds fair.
> >
> > For the people in this thread, I'm leaving the link to the PSCI discussion here:
> > https://lore.kernel.org/all/20241028-topic-cpu_suspend_s2ram-v1-0-9fdd9a04b75c@oss.qualcomm.com/
> >
> >> That is the real underlying issue and once/if it's solved, this patch
> >> will not be necessary.
> >>
> >>> In theory, ACPI S3 or hibernation may request that, but I've never
> >>> seen it happen in practice.
> >>>
> >>> Suspend-to-idle on x86 may want devices to end up in specific power
> >>> states in order to be able to switch the entire platform into a deep
> >>> energy-saving mode, but that's never been D3cold so far.
> >>
> >> In our case the plug is only pulled in S2RAM, otherwise the best we can
> >> do is just turn off the devices individually to decrease the overall
> >> power draw
> >>
> >
> > I don't think this is accurate. Qcom FW (the one we are discussing in this
> > thread) doesn't pull the plug (except on platforms like x13s due to hw
> > limitation). On ACPI though, the FW *might* pull the plug, so that's why drivers
> > prepare the devices by powering down them (largely) if pm_suspend_via_firmware()
> > succeeds. On Qcom platforms, we are trying to allow the SoC to transition to low
> > power state and that requires relinquishing the resource votes by the drivers.
>
> Look, I have a power measurement device before my eyes and I clearly see
> the main power rail being cut on successful S2RAM entry.
>
You seem to have misunderstood what I said. I do *know* the power state of the
SoC when it enters the CX power collapse state. What I said was in the case of
ACPI, it powers down the peripherals in S3 without any SW dependency (except for
wakeup capable devices). But in Qcom case, each driver has to relinquish the
vote for the SoC to enter CX collapse state. But anyhow, the difference doesn't
matter much here as all drivers need to drop the vote except in wakeup path.
- Mani
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-12-26 16:22 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 8:23 [PATCH] nvme-pci: Shutdown the device if D3Cold is allowed by the user Manivannan Sadhasivam
[not found] ` <20241118125817.GA28046@lst.de>
2024-11-18 14:58 ` Manivannan Sadhasivam
2024-11-22 22:20 ` Bjorn Helgaas
2024-11-23 9:01 ` Manivannan Sadhasivam
2024-11-26 17:11 ` Bjorn Andersson
2024-11-27 5:49 ` Manivannan Sadhasivam
2024-12-05 23:29 ` Bjorn Helgaas
2024-12-06 1:49 ` Bjorn Helgaas
2024-12-09 13:36 ` Christoph Hellwig
2024-12-09 14:38 ` Manivannan Sadhasivam
2024-12-12 5:59 ` Christoph Hellwig
2024-12-12 12:21 ` Rafael J. Wysocki
2024-12-12 12:49 ` Ulf Hansson
2024-12-12 15:13 ` Christoph Hellwig
2024-12-13 14:35 ` Rafael J. Wysocki
2024-12-14 6:30 ` Manivannan Sadhasivam
2024-12-16 16:23 ` Christoph Hellwig
2024-12-16 16:42 ` Rafael J. Wysocki
2024-12-16 16:48 ` Manivannan Sadhasivam
2024-12-16 17:28 ` Rafael J. Wysocki
2024-12-16 17:39 ` Manivannan Sadhasivam
2024-12-16 19:10 ` Rafael J. Wysocki
2024-12-20 15:15 ` Konrad Dybcio
2024-12-21 3:38 ` Manivannan Sadhasivam
2024-12-21 11:17 ` Konrad Dybcio
2024-12-26 16:22 ` Manivannan Sadhasivam [this message]
2025-01-03 7:28 ` Christoph Hellwig
2025-01-03 11:48 ` Konrad Dybcio
2024-12-16 16:24 ` Rafael J. Wysocki
2024-12-16 17:11 ` Manivannan Sadhasivam
2024-12-16 17:35 ` Rafael J. Wysocki
2024-12-16 17:52 ` Manivannan Sadhasivam
2024-12-16 19:34 ` Rafael J. Wysocki
2024-12-16 19:40 ` Keith Busch
2024-12-16 19:43 ` Rafael J. Wysocki
2024-12-17 5:26 ` manivannan.sadhasivam
2024-12-17 19:45 ` Rafael J. Wysocki
2024-12-19 8:02 ` Manivannan Sadhasivam
2024-12-19 12:45 ` Rafael J. Wysocki
2024-12-19 16:41 ` Ulf Hansson
2024-12-19 18:28 ` Rafael J. Wysocki
2025-01-03 7:26 ` Christoph Hellwig
2024-12-19 6:30 ` Christoph Hellwig
2024-12-19 8:03 ` Manivannan Sadhasivam
2024-12-09 14:43 ` Manivannan Sadhasivam
2024-12-09 14:57 ` Manivannan Sadhasivam
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=20241226162215.vnhidukzkzfhuwt2@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=andersson@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=helgaas@kernel.org \
--cc=kbusch@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=sagi@grimberg.me \
--cc=ulf.hansson@linaro.org \
/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