All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs
@ 2022-02-05 21:49 Pavel Parkhomenko
  2022-02-05 22:02 ` Andrew Lunn
  2022-02-06 11:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Parkhomenko @ 2022-02-05 21:49 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Jakub Kicinski, Ron Madrid
  Cc: Alexey Malahov, Serge Semin, Serge Semin, stable, netdev, linux-kernel

When setting up autonegotiation for 88E1118R and compatible PHYs,
a software reset of PHY is issued before setting up polarity.
This is incorrect as changes of MDI Crossover Mode bits are
disruptive to the normal operation and must be followed by a
software reset to take effect. Let's patch m88e1118_config_aneg()
to fix the issue mentioned before by invoking software reset
of the PHY just after setting up MDI-x polarity.

Fixes: 605f196efbf8 ("phy: Add support for Marvell 88E1118 PHY")
Signed-off-by: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Cc: stable@vger.kernel.org
---
 drivers/net/phy/marvell.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index fa71fb7a66b5..ab063961ac00 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1213,16 +1213,15 @@ static int m88e1118_config_aneg(struct phy_device *phydev)
 {
 	int err;
 
-	err = genphy_soft_reset(phydev);
+	err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
 	if (err < 0)
 		return err;
 
-	err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
+	err = genphy_config_aneg(phydev);
 	if (err < 0)
 		return err;
 
-	err = genphy_config_aneg(phydev);
-	return 0;
+	return genphy_soft_reset(phydev);
 }
 
 static int m88e1118_config_init(struct phy_device *phydev)
-- 
2.32.0


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

* Re: [PATCH net] net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs
  2022-02-05 21:49 [PATCH net] net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs Pavel Parkhomenko
@ 2022-02-05 22:02 ` Andrew Lunn
  2022-02-06 11:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2022-02-05 22:02 UTC (permalink / raw)
  To: Pavel Parkhomenko
  Cc: Heiner Kallweit, Russell King, David S. Miller, Jakub Kicinski,
	Ron Madrid, Alexey Malahov, Serge Semin, Serge Semin, stable,
	netdev, linux-kernel

On Sun, Feb 06, 2022 at 12:49:51AM +0300, Pavel Parkhomenko wrote:
> When setting up autonegotiation for 88E1118R and compatible PHYs,
> a software reset of PHY is issued before setting up polarity.
> This is incorrect as changes of MDI Crossover Mode bits are
> disruptive to the normal operation and must be followed by a
> software reset to take effect. Let's patch m88e1118_config_aneg()
> to fix the issue mentioned before by invoking software reset
> of the PHY just after setting up MDI-x polarity.
> 
> Fixes: 605f196efbf8 ("phy: Add support for Marvell 88E1118 PHY")
> Signed-off-by: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
> Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
> Cc: stable@vger.kernel.org

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

    Andrew

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

* Re: [PATCH net] net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs
  2022-02-05 21:49 [PATCH net] net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs Pavel Parkhomenko
  2022-02-05 22:02 ` Andrew Lunn
@ 2022-02-06 11:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-02-06 11:10 UTC (permalink / raw)
  To: Pavel Parkhomenko
  Cc: andrew, hkallweit1, linux, davem, kuba, ron_madrid,
	Alexey.Malahov, Sergey.Semin, fancer.lancer, stable, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Sun, 6 Feb 2022 00:49:51 +0300 you wrote:
> When setting up autonegotiation for 88E1118R and compatible PHYs,
> a software reset of PHY is issued before setting up polarity.
> This is incorrect as changes of MDI Crossover Mode bits are
> disruptive to the normal operation and must be followed by a
> software reset to take effect. Let's patch m88e1118_config_aneg()
> to fix the issue mentioned before by invoking software reset
> of the PHY just after setting up MDI-x polarity.
> 
> [...]

Here is the summary with links:
  - [net] net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs
    https://git.kernel.org/netdev/net/c/aec12836e719

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-02-06 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-05 21:49 [PATCH net] net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs Pavel Parkhomenko
2022-02-05 22:02 ` Andrew Lunn
2022-02-06 11:10 ` patchwork-bot+netdevbpf

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.