aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie/aspm.c
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2009-05-12 23:23:09 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-06-18 17:02:22 -0400
commit3647584d9ef35c9ec4abefdbea29959c26c54f13 (patch)
tree107167bb680a15c1581dfb3f05737cfe514c6c29 /drivers/pci/pcie/aspm.c
parentefdf8288819df67d608a186f9d17a7d4051f3c1f (diff)
PCI ASPM: cleanup pcie_aspm_sanity_check
Minor cleanup for pcie_aspm_sanity_check(). Acked-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pcie/aspm.c')
-rw-r--r--drivers/pci/pcie/aspm.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 26fd39caebc5..04b6a3098505 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -552,27 +552,24 @@ static void free_link_state(struct pcie_link_state *link)
552 552
553static int pcie_aspm_sanity_check(struct pci_dev *pdev) 553static int pcie_aspm_sanity_check(struct pci_dev *pdev)
554{ 554{
555 struct pci_dev *child_dev; 555 struct pci_dev *child;
556 int child_pos; 556 int pos;
557 u32 reg32; 557 u32 reg32;
558
559 /* 558 /*
560 * Some functions in a slot might not all be PCIE functions, very 559 * Some functions in a slot might not all be PCIE functions,
561 * strange. Disable ASPM for the whole slot 560 * very strange. Disable ASPM for the whole slot
562 */ 561 */
563 list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list) { 562 list_for_each_entry(child, &pdev->subordinate->devices, bus_list) {
564 child_pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP); 563 pos = pci_find_capability(child, PCI_CAP_ID_EXP);
565 if (!child_pos) 564 if (!pos)
566 return -EINVAL; 565 return -EINVAL;
567
568 /* 566 /*
569 * Disable ASPM for pre-1.1 PCIe device, we follow MS to use 567 * Disable ASPM for pre-1.1 PCIe device, we follow MS to use
570 * RBER bit to determine if a function is 1.1 version device 568 * RBER bit to determine if a function is 1.1 version device
571 */ 569 */
572 pci_read_config_dword(child_dev, child_pos + PCI_EXP_DEVCAP, 570 pci_read_config_dword(child, pos + PCI_EXP_DEVCAP, &reg32);
573 &reg32);
574 if (!(reg32 & PCI_EXP_DEVCAP_RBER) && !aspm_force) { 571 if (!(reg32 & PCI_EXP_DEVCAP_RBER) && !aspm_force) {
575 dev_printk(KERN_INFO, &child_dev->dev, "disabling ASPM" 572 dev_printk(KERN_INFO, &child->dev, "disabling ASPM"
576 " on pre-1.1 PCIe device. You can enable it" 573 " on pre-1.1 PCIe device. You can enable it"
577 " with 'pcie_aspm=force'\n"); 574 " with 'pcie_aspm=force'\n");
578 return -EINVAL; 575 return -EINVAL;