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 <s.hauer@pengutronix.de>
This commit is contained in:
parent
75635f6926
commit
e2eb6e50f4
|
@ -390,7 +390,7 @@ out:
|
||||||
int genphy_config_advert(struct phy_device *phydev)
|
int genphy_config_advert(struct phy_device *phydev)
|
||||||
{
|
{
|
||||||
u32 advertise;
|
u32 advertise;
|
||||||
int oldadv, adv;
|
int oldadv, adv, bmsr;
|
||||||
int err, changed = 0;
|
int err, changed = 0;
|
||||||
|
|
||||||
/* Only allow advertising what
|
/* Only allow advertising what
|
||||||
|
@ -417,8 +417,11 @@ int genphy_config_advert(struct phy_device *phydev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Configure gigabit if it's supported */
|
/* Configure gigabit if it's supported */
|
||||||
if (phydev->supported & (SUPPORTED_1000baseT_Half |
|
bmsr = phy_read(phydev, MII_BMSR);
|
||||||
SUPPORTED_1000baseT_Full)) {
|
if (bmsr < 0)
|
||||||
|
return bmsr;
|
||||||
|
|
||||||
|
if (bmsr & BMSR_ESTATEN) {
|
||||||
oldadv = adv = phy_read(phydev, MII_CTRL1000);
|
oldadv = adv = phy_read(phydev, MII_CTRL1000);
|
||||||
|
|
||||||
if (adv < 0)
|
if (adv < 0)
|
||||||
|
|
Loading…
Reference in New Issue