Patch "net: bcmgenet: Don't claim WOL when its not available" has been added to the 5.4-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: bcmgenet: Don't claim WOL when its not available

to the 5.4-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-bcmgenet-don-t-claim-wol-when-its-not-available.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 6690694d24b8c8b437bc139d1f92cb39ca58f2eb
Author: Jeremy Linton <jeremy.linton@xxxxxxx>
Date:   Wed Mar 9 22:55:35 2022 -0600

    net: bcmgenet: Don't claim WOL when its not available
    
    [ Upstream commit 00b022f8f876a3a036b0df7f971001bef6398605 ]
    
    Some of the bcmgenet platforms don't correctly support WOL, yet
    ethtool returns:
    
    "Supports Wake-on: gsf"
    
    which is false.
    
    Ideally if there isn't a wol_irq, or there is something else that
    keeps the device from being able to wakeup it should display:
    
    "Supports Wake-on: d"
    
    This patch checks whether the device can wakup, before using the
    hard-coded supported flags. This corrects the ethtool reporting, as
    well as the WOL configuration because ethtool verifies that the mode
    is supported before attempting it.
    
    Fixes: c51de7f3976b ("net: bcmgenet: add Wake-on-LAN support code")
    Signed-off-by: Jeremy Linton <jeremy.linton@xxxxxxx>
    Tested-by: Peter Robinson <pbrobinson@xxxxxxxxx>
    Acked-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220310045535.224450-1-jeremy.linton@xxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
index 164988f3b4fa..a2da09da4907 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
@@ -41,6 +41,13 @@
 void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
 	struct bcmgenet_priv *priv = netdev_priv(dev);
+	struct device *kdev = &priv->pdev->dev;
+
+	if (!device_can_wakeup(kdev)) {
+		wol->supported = 0;
+		wol->wolopts = 0;
+		return;
+	}
 
 	wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE;
 	wol->wolopts = priv->wolopts;



[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