diff options
Diffstat (limited to 'drivers/pci/pcie/aspm.c')
-rw-r--r-- | drivers/pci/pcie/aspm.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 0ec649d961d7..17ac1dce3286 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c | |||
@@ -351,12 +351,26 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) | |||
351 | return; | 351 | return; |
352 | } | 352 | } |
353 | 353 | ||
354 | /* Get upstream/downstream components' register state */ | ||
355 | pcie_get_aspm_reg(parent, &upreg); | ||
356 | child = list_entry(linkbus->devices.next, struct pci_dev, bus_list); | ||
357 | pcie_get_aspm_reg(child, &dwreg); | ||
358 | |||
359 | /* | ||
360 | * If ASPM not supported, don't mess with the clocks and link, | ||
361 | * bail out now. | ||
362 | */ | ||
363 | if (!(upreg.support & dwreg.support)) | ||
364 | return; | ||
365 | |||
354 | /* Configure common clock before checking latencies */ | 366 | /* Configure common clock before checking latencies */ |
355 | pcie_aspm_configure_common_clock(link); | 367 | pcie_aspm_configure_common_clock(link); |
356 | 368 | ||
357 | /* Get upstream/downstream components' register state */ | 369 | /* |
370 | * Re-read upstream/downstream components' register state | ||
371 | * after clock configuration | ||
372 | */ | ||
358 | pcie_get_aspm_reg(parent, &upreg); | 373 | pcie_get_aspm_reg(parent, &upreg); |
359 | child = list_entry(linkbus->devices.next, struct pci_dev, bus_list); | ||
360 | pcie_get_aspm_reg(child, &dwreg); | 374 | pcie_get_aspm_reg(child, &dwreg); |
361 | 375 | ||
362 | /* | 376 | /* |
@@ -886,8 +900,8 @@ static ssize_t clk_ctl_store(struct device *dev, | |||
886 | return n; | 900 | return n; |
887 | } | 901 | } |
888 | 902 | ||
889 | static DEVICE_ATTR(link_state, 0644, link_state_show, link_state_store); | 903 | static DEVICE_ATTR_RW(link_state); |
890 | static DEVICE_ATTR(clk_ctl, 0644, clk_ctl_show, clk_ctl_store); | 904 | static DEVICE_ATTR_RW(clk_ctl); |
891 | 905 | ||
892 | static char power_group[] = "power"; | 906 | static char power_group[] = "power"; |
893 | void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) | 907 | void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) |