Commit 475b8d619268df9d26f1ab4e98bbac1d61233a25

Authored by Yonglong Liu
Committed by Greg Kroah-Hartman
1 parent 5fc02e8d1b

net: hns3: fix a TX timeout issue

[ Upstream commit a7e90ee5965fafc53d36e8b3205f08c88d7bc11f ]

When the queue depth and queue parameters are modified, there is
a low probability that TX timeout occurs. The two operations cause
the link to be down or up when the watchdog is still working. All
queues are stopped when the link is down. After the carrier is on,
all queues are woken up. If the watchdog detects the link between
the carrier on and wakeup queues, a false TX timeout occurs.

So fix this issue by modifying the sequence of carrier on and queue
wakeup, which is symmetrical to the link down action.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
... ... @@ -4014,8 +4014,8 @@
4014 4014 return;
4015 4015  
4016 4016 if (linkup) {
4017   - netif_carrier_on(netdev);
4018 4017 netif_tx_wake_all_queues(netdev);
  4018 + netif_carrier_on(netdev);
4019 4019 if (netif_msg_link(handle))
4020 4020 netdev_info(netdev, "link up\n");
4021 4021 } else {