mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards
@ 2021-08-31 15:32 Ahmad Fatoum
  2021-09-02  7:00 ` Rouven Czerwinski
  2021-10-04 11:26 ` Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2021-08-31 15:32 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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@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");
 
 	ret = eqos_init(dev, eqos);
 	if (ret)
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards
  2021-08-31 15:32 [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards Ahmad Fatoum
@ 2021-09-02  7:00 ` Rouven Czerwinski
  2021-10-04 11:26 ` Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Rouven Czerwinski @ 2021-09-02  7:00 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox

Hi,

On Tue, 2021-08-31 at 17:32 +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@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");
>  
>  	ret = eqos_init(dev, eqos);
>  	if (ret)

Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>

Regards,
Rouven


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards
  2021-08-31 15:32 [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards Ahmad Fatoum
  2021-09-02  7:00 ` Rouven Czerwinski
@ 2021-10-04 11:26 ` Sascha Hauer
  2021-10-04 11:39   ` Ahmad Fatoum
  1 sibling, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2021-10-04 11:26 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

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@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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards
  2021-10-04 11:26 ` Sascha Hauer
@ 2021-10-04 11:39   ` Ahmad Fatoum
  2021-11-05  7:51     ` Ahmad Fatoum
  0 siblings, 1 reply; 6+ messages in thread
From: Ahmad Fatoum @ 2021-10-04 11:39 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hello Sascha,

On 04.10.21 13:26, Sascha Hauer wrote:
> 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@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.

Linux driver uses "mdio" node name for snps,dwc-qos-ethernet-4.10 and looks
at compatible otherwise. That's why I chose to keep support for both.

> 
> 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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards
  2021-10-04 11:39   ` Ahmad Fatoum
@ 2021-11-05  7:51     ` Ahmad Fatoum
  2021-11-05  9:20       ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Ahmad Fatoum @ 2021-11-05  7:51 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hello Sascha,

On 04.10.21 13:39, Ahmad Fatoum wrote:
> Hello Sascha,
> 
> On 04.10.21 13:26, Sascha Hauer wrote:
>> 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@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.
> 
> Linux driver uses "mdio" node name for snps,dwc-qos-ethernet-4.10 and looks
> at compatible otherwise. That's why I chose to keep support for both.

STM32MP1 support in master is broken. Can this be cherry picked?

Thanks,
Ahmad

> 
>>
>> 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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards
  2021-11-05  7:51     ` Ahmad Fatoum
@ 2021-11-05  9:20       ` Sascha Hauer
  0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2021-11-05  9:20 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Fri, Nov 05, 2021 at 08:51:01AM +0100, Ahmad Fatoum wrote:
> Hello Sascha,
> 
> On 04.10.21 13:39, Ahmad Fatoum wrote:
> > Hello Sascha,
> > 
> > On 04.10.21 13:26, Sascha Hauer wrote:
> >> 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@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.
> > 
> > Linux driver uses "mdio" node name for snps,dwc-qos-ethernet-4.10 and looks
> > at compatible otherwise. That's why I chose to keep support for both.
> 
> STM32MP1 support in master is broken. Can this be cherry picked?

Just did that.

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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2021-11-05  9:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 15:32 [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards Ahmad Fatoum
2021-09-02  7:00 ` Rouven Czerwinski
2021-10-04 11:26 ` Sascha Hauer
2021-10-04 11:39   ` Ahmad Fatoum
2021-11-05  7:51     ` Ahmad Fatoum
2021-11-05  9:20       ` Sascha Hauer

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