diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/realtek/r8169_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 2e2a74aa025c..48b8a90f7057 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c | |||
@@ -652,6 +652,7 @@ struct rtl8169_private { | |||
652 | 652 | ||
653 | unsigned irq_enabled:1; | 653 | unsigned irq_enabled:1; |
654 | unsigned supports_gmii:1; | 654 | unsigned supports_gmii:1; |
655 | unsigned aspm_manageable:1; | ||
655 | dma_addr_t counters_phys_addr; | 656 | dma_addr_t counters_phys_addr; |
656 | struct rtl8169_counters *counters; | 657 | struct rtl8169_counters *counters; |
657 | struct rtl8169_tc_offsets tc_offset; | 658 | struct rtl8169_tc_offsets tc_offset; |
@@ -4286,7 +4287,8 @@ static void rtl_pcie_state_l2l3_disable(struct rtl8169_private *tp) | |||
4286 | 4287 | ||
4287 | static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable) | 4288 | static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable) |
4288 | { | 4289 | { |
4289 | if (enable) { | 4290 | /* Don't enable ASPM in the chip if OS can't control ASPM */ |
4291 | if (enable && tp->aspm_manageable) { | ||
4290 | RTL_W8(tp, Config5, RTL_R8(tp, Config5) | ASPM_en); | 4292 | RTL_W8(tp, Config5, RTL_R8(tp, Config5) | ASPM_en); |
4291 | RTL_W8(tp, Config2, RTL_R8(tp, Config2) | ClkReqEn); | 4293 | RTL_W8(tp, Config2, RTL_R8(tp, Config2) | ClkReqEn); |
4292 | } else { | 4294 | } else { |
@@ -6678,7 +6680,9 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
6678 | /* Disable ASPM completely as that cause random device stop working | 6680 | /* Disable ASPM completely as that cause random device stop working |
6679 | * problems as well as full system hangs for some PCIe devices users. | 6681 | * problems as well as full system hangs for some PCIe devices users. |
6680 | */ | 6682 | */ |
6681 | pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); | 6683 | rc = pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | |
6684 | PCIE_LINK_STATE_L1); | ||
6685 | tp->aspm_manageable = !rc; | ||
6682 | 6686 | ||
6683 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ | 6687 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ |
6684 | rc = pcim_enable_device(pdev); | 6688 | rc = pcim_enable_device(pdev); |