diff options
| -rw-r--r-- | drivers/pci/pcie/aspm.c | 21 |
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 | ||
| 553 | static int pcie_aspm_sanity_check(struct pci_dev *pdev) | 553 | static 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, ®32); |
| 573 | ®32); | ||
| 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; |
