Skip to contentSkip to conversation

Patch "net: stmmac: Fix lack of link transition for fixed PHYs" has been added to the 4.8-stable tree

PATCH [email protected] 1 participant 1 message Nov 18, 2016

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net: stmmac: Fix lack of link transition for fixed PHYs

to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-stmmac-fix-lack-of-link-transition-for-fixed-phys.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Nov 18 11:35:46 CET 2016

From: Florian Fainelli <[email protected]>
Date: Sun, 13 Nov 2016 17:50:35 -0800
Subject: net: stmmac: Fix lack of link transition for fixed PHYs

From: Florian Fainelli <[email protected]>

[ Upstream commit c51e424dc79e1428afc4d697cdb6a07f7af70cbf ]

Commit 52f95bbfcf72 ("stmmac: fix adjust link call in case of a switch is attached") added some logic to avoid polling the fixed PHY and therefore invoking the adjust_link callback more than once, since this is a fixed PHY and link events won't be generated.

This works fine the first time, because we start with phydev->irq = PHY_POLL, so we call adjust_link, then we set phydev->irq = PHY_IGNORE_INTERRUPT and we stop polling the PHY.

Now, if we called ndo_close(), which calls both phy_stop() and does an explicit netif_carrier_off(), we end up with a link down. Upon calling ndo_open() again, despite starting the PHY state machine, we have PHY_IGNORE_INTERRUPT set, and we generate no link event at all, so the link is permanently down.

Fixes 52f95bbfcf72 ("stmmac: fix adjust link call in case of a switch is attached")
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +7 -0
@@ -871,6 +871,13 @@ static int stmmac_init_phy(struct net_de
 		return -ENODEV;
 	}
 
+	/* stmmac_adjust_link will change this to PHY_IGNORE_INTERRUPT to avoid
+	 * subsequent PHY polling, make sure we force a link transition if
+	 * we have a UP/DOWN/UP transition
+	 */
+	if (phydev->is_pseudo_fixed_link)
+		phydev->irq = PHY_POLL;
+
 	pr_debug("stmmac_init_phy:  %s: attached to PHY (UID 0x%x)"
 		 " Link = %d\n", dev->name, phydev->phy_id, phydev->link);
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.8/net-stmmac-fix-lack-of-link-transition-for-fixed-phys.patch