[PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards

Sascha Hauer sha at pengutronix.de
Mon Oct 4 04:26:07 PDT 2021


On Tue, Aug 31, 2021 at 05:32:14PM +0200, Ahmad Fatoum wrote:
> The STM32MP1 boards call their mdio subnode mdio0, which is now skipped
> since ed8c7bdf8592 ("net: designware: eqos: set mdio bus device node").
> 
> Fix networking for them by only falling back to the mdio node name when a
> child node with the correct compatible could not be found.
> 
> Fixes: ed8c7bdf8592 ("net: designware: eqos: set mdio bus device node")
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
>  drivers/net/designware_eqos.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/designware_eqos.c b/drivers/net/designware_eqos.c
> index f83ec127143c..5eee844e289a 100644
> --- a/drivers/net/designware_eqos.c
> +++ b/drivers/net/designware_eqos.c
> @@ -824,6 +824,7 @@ static void eqos_probe_dt(struct device_d *dev, struct eqos *eqos)
>  
>  int eqos_probe(struct device_d *dev, const struct eqos_ops *ops, void *priv)
>  {
> +	struct device_node *np = dev->device_node;
>  	struct mii_bus *miibus;
>  	struct resource *iores;
>  	struct eqos *eqos;
> @@ -862,7 +863,10 @@ int eqos_probe(struct device_d *dev, const struct eqos_ops *ops, void *priv)
>  	miibus->read = eqos_mdio_read;
>  	miibus->write = eqos_mdio_write;
>  	miibus->priv = eqos;
> -	miibus->dev.device_node = of_get_child_by_name(dev->device_node, "mdio");
> +
> +	miibus->dev.device_node = of_get_compatible_child(np, "snps,dwmac-mdio");
> +	if (!miibus->dev.device_node)
> +		miibus->dev.device_node = of_get_child_by_name(np, "mdio");

Do we need this fallback? I think I introduced ed8c7bdf8592 for the
rk3568, which also should work without the fallback.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list