netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] stmmac: Fix phy without MDIO subnode
@ 2016-03-24 10:56 John Keeping
  2016-03-24 12:56 ` Giuseppe CAVALLARO
  2016-03-24 13:00 ` Sergei Shtylyov
  0 siblings, 2 replies; 8+ messages in thread
From: John Keeping @ 2016-03-24 10:56 UTC (permalink / raw)
  To: Giuseppe Cavallaro; +Cc: Gabriel Fernandez, netdev, linux-kernel, John Keeping

Since commit 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found'
regression") we no longer allocate mdio_bus_data unless there is a MDIO
subnode.  This breaks the ethernet on the Radxa Rock2 (using
rk3288-rock2-square.dts) which does not have an MDIO subnode.

That commit was correct that the phy_bus_name test is unhelpful since we
allocate "plat" in the same function and never set phy_bus_name so let's
just drop the test which restores the previous behaviour.

Fixes: 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found' regression")
Signed-off-by: John Keeping <john@metanate.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index dcbd2a1..e0fa060 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -189,7 +189,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
 	if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
 		dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
 
-	if ((plat->phy_node && !of_phy_is_fixed_link(np)) || !plat->mdio_node)
+	if ((plat->phy_node && !of_phy_is_fixed_link(np)))
 		plat->mdio_bus_data = NULL;
 	else
 		plat->mdio_bus_data =
-- 
2.7.0.226.gfe986fe

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

* Re: [PATCH] stmmac: Fix phy without MDIO subnode
  2016-03-24 10:56 [PATCH] stmmac: Fix phy without MDIO subnode John Keeping
@ 2016-03-24 12:56 ` Giuseppe CAVALLARO
  2016-03-24 17:01   ` John Keeping
  2016-03-24 13:00 ` Sergei Shtylyov
  1 sibling, 1 reply; 8+ messages in thread
From: Giuseppe CAVALLARO @ 2016-03-24 12:56 UTC (permalink / raw)
  To: John Keeping; +Cc: Gabriel Fernandez, netdev, linux-kernel

Hi John

This should be fixed by some work done some days
ago and not yet committed.

Pls see "stmmac: MDIO fixes" patch-set and let me know
if ok on your side.

Regards
Peppe

On 3/24/2016 11:56 AM, John Keeping wrote:
> Since commit 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found'
> regression") we no longer allocate mdio_bus_data unless there is a MDIO
> subnode.  This breaks the ethernet on the Radxa Rock2 (using
> rk3288-rock2-square.dts) which does not have an MDIO subnode.
>
> That commit was correct that the phy_bus_name test is unhelpful since we
> allocate "plat" in the same function and never set phy_bus_name so let's
> just drop the test which restores the previous behaviour.
>
> Fixes: 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found' regression")
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index dcbd2a1..e0fa060 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -189,7 +189,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
>   	if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
>   		dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
>
> -	if ((plat->phy_node && !of_phy_is_fixed_link(np)) || !plat->mdio_node)
> +	if ((plat->phy_node && !of_phy_is_fixed_link(np)))
>   		plat->mdio_bus_data = NULL;
>   	else
>   		plat->mdio_bus_data =
>

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

* Re: [PATCH] stmmac: Fix phy without MDIO subnode
  2016-03-24 10:56 [PATCH] stmmac: Fix phy without MDIO subnode John Keeping
  2016-03-24 12:56 ` Giuseppe CAVALLARO
@ 2016-03-24 13:00 ` Sergei Shtylyov
  1 sibling, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2016-03-24 13:00 UTC (permalink / raw)
  To: John Keeping, Giuseppe Cavallaro; +Cc: Gabriel Fernandez, netdev, linux-kernel

Hello.

On 3/24/2016 1:56 PM, John Keeping wrote:

> Since commit 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found'
> regression") we no longer allocate mdio_bus_data unless there is a MDIO
> subnode.  This breaks the ethernet on the Radxa Rock2 (using
> rk3288-rock2-square.dts) which does not have an MDIO subnode.
>
> That commit was correct that the phy_bus_name test is unhelpful since we
> allocate "plat" in the same function and never set phy_bus_name so let's
> just drop the test which restores the previous behaviour.
>
> Fixes: 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found' regression")
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index dcbd2a1..e0fa060 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -189,7 +189,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
>   	if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
>   		dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
>
> -	if ((plat->phy_node && !of_phy_is_fixed_link(np)) || !plat->mdio_node)
> +	if ((plat->phy_node && !of_phy_is_fixed_link(np)))

    Too many parens...

MBR, Sergei

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

* Re: [PATCH] stmmac: Fix phy without MDIO subnode
  2016-03-24 12:56 ` Giuseppe CAVALLARO
@ 2016-03-24 17:01   ` John Keeping
  2016-03-25  8:42     ` Giuseppe CAVALLARO
  0 siblings, 1 reply; 8+ messages in thread
From: John Keeping @ 2016-03-24 17:01 UTC (permalink / raw)
  To: Giuseppe CAVALLARO; +Cc: Gabriel Fernandez, netdev, linux-kernel

On Thu, 24 Mar 2016 13:56:02 +0100, Giuseppe CAVALLARO wrote:

> This should be fixed by some work done some days
> ago and not yet committed.
> 
> Pls see "stmmac: MDIO fixes" patch-set and let me know
> if ok on your side.

Yes, that works for me.


Thanks,
John

> On 3/24/2016 11:56 AM, John Keeping wrote:
> > Since commit 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found'
> > regression") we no longer allocate mdio_bus_data unless there is a MDIO
> > subnode.  This breaks the ethernet on the Radxa Rock2 (using
> > rk3288-rock2-square.dts) which does not have an MDIO subnode.
> >
> > That commit was correct that the phy_bus_name test is unhelpful since we
> > allocate "plat" in the same function and never set phy_bus_name so let's
> > just drop the test which restores the previous behaviour.
> >
> > Fixes: 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found' regression")
> > Signed-off-by: John Keeping <john@metanate.com>
> > ---
> >   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > index dcbd2a1..e0fa060 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > @@ -189,7 +189,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
> >   	if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
> >   		dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
> >
> > -	if ((plat->phy_node && !of_phy_is_fixed_link(np)) || !plat->mdio_node)
> > +	if ((plat->phy_node && !of_phy_is_fixed_link(np)))
> >   		plat->mdio_bus_data = NULL;
> >   	else
> >   		plat->mdio_bus_data =
> >  
> 

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

* Re: [PATCH] stmmac: Fix phy without MDIO subnode
  2016-03-24 17:01   ` John Keeping
@ 2016-03-25  8:42     ` Giuseppe CAVALLARO
  2016-03-30 18:22       ` Robert Gadsdon
  0 siblings, 1 reply; 8+ messages in thread
From: Giuseppe CAVALLARO @ 2016-03-25  8:42 UTC (permalink / raw)
  To: John Keeping; +Cc: Gabriel Fernandez, netdev, linux-kernel

On 3/24/2016 6:01 PM, John Keeping wrote:
> On Thu, 24 Mar 2016 13:56:02 +0100, Giuseppe CAVALLARO wrote:
>
>> This should be fixed by some work done some days
>> ago and not yet committed.
>>
>> Pls see "stmmac: MDIO fixes" patch-set and let me know
>> if ok on your side.
>
> Yes, that works for me.

thx John for having tested it on your side.

peppe

>
>
> Thanks,
> John
>
>> On 3/24/2016 11:56 AM, John Keeping wrote:
>>> Since commit 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found'
>>> regression") we no longer allocate mdio_bus_data unless there is a MDIO
>>> subnode.  This breaks the ethernet on the Radxa Rock2 (using
>>> rk3288-rock2-square.dts) which does not have an MDIO subnode.
>>>
>>> That commit was correct that the phy_bus_name test is unhelpful since we
>>> allocate "plat" in the same function and never set phy_bus_name so let's
>>> just drop the test which restores the previous behaviour.
>>>
>>> Fixes: 88f8b1bb41c6 ("stmmac: Fix 'eth0: No PHY found' regression")
>>> Signed-off-by: John Keeping <john@metanate.com>
>>> ---
>>>    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>>> index dcbd2a1..e0fa060 100644
>>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>>> @@ -189,7 +189,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
>>>    	if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
>>>    		dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
>>>
>>> -	if ((plat->phy_node && !of_phy_is_fixed_link(np)) || !plat->mdio_node)
>>> +	if ((plat->phy_node && !of_phy_is_fixed_link(np)))
>>>    		plat->mdio_bus_data = NULL;
>>>    	else
>>>    		plat->mdio_bus_data =
>>>
>>
>
>

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

* Re: [PATCH] stmmac: Fix phy without MDIO subnode
  2016-03-25  8:42     ` Giuseppe CAVALLARO
@ 2016-03-30 18:22       ` Robert Gadsdon
  2016-03-31  7:40         ` Giuseppe CAVALLARO
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Gadsdon @ 2016-03-30 18:22 UTC (permalink / raw)
  To: Giuseppe CAVALLARO, John Keeping; +Cc: Gabriel Fernandez, netdev, linux-kernel

I have applied this to my Rock2 - Kernel 4.6-rc1 - and eth0 is present,
now, but no network traffic gets through:

To rock2:
$ ping rgrock2
PING rgrock2 (192.168.0.xx) 56(84) bytes of data.
^C
--- rgrock2 ping statistics ---
9 packets transmitted, 0 received, 100% packet loss, time 7999ms

>From rock2:
# ping 192.168.0.x
PING 192.168.0.x (192.168.0.2) 56(84) bytes of data.
>From 192.168.0.xx icmp_seq=1 Destination Host Unreachable
>From 192.168.0.xx icmp_seq=2 Destination Host Unreachable
>From 192.168.0.xx icmp_seq=3 Destination Host Unreachable
>From 192.168.0.xx icmp_seq=4 Destination Host Unreachable
>From 192.168.0.xx icmp_seq=5 Destination Host Unreachable
>From 192.168.0.xx icmp_seq=6 Destination Host Unreachable
>From 192.168.0.xx icmp_seq=7 Destination Host Unreachable
>From 192.168.0.xx icmp_seq=8 Destination Host Unreachable

--- 192.168.0.x ping statistics ---
9 packets transmitted, 0 received, +8 errors, 100% packet loss, time 8001ms

Everything worked OK with kernel 4.5-rc7, and with 4.5 Final with the
-rc7 versions of stmmac_platform.c and stmmac_mdio.c substituted..

Robert Gadsdon. March 30, 2016

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

* Re: [PATCH] stmmac: Fix phy without MDIO subnode
  2016-03-30 18:22       ` Robert Gadsdon
@ 2016-03-31  7:40         ` Giuseppe CAVALLARO
  2016-03-31 17:30           ` Robert Gadsdon
  0 siblings, 1 reply; 8+ messages in thread
From: Giuseppe CAVALLARO @ 2016-03-31  7:40 UTC (permalink / raw)
  To: Robert Gadsdon, John Keeping; +Cc: Gabriel Fernandez, netdev, linux-kernel


Hello Robert

On 3/30/2016 8:22 PM, Robert Gadsdon wrote:
> I have applied this to my Rock2 - Kernel 4.6-rc1 - and eth0 is present,
> now, but no network traffic gets through:

there are some patches not yet applied that fix known
problems

pls take a look at :

"stmmac: MDIO fixes"

and

[PATCH (net-next.git)] STMMAC: fix TX Normal descriptor

peppe

>
> To rock2:
> $ ping rgrock2
> PING rgrock2 (192.168.0.xx) 56(84) bytes of data.
> ^C
> --- rgrock2 ping statistics ---
> 9 packets transmitted, 0 received, 100% packet loss, time 7999ms
>
>>From rock2:
> # ping 192.168.0.x
> PING 192.168.0.x (192.168.0.2) 56(84) bytes of data.
>>From 192.168.0.xx icmp_seq=1 Destination Host Unreachable
>>From 192.168.0.xx icmp_seq=2 Destination Host Unreachable
>>From 192.168.0.xx icmp_seq=3 Destination Host Unreachable
>>From 192.168.0.xx icmp_seq=4 Destination Host Unreachable
>>From 192.168.0.xx icmp_seq=5 Destination Host Unreachable
>>From 192.168.0.xx icmp_seq=6 Destination Host Unreachable
>>From 192.168.0.xx icmp_seq=7 Destination Host Unreachable
>>From 192.168.0.xx icmp_seq=8 Destination Host Unreachable
>
> --- 192.168.0.x ping statistics ---
> 9 packets transmitted, 0 received, +8 errors, 100% packet loss, time 8001ms
>
> Everything worked OK with kernel 4.5-rc7, and with 4.5 Final with the
> -rc7 versions of stmmac_platform.c and stmmac_mdio.c substituted..
>
> Robert Gadsdon. March 30, 2016
>

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

* Re: [PATCH] stmmac: Fix phy without MDIO subnode
  2016-03-31  7:40         ` Giuseppe CAVALLARO
@ 2016-03-31 17:30           ` Robert Gadsdon
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Gadsdon @ 2016-03-31 17:30 UTC (permalink / raw)
  To: Giuseppe CAVALLARO, John Keeping; +Cc: Gabriel Fernandez, netdev, linux-kernel

A have applied the 'STMMAC: fix TX normal DESC' patch (from netdev) as
well as the 'stmmac: Fix phy without MDIO subnode' patch, and the Rock2
Ethernet link now works correctly (Kernel 4.6-rc1)

Thanks..

Robert Gadsdon.

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

end of thread, other threads:[~2016-03-31 17:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24 10:56 [PATCH] stmmac: Fix phy without MDIO subnode John Keeping
2016-03-24 12:56 ` Giuseppe CAVALLARO
2016-03-24 17:01   ` John Keeping
2016-03-25  8:42     ` Giuseppe CAVALLARO
2016-03-30 18:22       ` Robert Gadsdon
2016-03-31  7:40         ` Giuseppe CAVALLARO
2016-03-31 17:30           ` Robert Gadsdon
2016-03-24 13:00 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).