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: <20241004212711.422811-1-qingtao.cao@digi.com>
Date: Sat,  5 Oct 2024 07:27:11 +1000
From: Qingtao Cao <qingtao.cao.au@...il.com>
To: 
Cc: Qingtao Cao <qingtao.cao@...i.com>,
	Andrew Lunn <andrew@...n.ch>,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH net-next v4 1/1] net: phy: marvell: make use of fiber autoneg bypass mode

88E151x supports the SGMII autoneg bypass mode and it defaults to be
enabled. When it is activated, the device assumes a link-up status so
avoid bringing down fibre link in this case

Test case:
1. Two 88E151x are connected with SFP
2. One enables autoneg while the other is 1000BASE-X
3. On the one with autoneg, the link can still be up with this change
   otherwise not

Signed-off-by: Qingtao Cao <qingtao.cao@...i.com>
---
 drivers/net/phy/marvell.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 9964bf3dea2f..6d48add9dc0a 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -195,6 +195,9 @@
 
 #define MII_88E1510_MSCR_2		0x15
 
+#define MII_88E151X_FSCR2		0x1a
+#define MII_88E151X_FSCR2_BYPASS_STATUS	BIT(5)
+
 #define MII_VCT5_TX_RX_MDI0_COUPLING	0x10
 #define MII_VCT5_TX_RX_MDI1_COUPLING	0x11
 #define MII_VCT5_TX_RX_MDI2_COUPLING	0x12
@@ -1623,12 +1626,24 @@ static void fiber_lpa_mod_linkmode_lpa_t(unsigned long *advertising, u32 lpa)
 static int marvell_read_status_page_an(struct phy_device *phydev,
 				       int fiber, int status)
 {
+	int fscr2;
 	int lpa;
 	int err;
 
 	if (!(status & MII_M1011_PHY_STATUS_RESOLVED)) {
 		phydev->link = 0;
-		return 0;
+		if (!fiber)
+			return 0;
+
+		/* Already on page 1 for fibre */
+		fscr2 = phy_read(phydev, MII_88E151X_FSCR2);
+		if (fscr2 < 0)
+			return fscr2;
+
+		if (!(fscr2 & MII_88E151X_FSCR2_BYPASS_STATUS))
+			return 0;
+
+		phydev->link = 1;
 	}
 
 	if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ