Patch "phy: micrel: Disable auto negotiation on startup" has been added to the 4.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    phy: micrel: Disable auto negotiation on startup

to the 4.4-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:
     phy-micrel-disable-auto-negotiation-on-startup.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c19c2ad01c9ed92507f536b2c63f7eb755cb277a
Author: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxxxxxxxxx>
Date:   Fri Feb 26 19:18:23 2016 +0100

    phy: micrel: Disable auto negotiation on startup
    
    [ Upstream commit 99f81afc139c6edd14d77a91ee91685a414a1c66 ]
    
    Disable auto negotiation on init to properly detect an already plugged
    cable at boot.
    
    At boot, when the phy is started, it is in the PHY_UP state.
    However, if a cable is plugged at boot, because auto negociation is already
    enabled at the time we get the first interrupt, the phy is already running.
    But the state machine then switches from PHY_UP to PHY_AN and calls
    phy_start_aneg(). phy_start_aneg() will not do anything because aneg is
    already enabled on the phy. It will then wait for a interrupt before going
    further. This interrupt will never happen unless the cable is unplugged and
    then replugged.
    
    It was working properly before 321beec5047a (net: phy: Use interrupts when
    available in NOLINK state) because switching to NOLINK meant starting
    polling the phy, even if IRQ were enabled.
    
    Fixes: 321beec5047a (net: phy: Use interrupts when available in NOLINK state)
    Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 4eba646789c30..98166e144f2dd 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -285,6 +285,17 @@ static int kszphy_config_init(struct phy_device *phydev)
 	if (priv->led_mode >= 0)
 		kszphy_setup_led(phydev, type->led_mode_reg, priv->led_mode);
 
+	if (phy_interrupt_is_valid(phydev)) {
+		int ctl = phy_read(phydev, MII_BMCR);
+
+		if (ctl < 0)
+			return ctl;
+
+		ret = phy_write(phydev, MII_BMCR, ctl & ~BMCR_ANENABLE);
+		if (ret < 0)
+			return ret;
+	}
+
 	return 0;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux