Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242601
b: refs/heads/master
c: 1a680b7
h: refs/heads/master
i:
  242599: 4f54290
v: v3
  • Loading branch information
Naga Chumbalkar authored and Jesse Barnes committed Mar 21, 2011
1 parent e49d369 commit 279c998
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b8bae901ce23addbdcdb54fa1696fb2d049feb5
refs/heads/master: 1a680b7c325882188865f05b9a88d32f75f26495
6 changes: 6 additions & 0 deletions trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,12 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)

if (!__pci_complete_power_transition(dev, state))
error = 0;
/*
* When aspm_policy is "powersave" this call ensures
* that ASPM is configured.
*/
if (!error && dev->bus->self)
pcie_aspm_powersave_config_link(dev->bus->self);

return error;
}
Expand Down
22 changes: 22 additions & 0 deletions trunk/drivers/pci/pcie/aspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,28 @@ void pcie_aspm_pm_state_change(struct pci_dev *pdev)
up_read(&pci_bus_sem);
}

void pcie_aspm_powersave_config_link(struct pci_dev *pdev)
{
struct pcie_link_state *link = pdev->link_state;

if (aspm_disabled || !pci_is_pcie(pdev) || !link)
return;

if (aspm_policy != POLICY_POWERSAVE)
return;

if ((pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT) &&
(pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM))
return;

down_read(&pci_bus_sem);
mutex_lock(&aspm_lock);
pcie_config_aspm_path(link);
pcie_set_clkpm(link, policy_to_clkpm_state(link));
mutex_unlock(&aspm_lock);
up_read(&pci_bus_sem);
}

/*
* pci_disable_link_state - disable pci device's link state, so the link will
* never enter specific states
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/pci-aspm.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
extern void pcie_aspm_init_link_state(struct pci_dev *pdev);
extern void pcie_aspm_exit_link_state(struct pci_dev *pdev);
extern void pcie_aspm_pm_state_change(struct pci_dev *pdev);
extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
extern void pci_disable_link_state(struct pci_dev *pdev, int state);
extern void pcie_clear_aspm(void);
extern void pcie_no_aspm(void);
Expand All @@ -39,6 +40,9 @@ 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)
{
}
static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
{
}
Expand Down

0 comments on commit 279c998

Please sign in to comment.