From 68bf37222e176201f478cbae12ba4a2e2d6329af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Fri, 11 Jul 2025 16:28:25 +0300 Subject: [PATCH 2/3] PCI/ASPM: Improve pci_set_default_link_state{,_locked}() kerneldoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve pci_set_default_link_state{,_locked}() documentation: - Note the link state may get changed if the default policy is in use - Better follow kerneldoc formatting guidelines (separate description block and return entries) Signed-off-by: Ilpo Järvinen --- drivers/pci/pcie/aspm.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 33e9885c0210..5721ebfdea71 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -1465,17 +1465,21 @@ static int __pci_set_default_link_state(struct pci_dev *pdev, int state, bool lo } /** - * pci_set_default_link_state - Clear and set the default device link state so - * that the link may be allowed to enter the specified states. Note that if the - * BIOS didn't grant ASPM control to the OS, this does nothing because we can't - * touch the LNKCTL register. Also note that this does not enable states - * disabled by pci_disable_link_state(). Return 0 or a negative errno. + * pci_set_default_link_state - Set the default device link state + * @pdev: PCI device + * @state: Mask of ASPM link states to enable + * + * Set the default device link state so that the link may be allowed to + * enter the specified states. If the default policy is in use, the link + * state may also be updated to reflect the new default link state. Note + * that if the BIOS didn't grant ASPM control to the OS, this does nothing + * because we can't touch the LNKCTL register. Also note that this does not + * enable states disabled by pci_disable_link_state(). * * Note: Ensure devices are in D0 before enabling PCI-PM L1 PM Substates, per * PCIe r6.0, sec 5.5.4. * - * @pdev: PCI device - * @state: Mask of ASPM link states to enable + * Return: 0 or a negative errno. */ int pci_set_default_link_state(struct pci_dev *pdev, int state) { @@ -1484,20 +1488,23 @@ int pci_set_default_link_state(struct pci_dev *pdev, int state) EXPORT_SYMBOL(pci_set_default_link_state); /** - * pci_set_default_link_state_locked - Clear and set the default device link - * state so that the link may be allowed to enter the specified states. Note + * pci_set_default_link_state_locked - Set the default device link state + * @pdev: PCI device + * @state: Mask of ASPM link states to enable + * + * Set the default device link state so that the link may be allowed to + * enter the specified states. If the default policy is in use, the link + * state may also be updated to reflect the new default link state. Note * that if the BIOS didn't grant ASPM control to the OS, this does nothing * because we can't touch the LNKCTL register. Also note that this does not - * enable states disabled by pci_disable_link_state(). Return 0 or a negative - * errno. + * enable states disabled by pci_disable_link_state(). + * + * Context: Caller holds pci_bus_sem read lock. * * Note: Ensure devices are in D0 before enabling PCI-PM L1 PM Substates, per * PCIe r6.0, sec 5.5.4. * - * @pdev: PCI device - * @state: Mask of ASPM link states to enable - * - * Context: Caller holds pci_bus_sem read lock. + * Return: 0 or a negative errno. */ int pci_set_default_link_state_locked(struct pci_dev *pdev, int state) { -- 2.39.5