]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 12 Jan 2023 20:51:24 +0000 (21:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:33 +0000 (13:55 +0100)
commitfa32e39954170fb75e42ca9392f22b523f927def
tree52eff0da56e17dc20b668bc5a8409d2d666b7dbe
parent52e20466004883ab5a62a369bb2ca9a70e5bcf66
PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3()

[ Upstream commit b584c7670261ef8a9be235a1aa9cb3ba8fa7c2cb ]

It is questionable to allow a PCI bridge to go into D3 if it has _S0W
returning D2 or a shallower power state, so modify acpi_pci_bridge_d3(() to
always take the return value of _S0W for the target bridge into account.
That is, make it return 'false' if _S0W returns D2 or a shallower power
state for the target bridge regardless of its ancestor Root Port
properties.  Of course, this also causes 'false' to be returned if the Root
Port itself is the target and its _S0W returns D2 or a shallower power
state.

However, still allow bridges without _S0W that are power-manageable via
ACPI to enter D3 to retain the current code behavior in that case.

This fixes problems where a hotplug notification is missed because a bridge
is in D3.  That means hot-added devices such as USB4 docks (and the devices
they contain) and Thunderbolt 3 devices may not work.

Link: https://lore.kernel.org/linux-pci/20221031223356.32570-1-mario.limonciello@amd.com/
Link: https://lore.kernel.org/r/12155458.O9o76ZdvQC@kreacher
Reported-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/device_pm.c
drivers/pci/pci-acpi.c
include/acpi/acpi_bus.h