Skip to contentSkip to conversation

net: ks8851: Reset internal RXFC count on bad packet

PATCH New Marek Vasut 2 participants 2 messages Jan 6, 2021 – Jan 19, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ks8851: Reset internal RXFC count on bad packet

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.

Cc Eugen Hristev <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>

---
NOTE: This should likely also be applied to 2021.01

 drivers/net/ks8851_mll.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ks8851_mll.c +2 -1
index 58e065cdcc2..48c8d499cf4 100644
@@ -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;
 }
 
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/1 net: ks8851: Reset internal RXFC count on bad packet

Quoted 8 lines · Marek Vasut

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.

Quoted 4 lines
Cc Eugen Hristev <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210119/8509494a/attachment.sig>