Skip to content

Commit

Permalink
Merge tag 'pci-v6.7-fixes-2' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/pci/pci

Pull PCI fixes from Bjorn Helgaas:

 - Revert an ASPM patch that caused an unintended reboot when resuming
   after suspend (Bjorn Helgaas)

 - Orphan Cadence PCIe IP (Bjorn Helgaas)

* tag 'pci-v6.7-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
  MAINTAINERS: Orphan Cadence PCIe IP
  Revert "PCI/ASPM: Remove pcie_aspm_pm_state_change()"
  • Loading branch information
torvalds committed Jan 3, 2024
2 parents d7807d8 + 0ee2030 commit ac865f0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,10 @@ D: Fedora kernel maintenance (2003-2014).
D: 'Trinity' and similar fuzz testing work.
D: Misc/Other.

N: Tom Joseph
E: [email protected]
D: Cadence PCIe driver

N: Martin Josfsson
E: [email protected]
P: 1024D/F6B6D3B1 7610 7CED 5C34 4AA6 DBA2 8BE1 5A6D AF95 F6B6 D3B1
Expand Down
5 changes: 2 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -16458,11 +16458,10 @@ F: Documentation/devicetree/bindings/pci/pci-armada8k.txt
F: drivers/pci/controller/dwc/pcie-armada8k.c

PCI DRIVER FOR CADENCE PCIE IP
M: Tom Joseph <[email protected]>
L: [email protected]
S: Maintained
S: Orphan
F: Documentation/devicetree/bindings/pci/cdns,*
F: drivers/pci/controller/cadence/
F: drivers/pci/controller/cadence/*cadence*

PCI DRIVER FOR FREESCALE LAYERSCAPE
M: Minghuan Lian <[email protected]>
Expand Down
6 changes: 6 additions & 0 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,9 @@ 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;
}

Expand Down Expand Up @@ -1429,6 +1432,9 @@ 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;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/pci/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,12 @@ int pcie_retrain_link(struct pci_dev *pdev, bool use_lt);
#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

Expand Down
19 changes: 19 additions & 0 deletions drivers/pci/pcie/aspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,25 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev)
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;
Expand Down

0 comments on commit ac865f0

Please sign in to comment.