]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: Fix lack of link transition for fixed PHYs
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 14 Nov 2016 01:50:35 +0000 (17:50 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Nov 2016 21:39:15 +0000 (16:39 -0500)
commit093036c3a1ff6e1a7f50c704140686236bcb2007
tree134649e585c87c481cb11cce69461befdef732eb
parente64de9cb52cdef5fb78a9eb285c02afa67170109
net: stmmac: Fix lack of link transition for fixed PHYs

Commit 8554f8afbe65 ("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: 8554f8afbe65 ("stmmac: fix adjust link call in case of a switch is attached")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c