Patch "net: stmmac: add to set device wake up flag when stmmac init phy" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: stmmac: add to set device wake up flag when stmmac init phy

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-stmmac-add-to-set-device-wake-up-flag-when-stmma.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1a742128effbd3f03a949f3c6fac4929af2cd5eb
Author: Rongguang Wei <weirongguang@xxxxxxxxxx>
Date:   Thu Mar 2 14:21:43 2023 +0800

    net: stmmac: add to set device wake up flag when stmmac init phy
    
    [ Upstream commit a9334b702a03b693f54ebd3b98f67bf722b74870 ]
    
    When MAC is not support PMT, driver will check PHY's WoL capability
    and set device wakeup capability in stmmac_init_phy(). We can enable
    the WoL through ethtool, the driver would enable the device wake up
    flag. Now the device_may_wakeup() return true.
    
    But if there is a way which enable the PHY's WoL capability derectly,
    like in BIOS. The driver would not know the enable thing and would not
    set the device wake up flag. The phy_suspend may failed like this:
    
    [   32.409063] PM: dpm_run_callback(): mdio_bus_phy_suspend+0x0/0x50 returns -16
    [   32.409065] PM: Device stmmac-1:00 failed to suspend: error -16
    [   32.409067] PM: Some devices failed to suspend, or early wake event detected
    
    Add to set the device wakeup enable flag according to the get_wol
    function result in PHY can fix the error in this scene.
    
    v2: add a Fixes tag.
    
    Fixes: 1d8e5b0f3f2c ("net: stmmac: Support WOL with phy")
    Signed-off-by: Rongguang Wei <weirongguang@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1a5b8dab5e9b6..01f7e19a2ca8b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1170,6 +1170,7 @@ static int stmmac_init_phy(struct net_device *dev)
 
 		phylink_ethtool_get_wol(priv->phylink, &wol);
 		device_set_wakeup_capable(priv->device, !!wol.supported);
+		device_set_wakeup_enable(priv->device, !!wol.wolopts);
 	}
 
 	return ret;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux