Skip to content

Commit 08d0cc5

Browse files
khfengbjorn-helgaas
authored andcommitted
PCI/ASPM: Remove pcie_aspm_pm_state_change()
pcie_aspm_pm_state_change() was introduced at the inception of PCIe ASPM code, but it can cause some issues. For instance, when ASPM config is changed via sysfs, those changes won't persist across power state change because pcie_aspm_pm_state_change() overwrites them. Also, if the driver restores L1SS [1] after system resume, the restored state will also be overwritten by pcie_aspm_pm_state_change(). Remove pcie_aspm_pm_state_change(). If there's any hardware that really needs it to function, a quirk can be used instead. [1] https://lore.kernel.org/linux-pci/[email protected]/ Link: https://lore.kernel.org/r/[email protected] [bhelgaas: remove additional pcie_aspm_pm_state_change() call in pci_set_low_power_state(), added by 10aa537 ("PCI/PM: Split pci_raw_set_power_state()") and moved by 7957d20 ("PCI/PM: Relocate pci_set_low_power_state()")] Signed-off-by: Kai-Heng Feng <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent f2906aa commit 08d0cc5

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed

drivers/pci/pci.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,9 +1293,6 @@ static int pci_set_full_power_state(struct pci_dev *dev)
12931293
pci_restore_bars(dev);
12941294
}
12951295

1296-
if (dev->bus->self)
1297-
pcie_aspm_pm_state_change(dev->bus->self);
1298-
12991296
return 0;
13001297
}
13011298

@@ -1390,9 +1387,6 @@ static int pci_set_low_power_state(struct pci_dev *dev, pci_power_t state)
13901387
pci_power_name(dev->current_state),
13911388
pci_power_name(state));
13921389

1393-
if (dev->bus->self)
1394-
pcie_aspm_pm_state_change(dev->bus->self);
1395-
13961390
return 0;
13971391
}
13981392

drivers/pci/pci.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,10 @@ bool pcie_wait_for_link(struct pci_dev *pdev, bool active);
560560
#ifdef CONFIG_PCIEASPM
561561
void pcie_aspm_init_link_state(struct pci_dev *pdev);
562562
void pcie_aspm_exit_link_state(struct pci_dev *pdev);
563-
void pcie_aspm_pm_state_change(struct pci_dev *pdev);
564563
void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
565564
#else
566565
static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) { }
567566
static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev) { }
568-
static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) { }
569567
static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { }
570568
#endif
571569

drivers/pci/pcie/aspm.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,25 +1012,6 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev)
10121012
up_read(&pci_bus_sem);
10131013
}
10141014

1015-
/* @pdev: the root port or switch downstream port */
1016-
void pcie_aspm_pm_state_change(struct pci_dev *pdev)
1017-
{
1018-
struct pcie_link_state *link = pdev->link_state;
1019-
1020-
if (aspm_disabled || !link)
1021-
return;
1022-
/*
1023-
* Devices changed PM state, we should recheck if latency
1024-
* meets all functions' requirement
1025-
*/
1026-
down_read(&pci_bus_sem);
1027-
mutex_lock(&aspm_lock);
1028-
pcie_update_aspm_capable(link->root);
1029-
pcie_config_aspm_path(link);
1030-
mutex_unlock(&aspm_lock);
1031-
up_read(&pci_bus_sem);
1032-
}
1033-
10341015
void pcie_aspm_powersave_config_link(struct pci_dev *pdev)
10351016
{
10361017
struct pcie_link_state *link = pdev->link_state;

0 commit comments

Comments
 (0)