From: Bjorn Helgaas <helgaas@kernel.org>
To: "Limonciello, Mario" <mario.limonciello@amd.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
"open list:PCI SUBSYSTEM" <linux-pci@vger.kernel.org>,
linux-pm@vger.kernel.org, Sanju.Mehta@amd.com,
"Rafael J. Wysocki" <rafael@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH v5 1/2] PCI / ACPI: Assume `HotPlugSupportInD3` only if device can wake from D3
Date: Thu, 31 Mar 2022 14:59:35 -0500 [thread overview]
Message-ID: <20220331195935.GA29364@bhelgaas> (raw)
In-Reply-To: <729648c2-6e2c-7076-b5a1-3155ce4fa924@amd.com>
On Thu, Mar 31, 2022 at 02:33:12PM -0500, Limonciello, Mario wrote:
> On 3/31/2022 14:04, Bjorn Helgaas wrote:
> > [+cc Rafael, Mika, linux-pm]
> > On Mon, Mar 28, 2022 at 03:55:18PM -0500, Mario Limonciello wrote:
> > ...
> > On some platforms, e.g., AMD Yellow Carp, firmware may supply
> > "HotPlugSupportInD3" even though _S0W tells us the device cannot
> > wake from D3hot. With the previous code, these devices could be put
> > in D3hot and hotplugged devices would not be recognized.
> >
> > If _S0W exists and says the Root Port cannot wake itself from D3hot,
> > return "false" to indicate that "dev" cannot handle hotplug events
> > while in D3.
> >
> > 1) "dev" has a _PS0 or _PR0 method, or
> >
> > 2a) The Root Port above "dev" has _PRW and
> >
> > 2b) If the Root Port above "dev" has _S0W, it can wake from D3hot or
> > D3cold and
> >
> > 2c) The Root Port above "dev" has a _DSD with a
> > "HotPlugSupportInD3" property with value 1.
>
> Very well, I'll incorporate into the commit message and scrap some of the
> old stuff.
>
> > The _S0W part makes sense to me. The _PRW part hasn't been explained
> > yet. We didn't depend on it before, but we think it's safe to depend
> > on it now?
>
> An earlier version of this patch actually was only checking this rather than
> _S0W alone. It was suggested that both should be checked together by
> Rafael.
>
> https://lore.kernel.org/linux-pci/CAJZ5v0grj=vE1wGJpMxh-Hy7=ommfFUh5hw++nmQdLVxVtCSWw@mail.gmail.com/
>
> FWIW at least some earlier versions Rafael and Mika both agreed towards that
> direction (and presumably weren't worried about existing systems that this
> code was used for).
OK. I think it's worth mentioning _PRW even if we don't have a good
explanation for it. For someone bringing up a platform like this,
that will be a better hint than "adev->wakeup.flags.valid" alone.
> > In the commit log and comments, can we be more explicit about whether
> > "D3" means "D3hot" or "D3cold"?
>
> The check for _S0W return is looking for "3", so it's really D3hot "or"
> D3cold. In the problematic case on Yellow Carp, it was D3hot. I'll add
> this detail.
Linux advertises OSC_SB_PR3_SUPPORT, so I think we are checking for
D3hot. Of course, if a device can't wake from D3hot, it can't wake
from D3cold either.
You didn't *add* any D3 comments and only quoted the Microsoft doc, so
maybe nothing to change in this patch. It's confusing to me that the
existing code, like acpi_pci_bridge_d3(), pci_bridge_d3_possible(),
pci_bridge_d3_force, etc., are all ambiguous.
Bjorn
prev parent reply other threads:[~2022-03-31 19:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 20:55 [PATCH v5 1/2] PCI / ACPI: Assume `HotPlugSupportInD3` only if device can wake from D3 Mario Limonciello
2022-03-28 20:55 ` [PATCH v5 2/2] PCI / ACPI: Adjust comment about `HotPlugSupportInD3` Mario Limonciello
2022-03-31 19:04 ` [PATCH v5 1/2] PCI / ACPI: Assume `HotPlugSupportInD3` only if device can wake from D3 Bjorn Helgaas
2022-03-31 19:33 ` Limonciello, Mario
2022-03-31 19:59 ` Bjorn Helgaas [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=20220331195935.GA29364@bhelgaas \
--to=helgaas@kernel.org \
--cc=Sanju.Mehta@amd.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael@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).