PCI/ASPM: Add pci_enable_link_state_locked()
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 28 Nov 2023 08:15:07 +0000 (09:15 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 11 Dec 2023 18:07:42 +0000 (12:07 -0600)
commit718ab8226636a1a3a7d281f5d6a7ad7c925efe5a
tree57d0fc477ea9dde3de440c6a2b09fcf004c7e7f8
parentef61a0405742a9f7f6051bc6fd2f017d87d07911
PCI/ASPM: Add pci_enable_link_state_locked()

Add pci_enable_link_state_locked() for enabling link states that can be
used in contexts where a pci_bus_sem read lock is already held (e.g. from
pci_walk_bus()).

This helper will be used to fix a couple of potential deadlocks where
the current helper is called with the lock already held, hence the CC
stable tag.

Fixes: f492edb40b54 ("PCI: vmd: Add quirk to configure PCIe ASPM and LTR")
Link: https://lore.kernel.org/r/20231128081512.19387-2-johan+linaro@kernel.org
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
[bhelgaas: include helper name in subject, commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: <stable@vger.kernel.org> # 6.3
Cc: Michael Bottini <michael.a.bottini@linux.intel.com>
Cc: David E. Box <david.e.box@linux.intel.com>
drivers/pci/pcie/aspm.c
include/linux/pci.h