public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] net: ks8851: Reset internal RXFC count on bad packet
@ 2021-01-06 14:16 Marek Vasut
  2021-01-19 20:01 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Vasut @ 2021-01-06 14:16 UTC (permalink / raw)
  To: u-boot

A sporadic condition occurs when the "bad packet" error is triggered
repeatedly, which results in "bad packet" messages scrolling on the
console during transfer. To avoid triggering this, reset the internal
RXFC count on the first occurance of the "bad packet", which forces
the code to re-read the RX packet count from the MAC, and prevents
any additional "bad packet" messages if there are no more packets in
the MAC. Also print better debug information if this condition occurs.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Tom Rini <trini@konsulko.com>
---
NOTE: This should likely also be applied to 2021.01

 drivers/net/ks8851_mll.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
index 58e065cdcc2..48c8d499cf4 100644
--- a/drivers/net/ks8851_mll.c
+++ b/drivers/net/ks8851_mll.c
@@ -251,7 +251,8 @@ static int ks_rcv(struct ks_net *ks, uchar *data)
 	}
 
 	ks_wrreg16(ks, KS_RXQCR, RXQCR_CMD_CNTL | RXQCR_RRXEF);
-	printf(DRIVERNAME ": bad packet\n");
+	printf(DRIVERNAME ": bad packet (sts=0x%04x len=0x%04x)\n", sts, len);
+	ks->rxfc = 0;
 	return 0;
 }
 
-- 
2.29.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-19 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-06 14:16 [PATCH] net: ks8851: Reset internal RXFC count on bad packet Marek Vasut
2021-01-19 20:01 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox