]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: Add 'reset_subordinate' to reset hierarchy below bridge
authorKeith Busch <kbusch@kernel.org>
Fri, 25 Oct 2024 22:27:54 +0000 (15:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:04:05 +0000 (20:04 +0100)
commit51276b5e28cfc6efe24d07bd0b78cf8f76ed5982
treebc11eee49a554097e886bf19c29d25542c051681
parentea1adfd7d0fc9ed8823ef5d99587dd42591d7f8c
PCI: Add 'reset_subordinate' to reset hierarchy below bridge

[ Upstream commit 2fa046449a82a7d0f6d9721dd83e348816038444 ]

The "bus" and "cxl_bus" reset methods reset a device by asserting Secondary
Bus Reset on the bridge leading to the device.  These only work if the
device is the only device below the bridge.

Add a sysfs 'reset_subordinate' attribute on bridges that can assert
Secondary Bus Reset regardless of how many devices are below the bridge.

This resets all the devices below a bridge in a single command, including
the locking and config space save/restore that reset methods normally do.

This may be the only way to reset devices that don't support other reset
methods (ACPI, FLR, PM reset, etc).

Link: https://lore.kernel.org/r/20241025222755.3756162-1-kbusch@meta.com
Signed-off-by: Keith Busch <kbusch@kernel.org>
[bhelgaas: commit log, add capable(CAP_SYS_ADMIN) check]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Amey Narkhede <ameynarkhede03@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Documentation/ABI/testing/sysfs-bus-pci
drivers/pci/pci-sysfs.c
drivers/pci/pci.c
drivers/pci/pci.h