OrangePi_CM5/drivers/net/ethernet/renesas
Yoshihiro Shimoda 47bc9c3929 net: renesas: sh_eth: Fix freeing wrong tx descriptor
[ Upstream commit 0341d5e3d1ee2a36dd5a49b5bef2ce4ad1cfa6b4 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-22 12:28:06 +02:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile
…
ravb.h ravb: Add support for explicit internal clock delay configuration 2020-10-01 12:53:31 -07:00
ravb_main.c net: renesas: ravb: Fix a stuck issue when a lot of frames are received 2021-05-14 09:50:41 +02:00
ravb_ptp.c
…
sh_eth.c net: renesas: sh_eth: Fix freeing wrong tx descriptor 2021-09-22 12:28:06 +02:00
sh_eth.h sh_eth: use Gigabit register map for R7S72100 2020-02-16 19:44:41 -08:00