aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 14:44:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 14:44:36 -0400
commit1cfd2bda8c486ae0e7a8005354758ebb68172bca (patch)
tree76ce15f377d8d6eb3ae4aa8b8b0b415457e38d36 /drivers/pci/pcie
parentb57bdda58cda0aaf6def042d101dd85977a286ed (diff)
parent763e9db9994e27a7d2cb3701c8a097a867d0e0b4 (diff)
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (30 commits) PCI: update for owner removal from struct device_attribute PCI: Fix warnings when CONFIG_DMI unset PCI: Do not run NVidia quirks related to MSI with MSI disabled x86/PCI: use for_each_pci_dev() PCI: use for_each_pci_dev() PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc() PCI: export SMBIOS provided firmware instance and label to sysfs PCI: Allow read/write access to sysfs I/O port resources x86/PCI: use host bridge _CRS info on ASRock ALiveSATA2-GLAN PCI: remove unused HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_{SIZE|BOUNDARY} PCI: disable mmio during bar sizing PCI: MSI: Remove unsafe and unnecessary hardware access PCI: Default PCIe ASPM control to on and require !EMBEDDED to disable PCI: kernel oops on access to pci proc file while hot-removal PCI: pci-sysfs: remove casts from void* ACPI: Disable ASPM if the platform won't provide _OSC control for PCIe PCI hotplug: make sure child bridges are enabled at hotplug time PCI hotplug: shpchp: Removed check for hotplug of display devices PCI hotplug: pciehp: Fixed return value sign for pciehp_unconfigure_device PCI: Don't enable aspm before drivers have had a chance to veto it ...
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r--drivers/pci/pcie/Kconfig20
-rw-r--r--drivers/pci/pcie/aer/aerdrv_core.c17
-rw-r--r--drivers/pci/pcie/aspm.c16
3 files changed, 37 insertions, 16 deletions
diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig
index b8b494b3e0d0..dda70981b7a6 100644
--- a/drivers/pci/pcie/Kconfig
+++ b/drivers/pci/pcie/Kconfig
@@ -31,14 +31,22 @@ source "drivers/pci/pcie/aer/Kconfig"
31# PCI Express ASPM 31# PCI Express ASPM
32# 32#
33config PCIEASPM 33config PCIEASPM
34 bool "PCI Express ASPM support(Experimental)" 34 bool "PCI Express ASPM control" if EMBEDDED
35 depends on PCI && EXPERIMENTAL && PCIEPORTBUS 35 depends on PCI && PCIEPORTBUS
36 default n 36 default y
37 help 37 help
38 This enables PCI Express ASPM (Active State Power Management) and 38 This enables OS control over PCI Express ASPM (Active State
39 Clock Power Management. ASPM supports state L0/L0s/L1. 39 Power Management) and Clock Power Management. ASPM supports
40 state L0/L0s/L1.
40 41
41 When in doubt, say N. 42 ASPM is initially set up the the firmware. With this option enabled,
43 Linux can modify this state in order to disable ASPM on known-bad
44 hardware or configurations and enable it when known-safe.
45
46 ASPM can be disabled or enabled at runtime via
47 /sys/module/pcie_aspm/parameters/policy
48
49 When in doubt, say Y.
42config PCIEASPM_DEBUG 50config PCIEASPM_DEBUG
43 bool "Debug PCI Express ASPM" 51 bool "Debug PCI Express ASPM"
44 depends on PCIEASPM 52 depends on PCIEASPM
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
index 8af4f619bba2..fc0b5a93e1de 100644
--- a/drivers/pci/pcie/aer/aerdrv_core.c
+++ b/drivers/pci/pcie/aer/aerdrv_core.c
@@ -727,20 +727,21 @@ static void aer_isr_one_error(struct pcie_device *p_device,
727static int get_e_source(struct aer_rpc *rpc, struct aer_err_source *e_src) 727static int get_e_source(struct aer_rpc *rpc, struct aer_err_source *e_src)
728{ 728{
729 unsigned long flags; 729 unsigned long flags;
730 int ret = 0;
731 730
732 /* Lock access to Root error producer/consumer index */ 731 /* Lock access to Root error producer/consumer index */
733 spin_lock_irqsave(&rpc->e_lock, flags); 732 spin_lock_irqsave(&rpc->e_lock, flags);
734 if (rpc->prod_idx != rpc->cons_idx) { 733 if (rpc->prod_idx == rpc->cons_idx) {
735 *e_src = rpc->e_sources[rpc->cons_idx]; 734 spin_unlock_irqrestore(&rpc->e_lock, flags);
736 rpc->cons_idx++; 735 return 0;
737 if (rpc->cons_idx == AER_ERROR_SOURCES_MAX)
738 rpc->cons_idx = 0;
739 ret = 1;
740 } 736 }
737
738 *e_src = rpc->e_sources[rpc->cons_idx];
739 rpc->cons_idx++;
740 if (rpc->cons_idx == AER_ERROR_SOURCES_MAX)
741 rpc->cons_idx = 0;
741 spin_unlock_irqrestore(&rpc->e_lock, flags); 742 spin_unlock_irqrestore(&rpc->e_lock, flags);
742 743
743 return ret; 744 return 1;
744} 745}
745 746
746/** 747/**
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: