Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

r8169: disable ASPM in case of tx timeout

There are still single reports of systems where ASPM incompatibilities
cause tx timeouts. It's not clear whom to blame, so let's disable
ASPM in case of a tx timeout.

v2:
- add one-time warning for informing the user

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://lore.kernel.org/r/92369a92-dc32-4529-0509-11459ba0e391@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Heiner Kallweit and committed by
Jakub Kicinski
80c0576e 62cd6679

+13 -1
+13 -1
drivers/net/ethernet/realtek/r8169_main.c
··· 576 576 enum rtl_flag { 577 577 RTL_FLAG_TASK_ENABLED = 0, 578 578 RTL_FLAG_TASK_RESET_PENDING, 579 + RTL_FLAG_TASK_TX_TIMEOUT, 579 580 RTL_FLAG_MAX 580 581 }; 581 582 ··· 3932 3931 { 3933 3932 struct rtl8169_private *tp = netdev_priv(dev); 3934 3933 3935 - rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING); 3934 + rtl_schedule_task(tp, RTL_FLAG_TASK_TX_TIMEOUT); 3936 3935 } 3937 3936 3938 3937 static int rtl8169_tx_map(struct rtl8169_private *tp, const u32 *opts, u32 len, ··· 4526 4525 { 4527 4526 struct rtl8169_private *tp = 4528 4527 container_of(work, struct rtl8169_private, wk.work); 4528 + int ret; 4529 4529 4530 4530 rtnl_lock(); 4531 4531 ··· 4534 4532 !test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags)) 4535 4533 goto out_unlock; 4536 4534 4535 + if (test_and_clear_bit(RTL_FLAG_TASK_TX_TIMEOUT, tp->wk.flags)) { 4536 + /* ASPM compatibility issues are a typical reason for tx timeouts */ 4537 + ret = pci_disable_link_state(tp->pci_dev, PCIE_LINK_STATE_L1 | 4538 + PCIE_LINK_STATE_L0S); 4539 + if (!ret) 4540 + netdev_warn_once(tp->dev, "ASPM disabled on Tx timeout\n"); 4541 + goto reset; 4542 + } 4543 + 4537 4544 if (test_and_clear_bit(RTL_FLAG_TASK_RESET_PENDING, tp->wk.flags)) { 4545 + reset: 4538 4546 rtl_reset_work(tp); 4539 4547 netif_wake_queue(tp->dev); 4540 4548 }