aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-06-09 16:05:07 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-07-30 12:29:15 -0400
commit41cd766b065970ff6f6c89dd1cf55fa706c84a3d (patch)
treef52a7346daaaad331dbd260f0e21bcf9d108b2e6 /drivers/pci/pcie
parent4302e0fb7fa5b071e30f3cfb68e85155b3d69d9b (diff)
PCI: Don't enable aspm before drivers have had a chance to veto it
The aspm code will currently set the configured aspm policy before drivers have had an opportunity to indicate that their hardware doesn't support it. Unfortunately, putting some hardware in L0 or L1 can result in the hardware no longer responding to any requests, even after aspm is disabled. It makes more sense to leave aspm policy at the BIOS defaults at initial setup time, reconfiguring it after pci_enable_device() is called. This allows the driver to blacklist individual devices beforehand. Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r--drivers/pci/pcie/aspm.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index be53d98fa384..71222814c1ec 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -588,11 +588,23 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
588 * update through pcie_aspm_cap_init(). 588 * update through pcie_aspm_cap_init().
589 */ 589 */
590 pcie_aspm_cap_init(link, blacklist); 590 pcie_aspm_cap_init(link, blacklist);
591 pcie_config_aspm_path(link);
592 591
593 /* Setup initial Clock PM state */ 592 /* Setup initial Clock PM state */
594 pcie_clkpm_cap_init(link, blacklist); 593 pcie_clkpm_cap_init(link, blacklist);
595 pcie_set_clkpm(link, policy_to_clkpm_state(link)); 594
595 /*
596 * At this stage drivers haven't had an opportunity to change the
597 * link policy setting. Enabling ASPM on broken hardware can cripple
598 * it even before the driver has had a chance to disable ASPM, so
599 * default to a safe level right now. If we're enabling ASPM beyond
600 * the BIOS's expectation, we'll do so once pci_enable_device() is
601 * called.
602 */
603 if (aspm_policy != POLICY_POWERSAVE) {
604 pcie_config_aspm_path(link);
605 pcie_set_clkpm(link, policy_to_clkpm_state(link));
606 }
607
596unlock: 608unlock:
597 mutex_unlock(&aspm_lock); 609 mutex_unlock(&aspm_lock);
598out: 610out: