mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/5] net: designware: eqos: initialize MAC address specific DMA channel configuration
@ 2023-08-11  8:40 Oleksij Rempel
  2023-08-11  8:40 ` [PATCH 2/5] net: designware: eqos: fix non-working promisc mode when set before interface start Oleksij Rempel
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Oleksij Rempel @ 2023-08-11  8:40 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Make sure we use predictable DMA Channel Select configuration. Otherwise
bad thins may happen.
So fart this fix is not related to any know issue and was noticed by
investigating other bugs.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/designware_eqos.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/designware_eqos.c b/drivers/net/designware_eqos.c
index 5e5c9ebe68..845f9f51ef 100644
--- a/drivers/net/designware_eqos.c
+++ b/drivers/net/designware_eqos.c
@@ -351,6 +351,11 @@ int eqos_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
 
 	memcpy(eqos->macaddr, mac, ETH_ALEN);
 
+	/* mac_hi is only partially overwritten by the following code. Part of
+	 * this variable is DCS (DMA Channel Select). If this variable is not
+	 * zeroed, we may get some random DMA RX channel.
+	 */
+	mac_hi = 0;
 	/* Update the MAC address */
 	memcpy(&mac_hi, &mac[4], 2);
 	memcpy(&mac_lo, &mac[0], 4);
-- 
2.39.2




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

end of thread, other threads:[~2023-08-12  6:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-11  8:40 [PATCH 1/5] net: designware: eqos: initialize MAC address specific DMA channel configuration Oleksij Rempel
2023-08-11  8:40 ` [PATCH 2/5] net: designware: eqos: fix non-working promisc mode when set before interface start Oleksij Rempel
2023-08-11  8:40 ` [PATCH 3/5] net: designware: eqos: add comment about external clock dependencies for the soft reset Oleksij Rempel
2023-08-11  8:40 ` [PATCH 4/5] net: designware: eqos: fix NULL pointer dereference on LLDP packets Oleksij Rempel
2023-08-11  8:40 ` [PATCH 5/5] net: designware: eqos: do not receive pause frames Oleksij Rempel
2023-08-12  6:22 ` [PATCH 1/5] net: designware: eqos: initialize MAC address specific DMA channel configuration Thorsten Scherer

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