aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux-5.10/linux-yocto-5.10.25-amdx86/0006-amd-xgbe-sets-XGBE_LINK_INIT-when-there-is-a-link-fa.patch
blob: a506c211a2f4a820fdd4cd169208b296b5fa9fbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From d97a0266f1b8d3b76b4aa581eb7b19603ff8fcea Mon Sep 17 00:00:00 2001
From: Sudheesh Mavila <sudheesh.mavila@amd.com>
Date: Fri, 23 Oct 2020 01:45:15 +0530
Subject: [PATCH 06/10] amd-xgbe sets XGBE_LINK_INIT when there is a link
 failure

When "link down" happens due to a link partner, the xgbe driver
will not set XGBE_LINK_INIT. This is observed when the port speed
capability is set to  10G in backplane mode.

This fix sets XGBE_LINK_INIT when there is a link failure and
XGBE_LINK_INIT is not set. This helps the driver to restart AN
when AN link timeout happens.

Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
---
 drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
index 4e97b4869522..91397cf3c5ab 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
@@ -1371,6 +1371,12 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
 		xgbe_phy_status_result(pdata);
 
 		netif_carrier_off(pdata->netdev);
+
+		if (link_aneg && ((pdata->phy_if.phy_impl.cur_mode(pdata) == XGBE_MODE_KR) ||
+				  (pdata->phy_if.phy_impl.cur_mode(pdata) == XGBE_MODE_KX_1000))) {
+			if (!test_bit(XGBE_LINK_INIT, &pdata->dev_state))
+				set_bit(XGBE_LINK_INIT, &pdata->dev_state);
+		}
 	}
 
 adjust_link:
-- 
2.17.1