linux/drivers/net/ethernet/renesas
Yoshihiro Shimoda 0341d5e3d1 net: renesas: sh_eth: Fix freeing wrong tx descriptor
The cur_tx counter must be incremented after TACT bit of
txdesc->status was set. However, a CPU is possible to reorder
instructions and/or memory accesses between cur_tx and
txdesc->status. And then, if TX interrupt happened at such a
timing, the sh_eth_tx_free() may free the descriptor wrongly.
So, add wmb() before cur_tx++.
Otherwise NETDEV WATCHDOG timeout is possible to happen.

Fixes: 86a74ff21a ("net: sh_eth: add support for Renesas SuperH Ethernet")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-09-07 14:02:02 +01:00
..
Kconfig ethernet: fix PTP_1588_CLOCK dependencies 2021-08-13 17:49:05 -07:00
Makefile ethernet: renesas: convert to SPDX identifiers 2018-09-10 10:11:53 -07:00
ravb_main.c ravb: Add reset support 2021-08-25 11:18:17 +01:00
ravb_ptp.c ravb: Add multi_irq to struct ravb_hw_info 2021-08-25 11:18:16 +01:00
ravb.h ravb: Add reset support 2021-08-25 11:18:17 +01:00
sh_eth.c net: renesas: sh_eth: Fix freeing wrong tx descriptor 2021-09-07 14:02:02 +01:00
sh_eth.h sh_eth: place RX/TX descriptor *enum*s after their *struct*s 2021-03-12 17:50:42 -08:00