From: Bjorn Helgaas <helgaas@kernel.org>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
"Mika Westerberg" <mika.westerberg@linux.intel.com>,
"Hans de Goede" <hdegoede@redhat.com>,
iain@orangesquash.org.uk,
"Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
"open list:PCI SUBSYSTEM" <linux-pci@vger.kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Lukas Wunner" <lukas@wunner.de>,
stable@vger.kernel.org
Subject: Re: [PATCH v21] PCI: Avoid D3 at suspend for AMD PCIe root ports w/ USB4 controllers
Date: Tue, 3 Oct 2023 13:31:23 -0500 [thread overview]
Message-ID: <20231003183123.GA680474@bhelgaas> (raw)
In-Reply-To: <dc7c5ecb-12be-4b2e-8f36-7d65dc171482@amd.com>
On Tue, Oct 03, 2023 at 01:06:48PM -0500, Mario Limonciello wrote:
> On 10/3/2023 12:24, Bjorn Helgaas wrote:
> > On Mon, Oct 02, 2023 at 01:09:06PM -0500, Mario Limonciello wrote:
> > > Iain reports that USB devices can't be used to wake a Lenovo Z13 from
> > > suspend. This occurs because on some AMD platforms, even though the Root
> > > Ports advertise PME_Support for D3hot and D3cold, they don't handle PME
> > > messages and generate wakeup interrupts from those states when amd-pmc has
> > > put the platform in a hardware sleep state.
> > ...
> > Two questions:
> >
> > - PME also doesn't work in D3hot, right?
>
> Right.
>
> IMO pci_d3cold_*() is poorly named.
> It's going to prevent D3 on the bridge.
I agree, that name is super irritating. I don't even know how to
figure out or verify that pci_d3cold_disable() also disables D3hot.
> > - Is it OK to use D3hot and D3cold if we don't have a wakeup device
> > below the Root Port? I assume that scenario is possible?
>
> Yes; it's "fine to do that" if there is no wakeup device below the
> root port.
>
> If a user intentionally turns off power/wakeup for the child devices
> (which as said before was USB4 and XHCI PCIe devices) then wakeup
> won't be set.
>
> So in this case as the quirk is implemented I expect the root port
> will be left in D0 even if a user intentionally turns off
> power/wakeup for the USB4 and XHCI devices.
Even if users don't intentionally turn off wakeup, there are devices
like mass storage and NICs without wake-on-LAN that don't require
wakeup.
I assume that if there's no downstream device that needs wakeup, this
quirk means we will keep the Root Port in D0 even though we could
safely put it in D3hot or D3cold.
That's one thing I liked about the v20 iteration -- instead of
pci_d3cold_disable(), we changed dev->pme_support, which should mean
that we only avoid D3hot/D3cold if we need PMEs while in those states,
so I assumed that we *could* use D3 when we don't need the wakeups.
Bjorn
next prev parent reply other threads:[~2023-10-03 18:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-02 18:09 [PATCH v21] PCI: Avoid D3 at suspend for AMD PCIe root ports w/ USB4 controllers Mario Limonciello
2023-10-03 9:41 ` Mika Westerberg
2023-10-03 17:24 ` Bjorn Helgaas
2023-10-03 18:06 ` Mario Limonciello
2023-10-03 18:31 ` Bjorn Helgaas [this message]
2023-10-03 18:37 ` Mario Limonciello
2023-10-03 19:16 ` Bjorn Helgaas
2023-10-03 19:24 ` Mario Limonciello
2023-10-03 19:59 ` Bjorn Helgaas
2023-10-03 20:02 ` Mario Limonciello
2023-10-03 20:00 ` Lukas Wunner
2023-10-03 20:16 ` Mario Limonciello
2023-10-03 20:29 ` Lukas Wunner
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=20231003183123.GA680474@bhelgaas \
--to=helgaas@kernel.org \
--cc=Shyam-sundar.S-k@amd.com \
--cc=bhelgaas@google.com \
--cc=hdegoede@redhat.com \
--cc=iain@orangesquash.org.uk \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mario.limonciello@amd.com \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
--cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).