net: stmmac: bump tc when get underflow error from DMA descriptor
authorXiaoliang Yang <xiaoliang.yang_1@nxp.com>
Wed, 8 Dec 2021 10:06:51 +0000 (18:06 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Dec 2021 12:20:35 +0000 (12:20 +0000)
commit3a6c12a0c6c3f857f47efe0e40011360063a35bc
tree2a5a083867c3e3509999ad3f02ab96cd7d5442f4
parent9b5bcb193a3bba4b96ead86df52602e3951655ba
net: stmmac: bump tc when get underflow error from DMA descriptor

In DMA threshold mode, frame underflow errors may sometimes occur when
the TC(threshold control) value is not enough. The TC value need to be
bumped up in this case.

There is no underflow interrupt bit on DMA_CH(#i)_Status of dwmac4, so
the DMA threshold cannot be bumped up in stmmac_dma_interrupt(). The
i.mx8mp board observed an underflow error while running NFS boot, the
NFS rootfs could not be mounted.

The underflow error can be got from the DMA descriptor TDES3 on dwmac4.
This patch bump up tc value once underflow error is got from TDES3.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c