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: <20250210120933.1981517-1-Raju.Rangoju@amd.com>
Date: Mon, 10 Feb 2025 17:39:33 +0530
From: Raju Rangoju <Raju.Rangoju@....com>
To: <netdev@...r.kernel.org>
CC: <kuba@...nel.org>, <pabeni@...hat.com>, <edumazet@...gle.com>,
	<davem@...emloft.net>, <andrew+netdev@...n.ch>, Raju Rangoju
	<Raju.Rangoju@....com>, Shyam Sundar S K <Shyam-sundar.S-k@....com>
Subject: [PATCH net-next] amd-xgbe: re-initiate auto-negotiation for Broadcom PHYs

Some PHYs on certain platforms may show a successful link after setting
the speed to 100Mbps through auto-negotiation (AN) even when
10M/100M/1G concurrent speed is configured. However, they may not be
able to transmit or receive data. These PHYs need an "additional
auto-negotiation (AN) cycle" after the speed change, to function correctly.

A quirk for these PHYs is that if the outcome of the AN leads to a
change in speed, the AN should be re-initiated at the new speed.

Signed-off-by: Raju Rangoju <Raju.Rangoju@....com>
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@....com>
---
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 21 +++++++++++++++++++++
 drivers/net/ethernet/amd/xgbe/xgbe.h        |  3 +++
 2 files changed, 24 insertions(+)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 268399dfcf22..4a9477554937 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -921,6 +921,24 @@ static void xgbe_phy_free_phy_device(struct xgbe_prv_data *pdata)
 	}
 }
 
+static bool xgbe_phy_broadcom_phy_quirks(struct xgbe_prv_data *pdata)
+{
+	struct xgbe_phy_data *phy_data = pdata->phy_data;
+	unsigned int phy_id = phy_data->phydev->phy_id;
+	unsigned int ver;
+
+	ver = XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER);
+
+	/* For Broadcom PHY, use the extra AN flag */
+	if (ver == SNPS_MAC_VER_0x21 && (phy_id & 0xffffffff) == 0x600d8595) {
+		dev_dbg(pdata->dev, "Broadcom PHY quirk in place\n");
+		pdata->an_again = 1;
+		return true;
+	}
+
+	return false;
+}
+
 static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
 {
 	struct xgbe_phy_data *phy_data = pdata->phy_data;
@@ -1035,6 +1053,9 @@ static void xgbe_phy_external_phy_quirks(struct xgbe_prv_data *pdata)
 
 	if (xgbe_phy_finisar_phy_quirks(pdata))
 		return;
+
+	if (xgbe_phy_broadcom_phy_quirks(pdata))
+		return;
 }
 
 static int xgbe_phy_find_phy_device(struct xgbe_prv_data *pdata)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
index d85386cac8d1..543206976da6 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
@@ -249,6 +249,9 @@
 
 #define XGBE_TC_MIN_QUANTUM	10
 
+/* SNPS MAC version */
+#define SNPS_MAC_VER_0x21	0x21
+
 /* Helper macro for descriptor handling
  *  Always use XGBE_GET_DESC_DATA to access the descriptor data
  *  since the index is free-running and needs to be and-ed
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ