From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D29F44077; Mon, 20 May 2024 12:42:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A80794069D; Mon, 20 May 2024 12:42:40 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2044.outbound.protection.outlook.com [40.107.220.44]) by mails.dpdk.org (Postfix) with ESMTP id 5E5EB402F0 for ; Mon, 20 May 2024 12:42:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HbJYpNBm9xeOZSyC4CgAiRRKnOSnUjtf1dQCCXPYUQa19+pH/ZhcN0eGLosUV7X69bKX2ChFUCJD6NQRSMTqcyGJyQvAxoT1jvELX5F4x39xxbMSfI4XmReof+HMh9eHhPWZyTHMFnFZrVojWD0rcS0yM+qlz7fGazYpj0eX8voNz6fjAQbVcje19utJd0CG5NhihZECLKrtgqQp7PQmfBEmTq0CHQcqt7niZZCSZBcpd0GJeUfO1CjAkyT5kmN2qOYbH2l5CWgf9i/KxyTFDXBqWE2qq0AIzUT5BFz/eRkd5uKhBU6bHVAbfsRx465gkSua15M0NRbGKLZBF9520w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IMFibmQv7kAoEXAqP9YP/0xgUPdMSEQ9boG+IQQWYV8=; b=TzaOdFp6EtzKHAl9NPDVaALV+RG2zKyNX5hFduy2w460iWnDAPi8lIVTUVVqXmfGeMl26pQXDR0ORf3k3/IlAevU2RwvLpm/qxkGfu4yI5mksVbVSl7pS1HXlG5bxtpLi4jg1+5Q/dHx/KnOKu35zNj16ZJJcpVJj0kaR2zlZk8Tl3R925cMX3G86xViwqJpSkmSs3GHT7bSvrc7fU9mqu8UQzK2EF4E6ggcWEy9nTrEcIkyze8Rwkro6OR8uC/nZovaV7UR1KEWjeVV+idTgukkh0gkQpvW9KWgH4RBw3IfH6v4jcJfcuJCzP907qAZg2G939BQtRO585LPSlncrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IMFibmQv7kAoEXAqP9YP/0xgUPdMSEQ9boG+IQQWYV8=; b=IKhb1zhJUHlcTqMSmY8yrCPiLSAclzgTg3AsWYQSQEHuAt2dHhEeedvKz2ACntJO5X3v2qTHRBt+mOzPfmg6QemG0M/DzqoqpdxFNxkJadNsawtUm0KQwCsUahZgFtN9amCOlcKG4aYAe3fFcwopQViLcY9eQq3jJsl8qqEt2Ss= Received: from DM4PR12MB5055.namprd12.prod.outlook.com (2603:10b6:5:39a::20) by CY8PR12MB7123.namprd12.prod.outlook.com (2603:10b6:930:60::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Mon, 20 May 2024 10:42:36 +0000 Received: from DM4PR12MB5055.namprd12.prod.outlook.com ([fe80::acbd:ea93:4496:51a5]) by DM4PR12MB5055.namprd12.prod.outlook.com ([fe80::acbd:ea93:4496:51a5%7]) with mapi id 15.20.7587.035; Mon, 20 May 2024 10:42:36 +0000 From: "Sebastian, Selwin" To: "Ande, Venkat Kumar" , "dev@dpdk.org" Subject: RE: [PATCH v2 15/25] net/axgbe: improve SFP 100Mbps auto-negotiation Thread-Topic: [PATCH v2 15/25] net/axgbe: improve SFP 100Mbps auto-negotiation Thread-Index: AQHaoHxDtWa/qCAxW0WkEHsXq5L3JLGgA97Q Date: Mon, 20 May 2024 10:42:36 +0000 Message-ID: References: <20240412125013.10498-1-VenkatKumar.Ande@amd.com> <20240507124305.2318-1-venkatkumar.ande@amd.com> <20240507124305.2318-15-venkatkumar.ande@amd.com> In-Reply-To: <20240507124305.2318-15-venkatkumar.ande@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_ActionId=617d71d3-160c-4a3f-baed-d127a1a36c0f; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_ContentBits=0; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Enabled=true; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Method=Standard; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Name=AMD Internal Distribution Only; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_SetDate=2024-05-20T10:42:32Z; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR12MB5055:EE_|CY8PR12MB7123:EE_ x-ms-office365-filtering-correlation-id: 672fafac-88ca-4ead-b8a4-08dc78b99024 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|1800799015|366007|376005|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?B1zbY7qMt3QhAZO9vvmvFxdDAUp9J+KQMffTjNCHOKnGb4r2B4NS6lvHirLe?= =?us-ascii?Q?Fj3n604Wls+adA13Ve3yEZxAtTW7Xyqw3vcfx36Bar6aaDmkkgr5/WyZuOx3?= =?us-ascii?Q?a8DQPnM+hBo5vBJdarfUOoQpdYiPS10EqHRpTTbKknZ4E5CsiqVQO1Cmn2tb?= =?us-ascii?Q?kxzJzHt19d8+1PAcA9PQLGBk/78VFv2IJWQLQaqqnuLbdhgQ3LhhBoquvNsB?= =?us-ascii?Q?NMO/Q0dTlAn78JAH4u66OiI1XWstwASBP3tHYlzfEejULWORnSrcLXBBht85?= =?us-ascii?Q?1xwSOd7Y5B+OzuNRnzJpIueCWmQP7EYWUb8zx3WVeN4Z189GaaKKWDT2drvU?= =?us-ascii?Q?86xEd2Dnx6WQ/q2vbgkwLUV0uKcjqhid663dXeRvro1DKRyME8Yd4I+IDPCM?= =?us-ascii?Q?v539WIUdj4GJMCdA/UxKnTAq9uKuS6xcRj3JXEl8i6Qpt9vnt4UVx3Iklbn8?= =?us-ascii?Q?peQALbja0pGCiuyJE1xb7Qjqdz+7Cp1SAPP6gW00inDpP7CZmLYTjV2JJEM0?= =?us-ascii?Q?W+zJbJoRb42PorY7bZ4EcTC22Q+AZnzosBwAHCsKz4MAGo6NPFB8CyG7MAfY?= =?us-ascii?Q?COblhzXRshTUSjzCCHXCMyIk62cZcwPooFIo19oVcv1iyBOxQf1lsYd4re+K?= =?us-ascii?Q?P2OuliNF6PlRouSOm8mA1DK0XtJXeF+EY/WVeW21Q9MoeHeg7HEMqbgxSEQt?= =?us-ascii?Q?FRW1WTdiFhbnhx5A/jkDgpF8lND7lUfQtmpaiuDO9RhnrJ2B4ECLn1Se2mLd?= =?us-ascii?Q?OJDU3aiebNsK2q4aTT1ZkwewgnON4tSLbL6lfg5mpilr2o0prVKbBQpx9urm?= =?us-ascii?Q?pFhMgVwoF672PsrQuRgRWHIzxDDFpkJG1uRsqbPkoLtU9mU8Ww6H7KTWSv58?= =?us-ascii?Q?YMLcquUxzZaLlkXSxdxy/t86iQVYgV5GMmhyOW+kNGGt/le1EI1dyTW3nmaS?= =?us-ascii?Q?0/XknJr6j8sG7+X4sxi/EXOvpJg9b8A5QRnS5JIRnRd/ZWBVdIdS4kRaJ9D/?= =?us-ascii?Q?zS29z/PS1WkDKOawkD6Ml1xw1Ir/UtHkTq/fhA2BPbCWU+k0+77Kn4v0PIyb?= =?us-ascii?Q?NLfEhiMNUUgPmXbLzzn5e2Uli3PS8KMk0MWodN8YVCsxcHFAR4Cjgzqeo7fr?= =?us-ascii?Q?/kJ+7yGC38ACDwzoS7/iHhsR8StCh/eAEFRQQY2OTsx5nskVyqo2EGbIF8KN?= =?us-ascii?Q?a/oUPsNp+NJAq+SNcEo6qgLiq5xY17s7aZnRgH6zZ8SHsVIPn2dyCz39PRvn?= =?us-ascii?Q?hUkfOXEBifDzOyNd6Ti78BV0T+5qS9BGl+AGZGi1uThhheyAjHu1DyKhB1Pn?= =?us-ascii?Q?AOhvQE7J7p+jJ7SAuMlYPdWkmpzBwF5xI90iiQ/18Egzcw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5055.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(366007)(376005)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UyrEkLX9b3icvFovegIx8Fw9QsB9pQDNBxTnGsHRLxF4UW7rLDSIIPgpr+Tx?= =?us-ascii?Q?OUec6QRsXNhDhuyz194A3fo7meM63yJtp7m1aJUKCvnFw0z3u98r5eg1C1oJ?= =?us-ascii?Q?8ZBKamPy58e0bvNm9u7TSEzPTVKlR7R5SopB/cdxJRa0apJgdKta5egWwVUl?= =?us-ascii?Q?OGhX1PqNSPz5AZj8AejfN7490+EDsaZi/x+oNhtSIVBq3j+qf3tgXwq66DZK?= =?us-ascii?Q?B9zz4CqyNB0hIghQWm7r5n/RqMoeLnpV6e35K3pAINy0iFgbDU8r21KGwIQa?= =?us-ascii?Q?WtAlOjtls0rwnGxu9wWa3EfygFfwpkMdmVwkXQlenAXQYS/nQ99kNxwjMKyv?= =?us-ascii?Q?NjumQugq+P8RfMy1PTcRWbk20M0SyLlPTsFuyeHm7jT64NT2GlGHo9Y0w1NH?= =?us-ascii?Q?egc6YaU/DGiOQYpZtMq5W9OYsaxJHXjBBWNmiGqV//+3kAq65PMJPZU+r1Qt?= =?us-ascii?Q?d4fVxO0rbP0kMGYNPwXje+9hiXJp9deaTjDVoFPG//LcK1eRfIrauWTiAScn?= =?us-ascii?Q?Uw70VduttdZFCvbVxoNhZlgnEasPpXoHyQ/Homb0BwtaEBe0O30Vf+igWugw?= =?us-ascii?Q?brETSPd2RcLAhY6pApnpUYQdHsOW/fl1nlFnBOIakL2qYxvdlQINbX+h6niK?= =?us-ascii?Q?Q6LKrEVhy3+tYasgIT4ARn8hlomL/FuTqLi202HeMDy6zrK24j0u+0+j9d+7?= =?us-ascii?Q?V6kvqSn2dVPm/OIWJaPJU9oJgaG2oDGnRyTn98el3zuODf6AQsRTBBxlgL7y?= =?us-ascii?Q?XB37yxf0N1uQwDPScEUR00R06TbteyUbGFq/8Yz70nvXVeI818smKIbuybiz?= =?us-ascii?Q?qpc7Pk2o8YKDji09plzi+kCTkSqMT37r57OTCc9ZfYgahmS+eO0pXztXagAx?= =?us-ascii?Q?kJsniR+laqKHJ3+5/LVGhKsKi2fe7k2RSQ5L5LdTdHh0FWyLC54QoznZVdkH?= =?us-ascii?Q?BxPYxj2g6YrIJQEa0NpTNj3bQZ+m8AUxf3zm6dx0H2DZGRAmYmEIy3Z7i0Av?= =?us-ascii?Q?WgODhPN74N9sQFGKatPsVNFfmm8DsrbyocID9JtkjlHXQ0FY2313xynq+8tL?= =?us-ascii?Q?Vk5TrR4eUQIhIf65fL/u2FDXoOlvbyiobFlrw3ih0umxVzBwxoKPqGDBzDWK?= =?us-ascii?Q?UmeULAExVgJYDRcuOeG66cN28+Jz7SC6vGhcoxmF/aY21s7ucG/bRr6782t0?= =?us-ascii?Q?XuSKylBgHxfBvi0NTTzKRJZuXemEjYMK9bLnZLafu5U1GmZQlEgk6jfhT4lk?= =?us-ascii?Q?nFRs/mQ825wtUKuluMo+qr0NHY9AigUcD2cT03Z7o7vEW5G+HWdxI6O3KbG6?= =?us-ascii?Q?YF2xC81SJYlfmJcP1uWWL+sfVGijQA15uAwXpQTv0GWLfb7C+L08x0Uyxl9i?= =?us-ascii?Q?mEHxbDujxr70BpPiwFZMWXfBXVeSKwjM0PU1+6hJf0ntEmbK0ZhGgdruPgLU?= =?us-ascii?Q?Std/QRBJH3owVHlKDKjeJ1bWXIZzII5FR2iDk0Bqlo9vLBzIXhXR1X2hVcSF?= =?us-ascii?Q?LDJxKoT2NFYlZl87kVa3HYxkytbN+5rOVAV1nKgm62Pz5GYe0HAwonTBAdQq?= =?us-ascii?Q?y7cICG0N2dTHgxCDMOZPcsQAdPesqgE7kMLf2Dib?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5055.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 672fafac-88ca-4ead-b8a4-08dc78b99024 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2024 10:42:36.1894 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AtNZ8Obq+ucU8xXX0vCNPMIEWKtS5/osD0ldnox874jW9OJaOz50hdeoP5fb7z3npfhBS5fotTiCsHkusxfUpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7123 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org [AMD Official Use Only - AMD Internal Distribution Only] Acked-by: Selwin Sebastian -----Original Message----- From: Ande, Venkat Kumar Sent: Tuesday, May 7, 2024 6:13 PM To: dev@dpdk.org Cc: Sebastian, Selwin ; Ande, Venkat Kumar Subject: [PATCH v2 15/25] net/axgbe: improve SFP 100Mbps auto-negotiation After changing speed to 100Mbps as a result of auto-negotiation (AN), some = 10/100/1000Mbps SFPs indicate a successful link (no faults or loss of signa= l), but cannot successfully transmit or receive data. These SFPs required = an extra auto-negotiation (AN) after the speed change in order to operate p= roperly. Add a quirk for these SFPs so that if the outcome of the AN actua= lly results in changing to a new speed, re-initiate AN at that new speed. Signed-off-by: Venkat Kumar Ande --- drivers/net/axgbe/axgbe_ethdev.h | 1 + drivers/net/axgbe/axgbe_mdio.c | 73 ++++++++++++++++-------------- drivers/net/axgbe/axgbe_phy_impl.c | 5 ++ 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_eth= dev.h index d1fac667c2..b9d8a4e74f 100644 --- a/drivers/net/axgbe/axgbe_ethdev.h +++ b/drivers/net/axgbe/axgbe_ethdev.h @@ -658,6 +658,7 @@ struct axgbe_port { enum axgbe_an an_state; enum axgbe_rx kr_state; enum axgbe_rx kx_state; + unsigned int an_again; unsigned int an_supported; unsigned int parallel_detect; unsigned int fec_ability; diff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.= c index e1a737cf62..faa7cdbf0a 100644 --- a/drivers/net/axgbe/axgbe_mdio.c +++ b/drivers/net/axgbe/axgbe_mdio.c @@ -200,13 +200,14 @@ static void axgbe_switch_mode(struct axgbe_port *pdat= a) axgbe_change_mode(pdata, pdata->phy_if.phy_impl.switch_mode(pdata))= ; } -static void axgbe_set_mode(struct axgbe_port *pdata, +static bool axgbe_set_mode(struct axgbe_port *pdata, enum axgbe_mode mode) { if (mode =3D=3D axgbe_cur_mode(pdata)) - return; + return false; axgbe_change_mode(pdata, mode); + return true; } static bool axgbe_use_mode(struct axgbe_port *pdata, @@ -882,21 +883,22 @@= static int axgbe_phy_config_fixed(struct axgbe_port *pdata) return 0; } -static int __axgbe_phy_config_aneg(struct axgbe_port *pdata) +static int __axgbe_phy_config_aneg(struct axgbe_port *pdata, bool +set_mode) { int ret; + pthread_mutex_lock(&pdata->an_mutex); rte_bit_relaxed_set32(AXGBE_LINK_INIT, &pdata->dev_state); pdata->link_check =3D rte_get_timer_cycles(); ret =3D pdata->phy_if.phy_impl.an_config(pdata); if (ret) - return ret; + goto out; if (pdata->phy.autoneg !=3D AUTONEG_ENABLE) { ret =3D axgbe_phy_config_fixed(pdata); if (ret || !pdata->kr_redrv) - return ret; + goto out; PMD_DRV_LOG(DEBUG, "AN redriver support\n"); } else { PMD_DRV_LOG(DEBUG, "AN PHY configuration\n"); @@ -906,23 +9= 08,26 @@ static int __axgbe_phy_config_aneg(struct axgbe_port *pdata) rte_intr_disable(pdata->pci_dev->intr_handle); /* Start auto-negotiation in a supported mode */ - if (axgbe_use_mode(pdata, AXGBE_MODE_KR)) { - axgbe_set_mode(pdata, AXGBE_MODE_KR); - } else if (axgbe_use_mode(pdata, AXGBE_MODE_KX_2500)) { - axgbe_set_mode(pdata, AXGBE_MODE_KX_2500); - } else if (axgbe_use_mode(pdata, AXGBE_MODE_KX_1000)) { - axgbe_set_mode(pdata, AXGBE_MODE_KX_1000); - } else if (axgbe_use_mode(pdata, AXGBE_MODE_SFI)) { - axgbe_set_mode(pdata, AXGBE_MODE_SFI); - } else if (axgbe_use_mode(pdata, AXGBE_MODE_X)) { - axgbe_set_mode(pdata, AXGBE_MODE_X); - } else if (axgbe_use_mode(pdata, AXGBE_MODE_SGMII_1000)) { - axgbe_set_mode(pdata, AXGBE_MODE_SGMII_1000); - } else if (axgbe_use_mode(pdata, AXGBE_MODE_SGMII_100)) { - axgbe_set_mode(pdata, AXGBE_MODE_SGMII_100); - } else { - rte_intr_enable(pdata->pci_dev->intr_handle); - return -EINVAL; + if (set_mode) { + if (axgbe_use_mode(pdata, AXGBE_MODE_KR)) { + axgbe_set_mode(pdata, AXGBE_MODE_KR); + } else if (axgbe_use_mode(pdata, AXGBE_MODE_KX_2500)) { + axgbe_set_mode(pdata, AXGBE_MODE_KX_2500); + } else if (axgbe_use_mode(pdata, AXGBE_MODE_KX_1000)) { + axgbe_set_mode(pdata, AXGBE_MODE_KX_1000); + } else if (axgbe_use_mode(pdata, AXGBE_MODE_SFI)) { + axgbe_set_mode(pdata, AXGBE_MODE_SFI); + } else if (axgbe_use_mode(pdata, AXGBE_MODE_X)) { + axgbe_set_mode(pdata, AXGBE_MODE_X); + } else if (axgbe_use_mode(pdata, AXGBE_MODE_SGMII_1000)) { + axgbe_set_mode(pdata, AXGBE_MODE_SGMII_1000); + } else if (axgbe_use_mode(pdata, AXGBE_MODE_SGMII_100)) { + axgbe_set_mode(pdata, AXGBE_MODE_SGMII_100); + } else { + rte_intr_enable(pdata->pci_dev->intr_handle); + ret =3D -EINVAL; + goto out; + } } /* Disable and stop any in progress auto-negotiation */ @@ -940,16 = +945,7 @@ static int __axgbe_phy_config_aneg(struct axgbe_port *pdata) axgbe_an_init(pdata); axgbe_an_restart(pdata); - return 0; -} - -static int axgbe_phy_config_aneg(struct axgbe_port *pdata) -{ - int ret; - - pthread_mutex_lock(&pdata->an_mutex); - - ret =3D __axgbe_phy_config_aneg(pdata); +out: if (ret) rte_bit_relaxed_set32(AXGBE_LINK_ERR, &pdata->dev_state); else @@ -960,6 +956,16 @@ static int axgbe_phy_config_aneg(struct axgbe_port *pd= ata) return ret; } +static int axgbe_phy_config_aneg(struct axgbe_port *pdata) { + return __axgbe_phy_config_aneg(pdata, true); } + +static int axgbe_phy_reconfig_aneg(struct axgbe_port *pdata) { + return __axgbe_phy_config_aneg(pdata, false); } + static bool axgbe_phy_aneg_done(struct axgbe_port *pdata) { return pdata->an_result =3D=3D AXGBE_AN_COMPLETE; @@ -1041,7 +1047,= 8 @@ static void axgbe_phy_status_result(struct axgbe_port *pdata) pdata->phy.duplex =3D DUPLEX_FULL; - axgbe_set_mode(pdata, mode); + if (axgbe_set_mode(pdata, mode) && pdata->an_again) + axgbe_phy_reconfig_aneg(pdata); } static int autoneg_time_out(unsigned long autoneg_start_time) diff --git a= /drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c index 4dab2ccad0..87ef8b6048 100644 --- a/drivers/net/axgbe/axgbe_phy_impl.c +++ b/drivers/net/axgbe/axgbe_phy_impl.c @@ -556,6 +556,8 @@ static bool axgbe_phy_belfuse_parse_quirks(struct axgbe= _port *pdata) if (memcmp(&sfp_eeprom->base[AXGBE_SFP_BASE_VENDOR_NAME], AXGBE_BEL_FUSE_VENDOR, strlen(AXGBE_BEL_FUSE_VENDOR))) return false; + /* For Bel-Fuse, use the extra AN flag */ + pdata->an_again =3D 1; /* Reset PHY - wait for self-clearing reset bit to clear */ pdata->phy_if.phy_impl.reset(pdata); @@ -797,6 +799,9 @@ static void axgbe_phy_sfp_detect(struct axgbe_port *pda= ta) struct axgbe_phy_data *phy_data =3D pdata->phy_data; int ret; + /* Clear the extra AN flag */ + pdata->an_again =3D 0; + /* Reset the SFP signals and info */ axgbe_phy_sfp_reset(phy_data); -- 2.34.1