netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: phy: marvell: Only configure RGMII delays when using RGMII
@ 2017-10-31 19:31 Andrew Lunn
  2017-10-31 21:29 ` Aaro Koskinen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Lunn @ 2017-10-31 19:31 UTC (permalink / raw)
  To: Aaro Koskinen, David Miller; +Cc: netdev, Andrew Lunn

The fix 5987feb38aa5 ("net: phy: marvell: logical vs bitwise OR typo")
uncovered another bug in the Marvell PHY driver, which broke the
Marvell OpenRD platform. It relies on the bootloader configuring the
RGMII delays and does not specify a phy-mode in its device tree.  The
PHY driver should only configure RGMII delays if the phy mode
indicates it is using RGMII. Without anything in device tree, the
mv643xx Ethernet driver defaults to GMII.

Fixes: 5987feb38aa5 ("net: phy: marvell: logical vs bitwise OR typo")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---

Aaro

Please can you test this and see if it fixes your OpenRD. This should
cause it to leave the bootloader configuration alone. That will fix
the regression for older DT blobs. Adding correct phy-mode properties
can also be done. That would increase the robustness to bootloader
changes.

drivers/net/phy/marvell.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 15cbcdba618a..4d02b27df044 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -681,9 +681,11 @@ static int m88e1116r_config_init(struct phy_device *phydev)
 	if (err < 0)
 		return err;
 
-	err = m88e1121_config_aneg_rgmii_delays(phydev);
-	if (err < 0)
-		return err;
+	if (phy_interface_is_rgmii(phydev)) {
+		err = m88e1121_config_aneg_rgmii_delays(phydev);
+		if (err < 0)
+			return err;
+	}
 
 	err = genphy_soft_reset(phydev);
 	if (err < 0)
-- 
2.14.1

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

* Re: [PATCH net] net: phy: marvell: Only configure RGMII delays when using RGMII
  2017-10-31 19:31 [PATCH net] net: phy: marvell: Only configure RGMII delays when using RGMII Andrew Lunn
@ 2017-10-31 21:29 ` Aaro Koskinen
  2017-10-31 23:29 ` Florian Fainelli
  2017-11-01  2:26 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Aaro Koskinen @ 2017-10-31 21:29 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: David Miller, netdev

Hi,

On Tue, Oct 31, 2017 at 08:31:28PM +0100, Andrew Lunn wrote:
> The fix 5987feb38aa5 ("net: phy: marvell: logical vs bitwise OR typo")
> uncovered another bug in the Marvell PHY driver, which broke the
> Marvell OpenRD platform. It relies on the bootloader configuring the
> RGMII delays and does not specify a phy-mode in its device tree.  The
> PHY driver should only configure RGMII delays if the phy mode
> indicates it is using RGMII. Without anything in device tree, the
> mv643xx Ethernet driver defaults to GMII.
> 
> Fixes: 5987feb38aa5 ("net: phy: marvell: logical vs bitwise OR typo")
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>

> Aaro
> 
> Please can you test this and see if it fixes your OpenRD. This should
> cause it to leave the bootloader configuration alone. That will fix
> the regression for older DT blobs. Adding correct phy-mode properties
> can also be done. That would increase the robustness to bootloader
> changes.

Thanks, and yes, I guess also the DT should be updated...

A.

> drivers/net/phy/marvell.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index 15cbcdba618a..4d02b27df044 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -681,9 +681,11 @@ static int m88e1116r_config_init(struct phy_device *phydev)
>  	if (err < 0)
>  		return err;
>  
> -	err = m88e1121_config_aneg_rgmii_delays(phydev);
> -	if (err < 0)
> -		return err;
> +	if (phy_interface_is_rgmii(phydev)) {
> +		err = m88e1121_config_aneg_rgmii_delays(phydev);
> +		if (err < 0)
> +			return err;
> +	}
>  
>  	err = genphy_soft_reset(phydev);
>  	if (err < 0)
> -- 
> 2.14.1
> 

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

* Re: [PATCH net] net: phy: marvell: Only configure RGMII delays when using RGMII
  2017-10-31 19:31 [PATCH net] net: phy: marvell: Only configure RGMII delays when using RGMII Andrew Lunn
  2017-10-31 21:29 ` Aaro Koskinen
@ 2017-10-31 23:29 ` Florian Fainelli
  2017-11-01  2:26 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2017-10-31 23:29 UTC (permalink / raw)
  To: Andrew Lunn, Aaro Koskinen, David Miller; +Cc: netdev

On 10/31/2017 12:31 PM, Andrew Lunn wrote:
> The fix 5987feb38aa5 ("net: phy: marvell: logical vs bitwise OR typo")
> uncovered another bug in the Marvell PHY driver, which broke the
> Marvell OpenRD platform. It relies on the bootloader configuring the
> RGMII delays and does not specify a phy-mode in its device tree.  The
> PHY driver should only configure RGMII delays if the phy mode
> indicates it is using RGMII. Without anything in device tree, the
> mv643xx Ethernet driver defaults to GMII.
> 
> Fixes: 5987feb38aa5 ("net: phy: marvell: logical vs bitwise OR typo")
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH net] net: phy: marvell: Only configure RGMII delays when using RGMII
  2017-10-31 19:31 [PATCH net] net: phy: marvell: Only configure RGMII delays when using RGMII Andrew Lunn
  2017-10-31 21:29 ` Aaro Koskinen
  2017-10-31 23:29 ` Florian Fainelli
@ 2017-11-01  2:26 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-11-01  2:26 UTC (permalink / raw)
  To: andrew; +Cc: aaro.koskinen, netdev

From: Andrew Lunn <andrew@lunn.ch>
Date: Tue, 31 Oct 2017 20:31:28 +0100

> The fix 5987feb38aa5 ("net: phy: marvell: logical vs bitwise OR typo")
> uncovered another bug in the Marvell PHY driver, which broke the
> Marvell OpenRD platform. It relies on the bootloader configuring the
> RGMII delays and does not specify a phy-mode in its device tree.  The
> PHY driver should only configure RGMII delays if the phy mode
> indicates it is using RGMII. Without anything in device tree, the
> mv643xx Ethernet driver defaults to GMII.
> 
> Fixes: 5987feb38aa5 ("net: phy: marvell: logical vs bitwise OR typo")
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Applied, thanks Andrew.

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

end of thread, other threads:[~2017-11-01  2:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 19:31 [PATCH net] net: phy: marvell: Only configure RGMII delays when using RGMII Andrew Lunn
2017-10-31 21:29 ` Aaro Koskinen
2017-10-31 23:29 ` Florian Fainelli
2017-11-01  2:26 ` David Miller

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