diff options
author | J. Neuschäfer <j.ne@posteo.net> | 2025-02-16 22:18:13 +0100 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2025-03-03 14:18:49 +0800 |
commit | 63a23cb4656703661f1f8f271ca29e2334d42520 (patch) | |
tree | d4e78fc164243994d0c578199bc21263b4a83cf6 | |
parent | a149456d6a5457abe0187eb38a8ccb5d1da1bf0f (diff) |
net: tsec: Re-arm packet buffer in error case
When an error is detected in the TSEC receive path, the driver currently
prints an error message, but leaves the corresponding packet descriptor
in its old state (i.e. owned by the CPU side). As a result, the packet
queue can be starved of available buffers if enough errors happen.
To recover from errors, re-arm the packet buffer descriptor after an
error has been detected.
Errors can be provoked by changing a PHY with phy-mode = "rgmii-id" to
phy-mode = "rgmii".
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r-- | drivers/net/tsec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index b27fc322db5..bd4ebdd745a 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -314,6 +314,9 @@ static int tsec_recv(struct udevice *dev, int flags, uchar **packetp) ret = length - 4; } else { printf("Got error %x\n", (status & RXBD_STATS)); + + /* Rearm the packet buffer */ + tsec_free_pkt(dev, NULL, 0); } } |