提交 41408ad5 编写于 作者: R Russell King 提交者: David S. Miller

net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support

Avoid calling genphy_aneg_done() for PHYs that do not implement the
Clause 22 register set.

Clause 45 PHYs may implement the Clause 22 register set along with the
Clause 22 extension MMD.  Hence, we can't simply block access to the
Clause 22 functions based on the PHY being a Clause 45 PHY.
Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5acde34a
......@@ -163,6 +163,12 @@ int phy_aneg_done(struct phy_device *phydev)
if (phydev->drv && phydev->drv->aneg_done)
return phydev->drv->aneg_done(phydev);
/* Avoid genphy_aneg_done() if the Clause 45 PHY does not
* implement Clause 22 registers
*/
if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0)))
return -EINVAL;
return genphy_aneg_done(phydev);
}
EXPORT_SYMBOL(phy_aneg_done);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册