RE: [PATCH] net: usb: r8152: fix transmit queue timeout

From: Hayes Wang

Date: Sun Jan 18 2026 - 21:51:58 EST


Original Message-----
> From: lu lu <insyelu@xxxxxxxxx>
[...]
> if (netif_queue_stopped(tp->netdev)) {
> if (skb_queue_len(&tp->tx_queue) < tp->tx_qlen)
> netif_wake_queue(tp->netdev);
> else
> netif_trans_update(tp->netdev);
> }
> The first time xmit stops the transmit queue, the queue is not full,
> and it is successfully woken up afterward — OK.
> The second time xmit stops the transmit queue, the network watchdog
> times out immediately because the transmit timestamp was not refreshed
> when the queue was last resumed — FAIL.
> This scenario is logically possible.

This situation should not happen, because trans_start is also updated when the driver stops the TX queue.

https://elixir.bootlin.com/linux/v6.18.6/source/include/linux/netdevice.h#L3629

A TX timeout occurs only if the TX queue has been stopped for longer than RTL8152_TX_TIMEOUT.
It should not occur immediately when the driver stops the TX queue.

Therefore, what needs to be done is to update the timestamp when the TX queue is stopped.
Updating trans_start while the TX queue is not stopped is useless.

Best Regards,
Hayes