* [PATCH v13 01/12] PCI: Only put Intel PCIe ports >= 2015 into D3
[not found] <20230818051319.551-1-mario.limonciello@amd.com>
@ 2023-08-18 5:13 ` Mario Limonciello
2023-08-18 8:12 ` Rafael J. Wysocki
2023-08-18 14:19 ` Kuppuswamy Sathyanarayanan
0 siblings, 2 replies; 6+ messages in thread
From: Mario Limonciello @ 2023-08-18 5:13 UTC (permalink / raw)
To: Rafael J . Wysocki, Mika Westerberg, Bjorn Helgaas
Cc: linux-pci, linux-kernel, Andy Shevchenko, linux-acpi,
Kuppuswamy Sathyanarayanan, Iain Lane, Shyam-sundar S-k,
Mario Limonciello, stable
commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
changed pci_bridge_d3_possible() so that any vendor's PCIe ports
from modern machines (>=2015) are allowed to be put into D3.
Iain reports that USB devices can't be used to wake a Lenovo Z13
from suspend. This is because the PCIe root port has been put
into D3 and AMD's platform can't handle USB devices waking in this
case.
This behavior is only reported on Linux. Comparing the behavior
on Windows and Linux, Windows doesn't put the root ports into D3.
To fix the issue without regressing existing Intel systems,
limit the >=2015 check to only apply to Intel PCIe ports.
Cc: stable@vger.kernel.org
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>
---
v12->v13:
* New patch
---
drivers/pci/pci.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 60230da957e0c..051e88ee64c63 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3037,10 +3037,11 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
return false;
/*
- * It should be safe to put PCIe ports from 2015 or newer
+ * It is safe to put Intel PCIe ports from 2015 or newer
* to D3.
*/
- if (dmi_get_bios_year() >= 2015)
+ if (bridge->vendor == PCI_VENDOR_ID_INTEL &&
+ dmi_get_bios_year() >= 2015)
return true;
break;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v13 01/12] PCI: Only put Intel PCIe ports >= 2015 into D3
2023-08-18 5:13 ` [PATCH v13 01/12] PCI: Only put Intel PCIe ports >= 2015 into D3 Mario Limonciello
@ 2023-08-18 8:12 ` Rafael J. Wysocki
2023-08-18 8:21 ` David Laight
2023-08-18 14:19 ` Kuppuswamy Sathyanarayanan
1 sibling, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2023-08-18 8:12 UTC (permalink / raw)
To: Mario Limonciello
Cc: Rafael J . Wysocki, Mika Westerberg, Bjorn Helgaas, linux-pci,
linux-kernel, Andy Shevchenko, linux-acpi,
Kuppuswamy Sathyanarayanan, Iain Lane, Shyam-sundar S-k, stable
On Fri, Aug 18, 2023 at 7:14 AM Mario Limonciello
<mario.limonciello@amd.com> wrote:
>
> commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
> changed pci_bridge_d3_possible() so that any vendor's PCIe ports
> from modern machines (>=2015) are allowed to be put into D3.
>
> Iain reports that USB devices can't be used to wake a Lenovo Z13
> from suspend. This is because the PCIe root port has been put
> into D3 and AMD's platform can't handle USB devices waking in this
> case.
>
> This behavior is only reported on Linux. Comparing the behavior
> on Windows and Linux, Windows doesn't put the root ports into D3.
>
> To fix the issue without regressing existing Intel systems,
> limit the >=2015 check to only apply to Intel PCIe ports.
>
> Cc: stable@vger.kernel.org
> 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>
> ---
> v12->v13:
> * New patch
> ---
> drivers/pci/pci.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 60230da957e0c..051e88ee64c63 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -3037,10 +3037,11 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
> return false;
>
> /*
> - * It should be safe to put PCIe ports from 2015 or newer
> + * It is safe to put Intel PCIe ports from 2015 or newer
> * to D3.
> */
I would say "Allow Intel PCIe ports from 2015 onward to go into D3 to
achieve additional energy conservation on some platforms" without the
"It is safe" part that is kind of obvious (it wouldn't be done if it
were unsafe).
And analogously in patch [12/12].
> - if (dmi_get_bios_year() >= 2015)
> + if (bridge->vendor == PCI_VENDOR_ID_INTEL &&
> + dmi_get_bios_year() >= 2015)
> return true;
> break;
> }
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH v13 01/12] PCI: Only put Intel PCIe ports >= 2015 into D3
2023-08-18 8:12 ` Rafael J. Wysocki
@ 2023-08-18 8:21 ` David Laight
2023-08-18 9:19 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: David Laight @ 2023-08-18 8:21 UTC (permalink / raw)
To: 'Rafael J. Wysocki', Mario Limonciello
Cc: Mika Westerberg, Bjorn Helgaas, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, Andy Shevchenko,
linux-acpi@vger.kernel.org, Kuppuswamy Sathyanarayanan, Iain Lane,
Shyam-sundar S-k, stable@vger.kernel.org
From: Rafael J. Wysocki
> Sent: Friday, August 18, 2023 9:12 AM
>
> On Fri, Aug 18, 2023 at 7:14 AM Mario Limonciello
> <mario.limonciello@amd.com> wrote:
> >
> > commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
> > changed pci_bridge_d3_possible() so that any vendor's PCIe ports
> > from modern machines (>=2015) are allowed to be put into D3.
> >
> > Iain reports that USB devices can't be used to wake a Lenovo Z13
> > from suspend. This is because the PCIe root port has been put
> > into D3 and AMD's platform can't handle USB devices waking in this
> > case.
> >
...
> > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > index 60230da957e0c..051e88ee64c63 100644
> > --- a/drivers/pci/pci.c
> > +++ b/drivers/pci/pci.c
> > @@ -3037,10 +3037,11 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
> > return false;
> >
> > /*
> > - * It should be safe to put PCIe ports from 2015 or newer
> > + * It is safe to put Intel PCIe ports from 2015 or newer
> > * to D3.
> > */
>
> I would say "Allow Intel PCIe ports from 2015 onward to go into D3 to
> achieve additional energy conservation on some platforms" without the
> "It is safe" part that is kind of obvious (it wouldn't be done if it
> were unsafe).
Just say why...
"Don't put root ports into D3 on non-Intel systems to avoid issues
with USB devices being unable to wake up some AMD based laptops."
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v13 01/12] PCI: Only put Intel PCIe ports >= 2015 into D3
2023-08-18 8:21 ` David Laight
@ 2023-08-18 9:19 ` Rafael J. Wysocki
2023-08-18 13:54 ` Mario Limonciello
0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2023-08-18 9:19 UTC (permalink / raw)
To: David Laight
Cc: Rafael J. Wysocki, Mario Limonciello, Mika Westerberg,
Bjorn Helgaas, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, Andy Shevchenko,
linux-acpi@vger.kernel.org, Kuppuswamy Sathyanarayanan, Iain Lane,
Shyam-sundar S-k, stable@vger.kernel.org
On Fri, Aug 18, 2023 at 10:21 AM David Laight <David.Laight@aculab.com> wrote:
>
> From: Rafael J. Wysocki
> > Sent: Friday, August 18, 2023 9:12 AM
> >
> > On Fri, Aug 18, 2023 at 7:14 AM Mario Limonciello
> > <mario.limonciello@amd.com> wrote:
> > >
> > > commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
> > > changed pci_bridge_d3_possible() so that any vendor's PCIe ports
> > > from modern machines (>=2015) are allowed to be put into D3.
> > >
> > > Iain reports that USB devices can't be used to wake a Lenovo Z13
> > > from suspend. This is because the PCIe root port has been put
> > > into D3 and AMD's platform can't handle USB devices waking in this
> > > case.
> > >
> ...
> > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > > index 60230da957e0c..051e88ee64c63 100644
> > > --- a/drivers/pci/pci.c
> > > +++ b/drivers/pci/pci.c
> > > @@ -3037,10 +3037,11 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
> > > return false;
> > >
> > > /*
> > > - * It should be safe to put PCIe ports from 2015 or newer
> > > + * It is safe to put Intel PCIe ports from 2015 or newer
> > > * to D3.
> > > */
> >
> > I would say "Allow Intel PCIe ports from 2015 onward to go into D3 to
> > achieve additional energy conservation on some platforms" without the
> > "It is safe" part that is kind of obvious (it wouldn't be done if it
> > were unsafe).
>
> Just say why...
>
> "Don't put root ports into D3 on non-Intel systems to avoid issues
> with USB devices being unable to wake up some AMD based laptops."
Well, both pieces of information are actually useful: Why it is done
on Intel systems in the first place and why it cannot be done on AMD
systems.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v13 01/12] PCI: Only put Intel PCIe ports >= 2015 into D3
2023-08-18 9:19 ` Rafael J. Wysocki
@ 2023-08-18 13:54 ` Mario Limonciello
0 siblings, 0 replies; 6+ messages in thread
From: Mario Limonciello @ 2023-08-18 13:54 UTC (permalink / raw)
To: Rafael J. Wysocki, David Laight
Cc: Mika Westerberg, Bjorn Helgaas, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, Andy Shevchenko,
linux-acpi@vger.kernel.org, Kuppuswamy Sathyanarayanan, Iain Lane,
Shyam-sundar S-k, stable@vger.kernel.org
On 8/18/2023 04:19, Rafael J. Wysocki wrote:
> On Fri, Aug 18, 2023 at 10:21 AM David Laight <David.Laight@aculab.com> wrote:
>>
>> From: Rafael J. Wysocki
>>> Sent: Friday, August 18, 2023 9:12 AM
>>>
>>> On Fri, Aug 18, 2023 at 7:14 AM Mario Limonciello
>>> <mario.limonciello@amd.com> wrote:
>>>>
>>>> commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
>>>> changed pci_bridge_d3_possible() so that any vendor's PCIe ports
>>>> from modern machines (>=2015) are allowed to be put into D3.
>>>>
>>>> Iain reports that USB devices can't be used to wake a Lenovo Z13
>>>> from suspend. This is because the PCIe root port has been put
>>>> into D3 and AMD's platform can't handle USB devices waking in this
>>>> case.
>>>>
>> ...
>>>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>>>> index 60230da957e0c..051e88ee64c63 100644
>>>> --- a/drivers/pci/pci.c
>>>> +++ b/drivers/pci/pci.c
>>>> @@ -3037,10 +3037,11 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
>>>> return false;
>>>>
>>>> /*
>>>> - * It should be safe to put PCIe ports from 2015 or newer
>>>> + * It is safe to put Intel PCIe ports from 2015 or newer
>>>> * to D3.
>>>> */
>>>
>>> I would say "Allow Intel PCIe ports from 2015 onward to go into D3 to
>>> achieve additional energy conservation on some platforms" without the
>>> "It is safe" part that is kind of obvious (it wouldn't be done if it
>>> were unsafe).
>>
>> Just say why...
>>
>> "Don't put root ports into D3 on non-Intel systems to avoid issues
>> with USB devices being unable to wake up some AMD based laptops."
>
> Well, both pieces of information are actually useful: Why it is done
> on Intel systems in the first place and why it cannot be done on AMD
> systems.
Thanks guys, I'll add both in next version.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v13 01/12] PCI: Only put Intel PCIe ports >= 2015 into D3
2023-08-18 5:13 ` [PATCH v13 01/12] PCI: Only put Intel PCIe ports >= 2015 into D3 Mario Limonciello
2023-08-18 8:12 ` Rafael J. Wysocki
@ 2023-08-18 14:19 ` Kuppuswamy Sathyanarayanan
1 sibling, 0 replies; 6+ messages in thread
From: Kuppuswamy Sathyanarayanan @ 2023-08-18 14:19 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Mika Westerberg,
Bjorn Helgaas
Cc: linux-pci, linux-kernel, Andy Shevchenko, linux-acpi, Iain Lane,
Shyam-sundar S-k, stable
Hi,
On 8/17/2023 10:13 PM, Mario Limonciello wrote:
> commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
> changed pci_bridge_d3_possible() so that any vendor's PCIe ports
> from modern machines (>=2015) are allowed to be put into D3.
>
> Iain reports that USB devices can't be used to wake a Lenovo Z13
> from suspend. This is because the PCIe root port has been put
> into D3 and AMD's platform can't handle USB devices waking in this
> case.
>
> This behavior is only reported on Linux. Comparing the behavior
> on Windows and Linux, Windows doesn't put the root ports into D3.
>
> To fix the issue without regressing existing Intel systems,
> limit the >=2015 check to only apply to Intel PCIe ports.
>
> Cc: stable@vger.kernel.org
> 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>
> ---
Looks good to me.
Reviewed-by:Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> v12->v13:
> * New patch
> ---
> drivers/pci/pci.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 60230da957e0c..051e88ee64c63 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -3037,10 +3037,11 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
> return false;
>
> /*
> - * It should be safe to put PCIe ports from 2015 or newer
> + * It is safe to put Intel PCIe ports from 2015 or newer
> * to D3.
> */
> - if (dmi_get_bios_year() >= 2015)
> + if (bridge->vendor == PCI_VENDOR_ID_INTEL &&
> + dmi_get_bios_year() >= 2015)
> return true;
> break;
> }
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-08-18 14:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230818051319.551-1-mario.limonciello@amd.com>
2023-08-18 5:13 ` [PATCH v13 01/12] PCI: Only put Intel PCIe ports >= 2015 into D3 Mario Limonciello
2023-08-18 8:12 ` Rafael J. Wysocki
2023-08-18 8:21 ` David Laight
2023-08-18 9:19 ` Rafael J. Wysocki
2023-08-18 13:54 ` Mario Limonciello
2023-08-18 14:19 ` Kuppuswamy Sathyanarayanan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox