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: reset bus if NIC isn't accessible after tx timeout

ASPM issues may result in the NIC not being accessible any longer.
In this case disabling ASPM may not work. Therefore detect this case
by checking whether register reads return ~0, and try to make the
NIC accessible again by resetting the secondary bus.

v2:
- add exception handling for the case that pci_reset_bus() fails

Suggested-by: Alexander Duyck <alexander.duyck@gmail.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Heiner Kallweit and committed by
David S. Miller
ce870af3 9627c981

+10
+10
drivers/net/ethernet/realtek/r8169_main.c
··· 4532 4532 goto out_unlock; 4533 4533 4534 4534 if (test_and_clear_bit(RTL_FLAG_TASK_TX_TIMEOUT, tp->wk.flags)) { 4535 + /* if chip isn't accessible, reset bus to revive it */ 4536 + if (RTL_R32(tp, TxConfig) == ~0) { 4537 + ret = pci_reset_bus(tp->pci_dev); 4538 + if (ret < 0) { 4539 + netdev_err(tp->dev, "Can't reset secondary PCI bus, detach NIC\n"); 4540 + netif_device_detach(tp->dev); 4541 + goto out_unlock; 4542 + } 4543 + } 4544 + 4535 4545 /* ASPM compatibility issues are a typical reason for tx timeouts */ 4536 4546 ret = pci_disable_link_state(tp->pci_dev, PCIE_LINK_STATE_L1 | 4537 4547 PCIE_LINK_STATE_L0S);