From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
S-k Shyam-sundar <Shyam-sundar.S-k@amd.com>,
Natikar Basavaraj <Basavaraj.Natikar@amd.com>,
Deucher Alexander <Alexander.Deucher@amd.com>,
Iain Lane <iain@orangesquash.org.uk>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH v2] PCI: Don't assume root ports from > 2015 are power manageable
Date: Mon, 22 May 2023 14:40:08 +0300 [thread overview]
Message-ID: <20230522114008.GK45886@black.fi.intel.com> (raw)
In-Reply-To: <da80fb19-0b98-bf19-eea3-bc2cca2024f5@amd.com>
On Mon, May 22, 2023 at 06:28:25AM -0500, Mario Limonciello wrote:
> On 5/22/23 00:55, Mika Westerberg wrote:
> > Hi Mario,
> >
> > On Wed, May 17, 2023 at 10:08:27AM -0500, Mario Limonciello wrote:
> > > Using an XHCI device to wakeup the system from s2idle fails when
> > > that XHCI device is connected to a USB-C port for an AMD USB4
> > > router.
> > >
> > > Due to commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during
> > > suspend") all root port go into D3 during s2idle.
> > > When the root ports are in D3 over s2idle it's not possible for the
> > > platform firmware to properly identify the wakeup source.
> > >
> > > Comparing registers between Linux and Windows 11 this behavior to put root
> > > ports into D3 at suspend is unique to Linux. On an affected system
> > > Windows does not put the root ports into D3 over Modern Standby.
> > >
> > > Windows doesn't put the root ports into D3 because root ports are not
> > > power manageable; they're missing _PRW and _S0W.
> > >
> > > Linux shouldn't be assuming they support D3 just because they're newer
> > > than 2015, the ports should also be deemed power manageable.
> > > Add an extra check for this to ensure D3 isn't selected for such machines.
> > >
> > > Fixes: 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
> > > Reported-by: Iain Lane <iain@orangesquash.org.uk>
> > > Closes: https://forums.lenovo.com/t5/Ubuntu/Z13-can-t-resume-from-suspend-with-external-USB-keyboard/m-p/5217121
> > > Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> > > ---
> > > drivers/pci/pci.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > > index 5ede93222bc1..3fe27aef09e6 100644
> > > --- a/drivers/pci/pci.c
> > > +++ b/drivers/pci/pci.c
> > > @@ -3010,6 +3010,9 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
> > > if (dmi_check_system(bridge_d3_blacklist))
> > > return false;
> > > + if (!platform_pci_power_manageable(bridge))
> > > + return false;
> > > +
> >
> > We already call platform_pci_bridge_d3() few lines up. That function
> > should know whether "platform" supports D3 for the bridges, and I think
> > it actually calls acpi_device_power_manageable() that platform_pci_power_manageable()
> > ends up checking too.
>
> It does, but it doesn't end up returning false if it doesn't support it. It
> only returns true if it does.
Good point!
> I've tested this patch on two different failing platforms and it works now
> on both.
Okay LGTM then,
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
next prev parent reply other threads:[~2023-05-22 11:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 15:08 [PATCH v2] PCI: Don't assume root ports from > 2015 are power manageable Mario Limonciello
2023-05-22 5:55 ` Mika Westerberg
2023-05-22 11:28 ` Mario Limonciello
2023-05-22 11:40 ` Mika Westerberg [this message]
2023-05-23 20:35 ` Bjorn Helgaas
2023-05-23 21:29 ` Limonciello, Mario
2023-05-24 10:17 ` Rafael J. Wysocki
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=20230522114008.GK45886@black.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=Alexander.Deucher@amd.com \
--cc=Basavaraj.Natikar@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=bhelgaas@google.com \
--cc=iain@orangesquash.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=rafael.j.wysocki@intel.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