Commit 993e8ec9 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-phy-smaller-phylib-improvements'

Heiner Kallweit says:

====================
net: phy: smaller phylib improvements

Series with smaller improvements for suspend and soft-reset handling.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5c05c1db 9576e9fa
......@@ -82,7 +82,6 @@ static struct phy_driver cortina_driver[] = {
.features = PHY_10GBIT_FEATURES,
.config_aneg = gen10g_config_aneg,
.read_status = cortina_read_status,
.soft_reset = genphy_no_soft_reset,
.probe = cortina_probe,
},
};
......
......@@ -727,7 +727,6 @@ static struct phy_driver mv3310_drivers[] = {
.phy_id_mask = MARVELL_PHY_ID_MASK,
.name = "mv88x3310",
.get_features = mv3310_get_features,
.soft_reset = genphy_no_soft_reset,
.config_init = mv3310_config_init,
.probe = mv3310_probe,
.suspend = mv3310_suspend,
......@@ -745,7 +744,6 @@ static struct phy_driver mv3310_drivers[] = {
.probe = mv3310_probe,
.suspend = mv3310_suspend,
.resume = mv3310_resume,
.soft_reset = genphy_no_soft_reset,
.config_init = mv3310_config_init,
.config_aneg = mv3310_config_aneg,
.aneg_done = mv3310_aneg_done,
......
......@@ -564,6 +564,5 @@ struct phy_driver genphy_c45_driver = {
.phy_id = 0xffffffff,
.phy_id_mask = 0xffffffff,
.name = "Generic Clause 45 PHY",
.soft_reset = genphy_no_soft_reset,
.read_status = genphy_c45_read_status,
};
......@@ -1082,8 +1082,12 @@ int phy_init_hw(struct phy_device *phydev)
if (!phydev->drv)
return 0;
if (phydev->drv->soft_reset)
if (phydev->drv->soft_reset) {
ret = phydev->drv->soft_reset(phydev);
/* see comment in genphy_soft_reset for an explanation */
if (!ret)
phydev->suspended = 0;
}
if (ret < 0)
return ret;
......@@ -1524,6 +1528,9 @@ int phy_suspend(struct phy_device *phydev)
struct phy_driver *phydrv = phydev->drv;
int ret;
if (phydev->suspended)
return 0;
/* If the device has WOL enabled, we cannot suspend the PHY */
phy_ethtool_get_wol(phydev, &wol);
if (wol.wolopts || (netdev && netdev->wol_enabled))
......@@ -2154,6 +2161,12 @@ int genphy_soft_reset(struct phy_device *phydev)
if (ret < 0)
return ret;
/* Clause 22 states that setting bit BMCR_RESET sets control registers
* to their default value. Therefore the POWER DOWN bit is supposed to
* be cleared after soft reset.
*/
phydev->suspended = 0;
ret = phy_poll_reset(phydev);
if (ret)
return ret;
......@@ -2627,7 +2640,6 @@ static struct phy_driver genphy_driver = {
.phy_id = 0xffffffff,
.phy_id_mask = 0xffffffff,
.name = "Generic PHY",
.soft_reset = genphy_no_soft_reset,
.get_features = genphy_read_abilities,
.suspend = genphy_suspend,
.resume = genphy_resume,
......
......@@ -78,7 +78,6 @@ static struct phy_driver teranetics_driver[] = {
.phy_id_mask = 0xffffffff,
.name = "Teranetics TN2020",
.features = PHY_10GBIT_FEATURES,
.soft_reset = genphy_no_soft_reset,
.aneg_done = teranetics_aneg_done,
.config_aneg = gen10g_config_aneg,
.read_status = teranetics_read_status,
......
......@@ -1251,10 +1251,6 @@ static inline int genphy_config_aneg(struct phy_device *phydev)
return __genphy_config_aneg(phydev, false);
}
static inline int genphy_no_soft_reset(struct phy_device *phydev)
{
return 0;
}
static inline int genphy_no_ack_interrupt(struct phy_device *phydev)
{
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment