Commit 4f78495b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Yang Yingliang
Browse files

PCI: PM: Avoid forcing PCI_D0 for wakeup reasons inconsistently

stable inclusion
from linux-4.19.207
commit c5c62f4c936407fb734cae64700f20b68273b059

--------------------------------

[ Upstream commit da9f2150 ]

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: 666ff6f8 ("PCI/PM: Avoid using device_may_wakeup() for runtime PM")
Reported-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Reported-by: default avatarUtkarsh H Patel <utkarsh.h.patel@intel.com>
Reported-by: default avatarKoba Ko <koba.ko@canonical.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 6b40e3fa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment