aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudheesh Mavila <sudheesh.mavila@amd.com>2019-06-10 21:35:59 +0530
committerSudheesh Mavila <sudheesh.mavila@amd.com>2019-06-19 13:50:23 +0530
commit70f30e6620a22ba79d0b8f21ff76e85488783647 (patch)
tree367389f22719196e88c6689c51a1ec6a6910a22e
parent5880e2bec3fb945e3a0a9baa8b1bb49e3f274b09 (diff)
downloadmeta-amd-70f30e6620a22ba79d0b8f21ff76e85488783647.tar.gz
meta-amd-70f30e6620a22ba79d0b8f21ff76e85488783647.tar.bz2
meta-amd-70f30e6620a22ba79d0b8f21ff76e85488783647.zip
amd-xgbe Sometimes driver report incorrect link status
This fixes the driver to report link status correctly otherwise we run into situations where misleading timeout errors are generated. Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
-rw-r--r--meta-snowyowl/recipes-kernel/linux/linux-yocto-4.14.71/0132-amd-xgbe-Sometimes-driver-report-incorrect-link-stat.patch39
-rwxr-xr-xmeta-snowyowl/recipes-kernel/linux/linux-yocto-4.14.71/amd-xgbe-patches.scc1
2 files changed, 40 insertions, 0 deletions
diff --git a/meta-snowyowl/recipes-kernel/linux/linux-yocto-4.14.71/0132-amd-xgbe-Sometimes-driver-report-incorrect-link-stat.patch b/meta-snowyowl/recipes-kernel/linux/linux-yocto-4.14.71/0132-amd-xgbe-Sometimes-driver-report-incorrect-link-stat.patch
new file mode 100644
index 00000000..384d8bdc
--- /dev/null
+++ b/meta-snowyowl/recipes-kernel/linux/linux-yocto-4.14.71/0132-amd-xgbe-Sometimes-driver-report-incorrect-link-stat.patch
@@ -0,0 +1,39 @@
+From 94f4f26d64b2048d6c99a2aa120b295fa1afba26 Mon Sep 17 00:00:00 2001
+From: Sudheesh Mavila <sudheesh.mavila@amd.com>
+Date: Tue, 12 Mar 2019 22:33:11 +0530
+Subject: [PATCH] amd-xgbe Sometimes driver report incorrect link status and
+ results in timeout error in driver
+
+Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
+---
+ drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+index 151bdb629e8a..ff4eeb55ab79 100755
+--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
++++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+@@ -2565,8 +2565,18 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
+ */
+ reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
+ reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
+- if (reg & MDIO_STAT1_LSTATUS)
+- return 1;
++ if(phy_data->sfp_speed == XGBE_SFP_SPEED_10000) {
++ if ((reg & MDIO_STAT1_LSTATUS) && !(reg & MDIO_STAT1_FAULT)) {
++ return 1;
++ } else {
++ *an_restart = 1;
++ pdata->phy_if.phy_reset(pdata);
++ return 0;
++ }
++ } else {
++ if (reg & MDIO_STAT1_LSTATUS)
++ return 1;
++ }
+
+ /* No link, attempt a receiver reset cycle */
+ if (phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
+--
+2.17.1
+
diff --git a/meta-snowyowl/recipes-kernel/linux/linux-yocto-4.14.71/amd-xgbe-patches.scc b/meta-snowyowl/recipes-kernel/linux/linux-yocto-4.14.71/amd-xgbe-patches.scc
index 7b85eda7..3e3c0874 100755
--- a/meta-snowyowl/recipes-kernel/linux/linux-yocto-4.14.71/amd-xgbe-patches.scc
+++ b/meta-snowyowl/recipes-kernel/linux/linux-yocto-4.14.71/amd-xgbe-patches.scc
@@ -19,3 +19,4 @@ patch 0115-net-amd-fix-return-type-of-ndo_start_xmit-function.patch
patch 0116-net-phy-Add-helper-for-advertise-to-lcl-value.patch
patch 0117-drivers-net-remove-net-busy_poll.h-inclusion-when-no.patch
patch 0118-net-ethernet-xgbe-expand-PHY_GBIT_FEAUTRES.patch
+patch 0132-amd-xgbe-Sometimes-driver-report-incorrect-link-stat.patch