lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220512215013.230647-1-kyle.d.pelton@linux.intel.com>
Date:   Thu, 12 May 2022 14:50:13 -0700
From:   Kyle Pelton <kyle.d.pelton@...ux.intel.com>
To:     netdev@...r.kernel.org, davem@...emloft.net, hayeswang@...ltek.com,
        aaron.ma@...onical.com
Cc:     Kyle Pelton <kyle.d.pelton@...ux.intel.com>
Subject: [PATCH] net: usb: r8152: Set default WOL options

Set default wake-on-lan options on probe to avoid state from previous
boot.

Fixes issue on some boots where wake-on-lan settings are incorrectly set
due to previous runtime-suspend activity. This causes spurious wakeups
while in suspend.

Signed-off-by: Kyle Pelton <kyle.d.pelton@...ux.intel.com>
---
 drivers/net/usb/r8152.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index ee41088c5251..a2b3c398beee 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3269,6 +3269,7 @@ static int rtl8152_set_features(struct net_device *dev,
 }
 
 #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
+#define WAKE_DEFAULT (WAKE_PHY << 5)
 
 static u32 __rtl_get_wol(struct r8152 *tp)
 {
@@ -9717,10 +9718,12 @@ static int rtl8152_probe(struct usb_interface *intf,
 
 	intf->needs_remote_wakeup = 1;
 
-	if (!rtl_can_wakeup(tp))
+	if (!rtl_can_wakeup(tp)) {
 		__rtl_set_wol(tp, 0);
-	else
+	} else {
+		__rtl_set_wol(tp, WAKE_DEFAULT);
 		tp->saved_wolopts = __rtl_get_wol(tp);
+	}
 
 	tp->rtl_ops.init(tp);
 #if IS_BUILTIN(CONFIG_USB_RTL8152)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ