netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 netdev] net: phy: marvell: Limit errata to 88m1101
@ 2017-05-22 23:28 Andrew Lunn
  2017-05-23  5:49 ` Harini Katakam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Lunn @ 2017-05-22 23:28 UTC (permalink / raw)
  To: David Miller
  Cc: Daniel Walker, Harini Katakam, Florian Fainelli, netdev,
	Andrew Lunn

The 88m1101 has an errata when configuring autoneg. However, it was
being applied to many other Marvell PHYs as well. Limit its scope to
just the 88m1101.

Fixes: 76884679c644 ("phylib: Add support for Marvell 88e1111S and 88e1145")
Reported-by: Daniel Walker <danielwa@cisco.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---

v2:
	Forgot netdev 

 drivers/net/phy/marvell.c | 67 ++++++++++++++++++++++++++---------------------
 1 file changed, 37 insertions(+), 30 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 88cd97b44ba6..77221d3f254f 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -267,35 +267,6 @@ static int marvell_config_aneg(struct phy_device *phydev)
 {
 	int err;
 
-	/* The Marvell PHY has an errata which requires
-	 * that certain registers get written in order
-	 * to restart autonegotiation
-	 */
-	err = phy_write(phydev, MII_BMCR, BMCR_RESET);
-
-	if (err < 0)
-		return err;
-
-	err = phy_write(phydev, 0x1d, 0x1f);
-	if (err < 0)
-		return err;
-
-	err = phy_write(phydev, 0x1e, 0x200c);
-	if (err < 0)
-		return err;
-
-	err = phy_write(phydev, 0x1d, 0x5);
-	if (err < 0)
-		return err;
-
-	err = phy_write(phydev, 0x1e, 0);
-	if (err < 0)
-		return err;
-
-	err = phy_write(phydev, 0x1e, 0x100);
-	if (err < 0)
-		return err;
-
 	err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
 	if (err < 0)
 		return err;
@@ -328,6 +299,42 @@ static int marvell_config_aneg(struct phy_device *phydev)
 	return 0;
 }
 
+static int m88e1101_config_aneg(struct phy_device *phydev)
+{
+	int err;
+
+	/* This Marvell PHY has an errata which requires
+	 * that certain registers get written in order
+	 * to restart autonegotiation
+	 */
+	err = phy_write(phydev, MII_BMCR, BMCR_RESET);
+
+	if (err < 0)
+		return err;
+
+	err = phy_write(phydev, 0x1d, 0x1f);
+	if (err < 0)
+		return err;
+
+	err = phy_write(phydev, 0x1e, 0x200c);
+	if (err < 0)
+		return err;
+
+	err = phy_write(phydev, 0x1d, 0x5);
+	if (err < 0)
+		return err;
+
+	err = phy_write(phydev, 0x1e, 0);
+	if (err < 0)
+		return err;
+
+	err = phy_write(phydev, 0x1e, 0x100);
+	if (err < 0)
+		return err;
+
+	return marvell_config_aneg(phydev);
+}
+
 static int m88e1111_config_aneg(struct phy_device *phydev)
 {
 	int err;
@@ -1960,7 +1967,7 @@ static struct phy_driver marvell_drivers[] = {
 		.flags = PHY_HAS_INTERRUPT,
 		.probe = marvell_probe,
 		.config_init = &marvell_config_init,
-		.config_aneg = &marvell_config_aneg,
+		.config_aneg = &m88e1101_config_aneg,
 		.read_status = &genphy_read_status,
 		.ack_interrupt = &marvell_ack_interrupt,
 		.config_intr = &marvell_config_intr,
-- 
2.11.0

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

* RE: [PATCH v2 netdev] net: phy: marvell: Limit errata to 88m1101
  2017-05-22 23:28 [PATCH v2 netdev] net: phy: marvell: Limit errata to 88m1101 Andrew Lunn
@ 2017-05-23  5:49 ` Harini Katakam
  2017-05-23 14:00 ` Daniel Walker
  2017-05-23 15:19 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Harini Katakam @ 2017-05-23  5:49 UTC (permalink / raw)
  To: Andrew Lunn, David Miller
  Cc: Daniel Walker, Florian Fainelli, netdev,
	harinikatakamlinux@gmail.com



> -----Original Message-----
> From: Andrew Lunn [mailto:andrew@lunn.ch]
> Sent: Tuesday, May 23, 2017 4:59 AM
> To: David Miller <davem@davemloft.net>
> Cc: Daniel Walker <danielwa@cisco.com>; Harini Katakam
> <harinik@xilinx.com>; Florian Fainelli <f.fainelli@gmail.com>; netdev
> <netdev@vger.kernel.org>; Andrew Lunn <andrew@lunn.ch>
> Subject: [PATCH v2 netdev] net: phy: marvell: Limit errata to 88m1101
> 
> The 88m1101 has an errata when configuring autoneg. However, it was
> being applied to many other Marvell PHYs as well. Limit its scope to
> just the 88m1101.
> 
> Fixes: 76884679c644 ("phylib: Add support for Marvell 88e1111S and 88e1145")
> Reported-by: Daniel Walker <danielwa@cisco.com>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Acked-by: Harini Katakam <harinik@xilinx.com>

Regards,
Harini

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

* Re: [PATCH v2 netdev] net: phy: marvell: Limit errata to 88m1101
  2017-05-22 23:28 [PATCH v2 netdev] net: phy: marvell: Limit errata to 88m1101 Andrew Lunn
  2017-05-23  5:49 ` Harini Katakam
@ 2017-05-23 14:00 ` Daniel Walker
  2017-05-23 15:19 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Walker @ 2017-05-23 14:00 UTC (permalink / raw)
  To: Andrew Lunn, David Miller; +Cc: Harini Katakam, Florian Fainelli, netdev

On 05/22/2017 04:28 PM, Andrew Lunn wrote:
> The 88m1101 has an errata when configuring autoneg. However, it was
> being applied to many other Marvell PHYs as well. Limit its scope to
> just the 88m1101.
>
> Fixes: 76884679c644 ("phylib: Add support for Marvell 88e1111S and 88e1145")
> Reported-by: Daniel Walker <danielwa@cisco.com>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>
> v2:
> 	Forgot netdev
>
>   drivers/net/phy/marvell.c | 67 ++++++++++++++++++++++++++---------------------
>   1 file changed, 37 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index 88cd97b44ba6..77221d3f254f 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -267,35 +267,6 @@ static int marvell_config_aneg(struct phy_device *phydev)
>   {
>   	int err;
>   
> -	/* The Marvell PHY has an errata which requires
> -	 * that certain registers get written in order
> -	 * to restart autonegotiation
> -	 */
> -	err = phy_write(phydev, MII_BMCR, BMCR_RESET);
> -

It looks fine to me, but I'm not sure if this line BMCR_RESET was part 
of the errata or the comment. I guess it's OK to assume it tho.

Danie.

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

* Re: [PATCH v2 netdev] net: phy: marvell: Limit errata to 88m1101
  2017-05-22 23:28 [PATCH v2 netdev] net: phy: marvell: Limit errata to 88m1101 Andrew Lunn
  2017-05-23  5:49 ` Harini Katakam
  2017-05-23 14:00 ` Daniel Walker
@ 2017-05-23 15:19 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-05-23 15:19 UTC (permalink / raw)
  To: andrew; +Cc: danielwa, harini.katakam, f.fainelli, netdev

From: Andrew Lunn <andrew@lunn.ch>
Date: Tue, 23 May 2017 01:28:33 +0200

> The 88m1101 has an errata when configuring autoneg. However, it was
> being applied to many other Marvell PHYs as well. Limit its scope to
> just the 88m1101.
> 
> Fixes: 76884679c644 ("phylib: Add support for Marvell 88e1111S and 88e1145")
> Reported-by: Daniel Walker <danielwa@cisco.com>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

This patch is targetting 'net' but you generated it against 'net-next'
which had a comment formatting change made recently so this patch won't
apply to 'net'.

Please respin against 'net'.

Thanks.

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

end of thread, other threads:[~2017-05-23 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 23:28 [PATCH v2 netdev] net: phy: marvell: Limit errata to 88m1101 Andrew Lunn
2017-05-23  5:49 ` Harini Katakam
2017-05-23 14:00 ` Daniel Walker
2017-05-23 15:19 ` 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).