1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/micrel
Ronald Wahl 7a99afef17 net: ks8851: Fix potential TX stall after interface reopen
The amount of TX space in the hardware buffer is tracked in the tx_space
variable. The initial value is currently only set during driver probing.

After closing the interface and reopening it the tx_space variable has
the last value it had before close. If it is smaller than the size of
the first send packet after reopeing the interface the queue will be
stopped. The queue is woken up after receiving a TX interrupt but this
will never happen since we did not send anything.

This commit moves the initialization of the tx_space variable to the
ks8851_net_open function right before starting the TX queue. Also query
the value from the hardware instead of using a hard coded value.

Only the SPI chip variant is affected by this issue because only this
driver variant actually depends on the tx_space variable in the xmit
function.

Fixes: 3dc5d44545 ("net: ks8851: Fix TX stall caused by TX buffer overrun")
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org
Cc: stable@vger.kernel.org # 5.10+
Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20240709195845.9089-1-rwahl@gmx.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-07-11 11:52:29 +02:00
..
Kconfig net: micrel: Fix KS8851 Kconfig 2022-04-05 17:32:05 -07:00
ks8842.c net: ethernet: micrel: Convert to platform remove callback returning void 2023-09-20 09:06:39 +01:00
ks8851.h net: ks8851: Inline ks8851_rx_skb() 2024-04-08 19:48:47 -07:00
ks8851_common.c net: ks8851: Fix potential TX stall after interface reopen 2024-07-11 11:52:29 +02:00
ks8851_par.c net: ks8851: Inline ks8851_rx_skb() 2024-04-08 19:48:47 -07:00
ks8851_spi.c net: ks8851: Fix deadlock with the SPI chip variant 2024-07-09 13:37:23 +02:00
ksz884x.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
Makefile net: ks8851: fix link error 2021-09-28 13:11:20 +01:00