mbox series

[v1,0/2] PCI: PM: Fix handling of device that can only signal PME from D3cold

Message ID 4668274.31r3eYUQgx@kreacher
Headers show
Series PCI: PM: Fix handling of device that can only signal PME from D3cold | expand

Message

Rafael J. Wysocki July 29, 2021, 2:46 p.m. UTC
Hi,

This series is a replacement for the following patch:

https://patchwork.kernel.org/project/linux-pm/patch/3149540.aeNJFYEL58@kreacher/

allowing devices that only can signal PME from D3cold to be put into
low-power states and signal wakeup from D3cold (if they get into it).

However, the patch above works by adding a special case to pci_pme_capable()
which actually is not necessary.

Instead of doing that, it is sufficient to make pci_target_state() handle the
case in which the device cannot signal PME from D0 consistently (patch [1/2]
in this series) and make __pci_enable_wake() enable PM signaling for devices
that can signal PME from D3cold (patch [2/2] in this series).

Please see the patch changelogs for details.

Thanks!

Comments

Rafael J. Wysocki July 29, 2021, 3:09 p.m. UTC | #1
On Thu, Jul 29, 2021 at 4:49 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> It is inconsistent to return PCI_D0 from pci_target_state() instead
> of the original target state if 'wakeup' is true and the device
> cannot signal PME from D0.
>
> This only happens when the device cannot signal PME from the original
> target state and any shallower power states (including D0) and that
> case is effectively equivalent to the one in which PME signaling is
> not supported at all.  Since the original target state is returned in
> the latter case, make the function do that in the former one too.
>
> Link: https://lore.kernel.org/linux-pm/3149540.aeNJFYEL58@kreacher/
> Fixes: 666ff6f83e1d ("PCI/PM: Avoid using device_may_wakeup() for runtime PM")
> Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Reported-by: Utkarsh H Patel <utkarsh.h.patel@intel.com>
> Reported-by: Koba Ko <koba.ko@canonical.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

The subject of this patch should be different, let me resend it.