linux/drivers/net/ethernet/renesas
Yoshihiro Shimoda 015c5d5e6a net: ethernet: ravb: exit if re-initialization fails in tx timeout
According to the report of [1], this driver is possible to cause
the following error in ravb_tx_timeout_work().

ravb e6800000.ethernet ethernet: failed to switch device to config mode

This error means that the hardware could not change the state
from "Operation" to "Configuration" while some tx and/or rx queue
are operating. After that, ravb_config() in ravb_dmac_init() will fail,
and then any descriptors will be not allocaled anymore so that NULL
pointer dereference happens after that on ravb_start_xmit().

To fix the issue, the ravb_tx_timeout_work() should check
the return values of ravb_stop_dma() and ravb_dmac_init().
If ravb_stop_dma() fails, ravb_tx_timeout_work() re-enables TX and RX
and just exits. If ravb_dmac_init() fails, just exits.

[1]
https://lore.kernel.org/linux-renesas-soc/20200518045452.2390-1-dirk.behme@de.bosch.com/

Reported-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-21 15:34:07 -07:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile ethernet: renesas: convert to SPDX identifiers 2018-09-10 10:11:53 -07:00
ravb.h ravb: implement MTU change while device is up 2019-11-14 18:05:25 -08:00
ravb_main.c net: ethernet: ravb: exit if re-initialization fails in tx timeout 2020-07-21 15:34:07 -07:00
ravb_ptp.c ptp: Introduce strict checking of external time stamp options. 2019-11-15 12:48:32 -08:00
sh_eth.c net: renesas: Fix use correct return type for ndo_start_xmit() 2020-05-06 14:13:39 -07:00
sh_eth.h sh_eth: use Gigabit register map for R7S72100 2020-02-16 19:44:41 -08:00