]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI: Stop setting cached power state to 'unknown' on unbind
authorLukas Wunner <lukas@wunner.de>
Fri, 17 Apr 2026 08:51:46 +0000 (10:51 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 27 Apr 2026 14:47:03 +0000 (09:47 -0500)
commitd462c8e89e84bfb6417e6b4c88e0cb7cc747ba41
tree6c965a581faaa174ba90b8b8cc89064120fa3151
parent254f49634ee16a731174d2ae34bc50bd5f45e731
PCI: Stop setting cached power state to 'unknown' on unbind

When a PCI device is unbound from its driver, pci_device_remove() sets the
cached power state in pci_dev->current_state to PCI_UNKNOWN.  This was
introduced by commit 2449e06a5696 ("PCI: reset pci device state to unknown
state for resume") to invalidate the cached power state in case the system
is subsequently put to sleep.

For bound devices, the cached power state is set to PCI_UNKNOWN in
pci_pm_suspend_noirq(), immediately before entering system sleep.

Extend to unbound devices for consistency.

This obviates the need to change the cached power state on unbind, so stop
doing so.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Link: https://patch.msgid.link/af7d11d3ceb231acc90829f7a5c8400c2446744f.1776415510.git.lukas@wunner.de
drivers/pci/pci-driver.c