[PATCH 1/5] net: designware: eqos: initialize MAC address specific DMA channel configuration

Thorsten Scherer T.Scherer at eckelmann.de
Fri Aug 11 23:22:10 PDT 2023


Hello Oleksij,

On Fri, Aug 11, 2023 at 10:40:24AM +0200, Oleksij Rempel wrote:
> 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.

Typos in commit message:

s/thins/things/
s/fart/far/
s/know/known/

> 
> Signed-off-by: Oleksij Rempel <o.rempel at 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
> 
> 

Kind regards
Thorsten

--
Thorsten Scherer | Eckelmann AG | www.eckelmann.de |



More information about the barebox mailing list