All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] net: phy: dp83867: enable robust auto-mdix
@ 2019-10-23 14:48 Grygorii Strashko
  2019-10-23 14:48 ` [PATCH 1/2] " Grygorii Strashko
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Grygorii Strashko @ 2019-10-23 14:48 UTC (permalink / raw)
  To: David S. Miller, netdev, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Sekhar Nori, linux-kernel, Grygorii Strashko

Hi

Patch 1 - improves link detection when dp83867 PHY is configured in manual mode
by enabling CFG3[9] Robust Auto-MDIX option.

Patch 2 - is minor optimization.

Grygorii Strashko (2):
  net: phy: dp83867: enable robust auto-mdix
  net: phy: dp83867: move dt parsing to probe

 drivers/net/phy/dp83867.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

-- 
2.17.1


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

* [PATCH 1/2] net: phy: dp83867: enable robust auto-mdix
  2019-10-23 14:48 [PATCH 0/2] net: phy: dp83867: enable robust auto-mdix Grygorii Strashko
@ 2019-10-23 14:48 ` Grygorii Strashko
  2019-10-23 15:38   ` Andrew Lunn
  2019-10-24  2:38   ` Florian Fainelli
  2019-10-23 14:48 ` [PATCH 2/2] net: phy: dp83867: move dt parsing to probe Grygorii Strashko
  2019-10-26  2:25 ` [PATCH 0/2] net: phy: dp83867: enable robust auto-mdix David Miller
  2 siblings, 2 replies; 8+ messages in thread
From: Grygorii Strashko @ 2019-10-23 14:48 UTC (permalink / raw)
  To: David S. Miller, netdev, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Sekhar Nori, linux-kernel, Grygorii Strashko

The link detection timeouts can be observed (or link might not be detected
at all) when dp83867 PHY is configured in manual mode (speed/duplexity).

CFG3[9] Robust Auto-MDIX option allows significantly improve link detection
in case dp83867 is configured in manual mode and reduce link detection
time.
As per DM: "If link partners are configured to operational modes that are
not supported by normal Auto MDI/MDIX mode (like Auto-Neg versus Force
100Base-TX or Force 100Base-TX versus Force 100Base-TX), this Robust Auto
MDI/MDIX mode allows MDI/MDIX resolution and prevents deadlock."

Hence, enable this option by default as there are no known reasons
not to do so.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/net/phy/dp83867.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 37fceaf9fa10..cf4455bbf888 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -95,6 +95,10 @@
 #define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK	(0x1f << 8)
 #define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT	8
 
+/* CFG3 bits */
+#define DP83867_CFG3_INT_OE			BIT(7)
+#define DP83867_CFG3_ROBUST_AUTO_MDIX		BIT(9)
+
 /* CFG4 bits */
 #define DP83867_CFG4_PORT_MIRROR_EN              BIT(0)
 
@@ -410,12 +414,13 @@ static int dp83867_config_init(struct phy_device *phydev)
 		phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_SGMIICTL, val);
 	}
 
+	val = phy_read(phydev, DP83867_CFG3);
 	/* Enable Interrupt output INT_OE in CFG3 register */
-	if (phy_interrupt_is_valid(phydev)) {
-		val = phy_read(phydev, DP83867_CFG3);
-		val |= BIT(7);
-		phy_write(phydev, DP83867_CFG3, val);
-	}
+	if (phy_interrupt_is_valid(phydev))
+		val |= DP83867_CFG3_INT_OE;
+
+	val |= DP83867_CFG3_ROBUST_AUTO_MDIX;
+	phy_write(phydev, DP83867_CFG3, val);
 
 	if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP)
 		dp83867_config_port_mirroring(phydev);
-- 
2.17.1


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

* [PATCH 2/2] net: phy: dp83867: move dt parsing to probe
  2019-10-23 14:48 [PATCH 0/2] net: phy: dp83867: enable robust auto-mdix Grygorii Strashko
  2019-10-23 14:48 ` [PATCH 1/2] " Grygorii Strashko
@ 2019-10-23 14:48 ` Grygorii Strashko
  2019-10-23 15:37   ` Andrew Lunn
  2019-10-24  2:39   ` Florian Fainelli
  2019-10-26  2:25 ` [PATCH 0/2] net: phy: dp83867: enable robust auto-mdix David Miller
  2 siblings, 2 replies; 8+ messages in thread
From: Grygorii Strashko @ 2019-10-23 14:48 UTC (permalink / raw)
  To: David S. Miller, netdev, Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: Sekhar Nori, linux-kernel, Grygorii Strashko

Move DT parsing code to probe dp83867_probe() as it's one time operation.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/net/phy/dp83867.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index cf4455bbf888..5816a06a9439 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -299,7 +299,7 @@ static int dp83867_probe(struct phy_device *phydev)
 
 	phydev->priv = dp83867;
 
-	return 0;
+	return dp83867_of_init(phydev);
 }
 
 static int dp83867_config_init(struct phy_device *phydev)
@@ -308,10 +308,6 @@ static int dp83867_config_init(struct phy_device *phydev)
 	int ret, val, bs;
 	u16 delay;
 
-	ret = dp83867_of_init(phydev);
-	if (ret)
-		return ret;
-
 	/* RX_DV/RX_CTRL strapped in mode 1 or mode 2 workaround */
 	if (dp83867->rxctrl_strap_quirk)
 		phy_clear_bits_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4,
-- 
2.17.1


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

* Re: [PATCH 2/2] net: phy: dp83867: move dt parsing to probe
  2019-10-23 14:48 ` [PATCH 2/2] net: phy: dp83867: move dt parsing to probe Grygorii Strashko
@ 2019-10-23 15:37   ` Andrew Lunn
  2019-10-24  2:39   ` Florian Fainelli
  1 sibling, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2019-10-23 15:37 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: David S. Miller, netdev, Florian Fainelli, Heiner Kallweit,
	Sekhar Nori, linux-kernel

On Wed, Oct 23, 2019 at 05:48:46PM +0300, Grygorii Strashko wrote:
> Move DT parsing code to probe dp83867_probe() as it's one time operation.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH 1/2] net: phy: dp83867: enable robust auto-mdix
  2019-10-23 14:48 ` [PATCH 1/2] " Grygorii Strashko
@ 2019-10-23 15:38   ` Andrew Lunn
  2019-10-24  2:38   ` Florian Fainelli
  1 sibling, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2019-10-23 15:38 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: David S. Miller, netdev, Florian Fainelli, Heiner Kallweit,
	Sekhar Nori, linux-kernel

On Wed, Oct 23, 2019 at 05:48:45PM +0300, Grygorii Strashko wrote:
> The link detection timeouts can be observed (or link might not be detected
> at all) when dp83867 PHY is configured in manual mode (speed/duplexity).
> 
> CFG3[9] Robust Auto-MDIX option allows significantly improve link detection
> in case dp83867 is configured in manual mode and reduce link detection
> time.
> As per DM: "If link partners are configured to operational modes that are
> not supported by normal Auto MDI/MDIX mode (like Auto-Neg versus Force
> 100Base-TX or Force 100Base-TX versus Force 100Base-TX), this Robust Auto
> MDI/MDIX mode allows MDI/MDIX resolution and prevents deadlock."
> 
> Hence, enable this option by default as there are no known reasons
> not to do so.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH 1/2] net: phy: dp83867: enable robust auto-mdix
  2019-10-23 14:48 ` [PATCH 1/2] " Grygorii Strashko
  2019-10-23 15:38   ` Andrew Lunn
@ 2019-10-24  2:38   ` Florian Fainelli
  1 sibling, 0 replies; 8+ messages in thread
From: Florian Fainelli @ 2019-10-24  2:38 UTC (permalink / raw)
  To: Grygorii Strashko, David S. Miller, netdev, Andrew Lunn, Heiner Kallweit
  Cc: Sekhar Nori, linux-kernel



On 10/23/2019 7:48 AM, Grygorii Strashko wrote:
> The link detection timeouts can be observed (or link might not be detected
> at all) when dp83867 PHY is configured in manual mode (speed/duplexity).

s/duplexity/duplex/

> 
> CFG3[9] Robust Auto-MDIX option allows significantly improve link detection

allows to

> in case dp83867 is configured in manual mode and reduce link detection
> time.
> As per DM: "If link partners are configured to operational modes that are
> not supported by normal Auto MDI/MDIX mode (like Auto-Neg versus Force
> 100Base-TX or Force 100Base-TX versus Force 100Base-TX), this Robust Auto
> MDI/MDIX mode allows MDI/MDIX resolution and prevents deadlock."
> 
> Hence, enable this option by default as there are no known reasons
> not to do so.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

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

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

* Re: [PATCH 2/2] net: phy: dp83867: move dt parsing to probe
  2019-10-23 14:48 ` [PATCH 2/2] net: phy: dp83867: move dt parsing to probe Grygorii Strashko
  2019-10-23 15:37   ` Andrew Lunn
@ 2019-10-24  2:39   ` Florian Fainelli
  1 sibling, 0 replies; 8+ messages in thread
From: Florian Fainelli @ 2019-10-24  2:39 UTC (permalink / raw)
  To: Grygorii Strashko, David S. Miller, netdev, Andrew Lunn, Heiner Kallweit
  Cc: Sekhar Nori, linux-kernel



On 10/23/2019 7:48 AM, Grygorii Strashko wrote:
> Move DT parsing code to probe dp83867_probe() as it's one time operation.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

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

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

* Re: [PATCH 0/2] net: phy: dp83867: enable robust auto-mdix
  2019-10-23 14:48 [PATCH 0/2] net: phy: dp83867: enable robust auto-mdix Grygorii Strashko
  2019-10-23 14:48 ` [PATCH 1/2] " Grygorii Strashko
  2019-10-23 14:48 ` [PATCH 2/2] net: phy: dp83867: move dt parsing to probe Grygorii Strashko
@ 2019-10-26  2:25 ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2019-10-26  2:25 UTC (permalink / raw)
  To: grygorii.strashko
  Cc: netdev, andrew, f.fainelli, hkallweit1, nsekhar, linux-kernel

From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Wed, 23 Oct 2019 17:48:44 +0300

> Patch 1 - improves link detection when dp83867 PHY is configured in manual mode
> by enabling CFG3[9] Robust Auto-MDIX option.
> 
> Patch 2 - is minor optimization.

Series applied to net-next.

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

end of thread, other threads:[~2019-10-26  2:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23 14:48 [PATCH 0/2] net: phy: dp83867: enable robust auto-mdix Grygorii Strashko
2019-10-23 14:48 ` [PATCH 1/2] " Grygorii Strashko
2019-10-23 15:38   ` Andrew Lunn
2019-10-24  2:38   ` Florian Fainelli
2019-10-23 14:48 ` [PATCH 2/2] net: phy: dp83867: move dt parsing to probe Grygorii Strashko
2019-10-23 15:37   ` Andrew Lunn
2019-10-24  2:39   ` Florian Fainelli
2019-10-26  2:25 ` [PATCH 0/2] net: phy: dp83867: enable robust auto-mdix David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.