lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220915090258.2154767-1-yong.liang.choong@linux.intel.com>
Date:   Thu, 15 Sep 2022 05:02:58 -0400
From:   Choong Yong Liang <yong.liang.choong@...ux.intel.com>
To:     "David S . Miller" <davem@...emloft.net>,
        Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Dan Murphy <dmurphy@...com>
Cc:     Song Yoong Siang <yoong.siang.song@...el.com>,
        Cacho Gerome <g-cacho@...com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH net 1/1] net: phy: dp83867: perform phy reset after modifying auto-neg setting

From: Song Yoong Siang <yoong.siang.song@...el.com>

In the case where TI DP83867 is connected back-to-back with another TI
DP83867, SEEDs match will occurs when advertised link speed is changed from
100 Mbps to 1 Gbps, which causing Master/Slave resolution fails and restart
of the auto-negotiation. As a result, TI DP83867 copper auto-negotiation
completion will takes up to 15 minutes.

To resolve the issue, this patch implemented phy reset (software restart
which perform a full reset, but not including registers) immediately after
modifying auto-negotiation setting. By applying reset to the phy, it would
also reset the lfsr which would increase the probability of SEEDS being
different and help in Master/Slave resolution. Gerome from TI has confirmed
that there is no harm in adding soft restart in auto-negotiation
programming flow, even though the system is not facing SEEDs match issue.

Fixes: 2a10154abcb7 ("net: phy: dp83867: Add TI dp83867 phy")
Cc: <stable@...r.kernel.org> # 5.4.x
Signed-off-by: Song Yoong Siang <yoong.siang.song@...el.com>
Reviewed-by: Cacho Gerome <g-cacho@...com>
Signed-off-by: Choong Yong Liang <yong.liang.choong@...ux.intel.com>
---
 drivers/net/phy/dp83867.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 6939563d3b7c..6e4b10f35696 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -925,6 +925,17 @@ static void dp83867_link_change_notify(struct phy_device *phydev)
 	}
 }
 
+static int dp83867_config_aneg(struct phy_device *phydev)
+{
+	int err;
+
+	err = genphy_config_aneg(phydev);
+	if (err < 0)
+		return err;
+
+	return dp83867_phy_reset(phydev);
+}
+
 static struct phy_driver dp83867_driver[] = {
 	{
 		.phy_id		= DP83867_PHY_ID,
@@ -951,6 +962,7 @@ static struct phy_driver dp83867_driver[] = {
 		.resume		= genphy_resume,
 
 		.link_change_notify = dp83867_link_change_notify,
+		.config_aneg	= dp83867_config_aneg,
 	},
 };
 module_phy_driver(dp83867_driver);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ