]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 29 Jul 2021 15:54:28 +0000 (17:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:00:43 +0000 (10:00 +0200)
commit5361ffb650fade365d6ad1bb9507ac347fe08938
treef732f323f0192a5e197cf7c77094a9c02ca67665
parent624b846f38d4929dbf72baaff139297f129a8f5b
PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently

[ Upstream commit da9f2150684ea684a7ddd6d7f0e38b2bdf43dcd8 ]

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 singaling 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>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/pci.c