mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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/20220201123536.12962-1-vidyas@nvidia.com/ Link: https://lore.kernel.org/r/20220509073639.2048236-1-kai.heng.feng@canonical.com [bhelgaas: remove additional pcie_aspm_pm_state_change() call in pci_set_low_power_state(), added by10aa5377fc
("PCI/PM: Split pci_raw_set_power_state()") and moved by7957d20145
("PCI/PM: Relocate pci_set_low_power_state()")] Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
f2906aa863
commit
08d0cc5f34
@ -1293,9 +1293,6 @@ static int pci_set_full_power_state(struct pci_dev *dev)
|
||||
pci_restore_bars(dev);
|
||||
}
|
||||
|
||||
if (dev->bus->self)
|
||||
pcie_aspm_pm_state_change(dev->bus->self);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1390,9 +1387,6 @@ static int pci_set_low_power_state(struct pci_dev *dev, pci_power_t state)
|
||||
pci_power_name(dev->current_state),
|
||||
pci_power_name(state));
|
||||
|
||||
if (dev->bus->self)
|
||||
pcie_aspm_pm_state_change(dev->bus->self);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -560,12 +560,10 @@ bool pcie_wait_for_link(struct pci_dev *pdev, bool active);
|
||||
#ifdef CONFIG_PCIEASPM
|
||||
void pcie_aspm_init_link_state(struct pci_dev *pdev);
|
||||
void pcie_aspm_exit_link_state(struct pci_dev *pdev);
|
||||
void pcie_aspm_pm_state_change(struct pci_dev *pdev);
|
||||
void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
|
||||
#else
|
||||
static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) { }
|
||||
static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev) { }
|
||||
static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) { }
|
||||
static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { }
|
||||
#endif
|
||||
|
||||
|
@ -1012,25 +1012,6 @@ out:
|
||||
up_read(&pci_bus_sem);
|
||||
}
|
||||
|
||||
/* @pdev: the root port or switch downstream port */
|
||||
void pcie_aspm_pm_state_change(struct pci_dev *pdev)
|
||||
{
|
||||
struct pcie_link_state *link = pdev->link_state;
|
||||
|
||||
if (aspm_disabled || !link)
|
||||
return;
|
||||
/*
|
||||
* Devices changed PM state, we should recheck if latency
|
||||
* meets all functions' requirement
|
||||
*/
|
||||
down_read(&pci_bus_sem);
|
||||
mutex_lock(&aspm_lock);
|
||||
pcie_update_aspm_capable(link->root);
|
||||
pcie_config_aspm_path(link);
|
||||
mutex_unlock(&aspm_lock);
|
||||
up_read(&pci_bus_sem);
|
||||
}
|
||||
|
||||
void pcie_aspm_powersave_config_link(struct pci_dev *pdev)
|
||||
{
|
||||
struct pcie_link_state *link = pdev->link_state;
|
||||
|
Loading…
Reference in New Issue
Block a user