From e2eb6e50f45ef078a6bda48acb3aea4b63e49237 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 21 May 2014 12:53:11 +0200 Subject: net: phy: genphy: always write MII_CTRL1000 when available the phydev->supported field does not necessarily match the hardware capabilities, it could be limited by the board to force the phy to a lower speed. In this case make sure the gigabit advertise bits are cleared on a gigabit phy. Signed-off-by: Sascha Hauer --- drivers/net/phy/phy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/net/phy/phy.c') diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index b0e0c1e369..e214c13210 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -390,7 +390,7 @@ out: int genphy_config_advert(struct phy_device *phydev) { u32 advertise; - int oldadv, adv; + int oldadv, adv, bmsr; int err, changed = 0; /* Only allow advertising what @@ -417,8 +417,11 @@ int genphy_config_advert(struct phy_device *phydev) } /* Configure gigabit if it's supported */ - if (phydev->supported & (SUPPORTED_1000baseT_Half | - SUPPORTED_1000baseT_Full)) { + bmsr = phy_read(phydev, MII_BMSR); + if (bmsr < 0) + return bmsr; + + if (bmsr & BMSR_ESTATEN) { oldadv = adv = phy_read(phydev, MII_CTRL1000); if (adv < 0) -- cgit v1.2.3