Commit 7200f2e3 authored by Kunihiko Hayashi's avatar Kunihiko Hayashi Committed by David S. Miller

net: ethernet: ave: Set initial wol state to disabled

If wol state of phy hardware is enabled after reset, phy_ethtool_get_wol()
returns that wol.wolopts is true.

However, since net_device.wol_enabled is zero and this doesn't apply wol
state until calling ethtool_set_wol(), so mdio_bus_phy_may_suspend()
returns true, that is, it's in a state where phy can suspend even though
wol state is enabled.

In this inconsistency, phy_suspend() returns -EBUSY, and at last,
suspend sequence fails with the following message:

    dpm_run_callback(): mdio_bus_phy_suspend+0x0/0x58 returns -16
    PM: Device 65000000.ethernet-ffffffff:01 failed to suspend: error -16
    PM: Some devices failed to suspend, or early wake event detected

In order to fix the above issue, this patch forces to set initial wol state
to disabled as default.
Signed-off-by: default avatarKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0ba78b4a
...@@ -1208,9 +1208,13 @@ static int ave_init(struct net_device *ndev) ...@@ -1208,9 +1208,13 @@ static int ave_init(struct net_device *ndev)
priv->phydev = phydev; priv->phydev = phydev;
phy_ethtool_get_wol(phydev, &wol); ave_ethtool_get_wol(ndev, &wol);
device_set_wakeup_capable(&ndev->dev, !!wol.supported); device_set_wakeup_capable(&ndev->dev, !!wol.supported);
/* set wol initial state disabled */
wol.wolopts = 0;
ave_ethtool_set_wol(ndev, &wol);
if (!phy_interface_is_rgmii(phydev)) if (!phy_interface_is_rgmii(phydev))
phy_set_max_speed(phydev, SPEED_100); phy_set_max_speed(phydev, SPEED_100);
......
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