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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250324125543.6723-1-crag0715@gmail.com>
Date: Mon, 24 Mar 2025 20:55:19 +0800
From: Crag Wang <crag0715@...il.com>
To: Heiner Kallweit <hkallweit1@...il.com>,
	nic_swsd@...ltek.com,
	Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>
Cc: crag.wang@...l.com,
	dell.client.kernel@...l.com,
	Crag Wang <crag0715@...il.com>,
	netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] r8169: add module parameter aspm_en_force

ASPM is disabled by default and is enabled if the chip register is
pre-configured, as explained in #c217ab7.

A module parameter is being added to the driver to allow users to
override the default setting. This allows users to opt in and forcefully
enable or disable ASPM power-saving mode.

-1: default unset
 0: ASPM disabled forcefully
 1: ASPM enabled forcefully

Signed-off-by: Crag Wang <crag0715@...il.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 53e541ddb439..161b2f2edf52 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -35,6 +35,10 @@
 #include "r8169.h"
 #include "r8169_firmware.h"
 
+static int aspm_en_force = -1;
+module_param(aspm_en_force, int, 0444);
+MODULE_PARM_DESC(aspm_en_force, "r8169: An integer, set 1 to force enable link ASPM");
+
 #define FIRMWARE_8168D_1	"rtl_nic/rtl8168d-1.fw"
 #define FIRMWARE_8168D_2	"rtl_nic/rtl8168d-2.fw"
 #define FIRMWARE_8168E_1	"rtl_nic/rtl8168e-1.fw"
@@ -5398,6 +5402,14 @@ static void rtl_init_mac_address(struct rtl8169_private *tp)
 /* register is set if system vendor successfully tested ASPM 1.2 */
 static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
 {
+	if (aspm_en_force == 0) {
+		dev_info(tp_to_dev(tp), "ASPM disabled forcefully");
+		return false;
+	} else if (aspm_en_force > 0) {
+		dev_info(tp_to_dev(tp), "ASPM enabled forcefully");
+		return true;
+	}
+
 	if (tp->mac_version >= RTL_GIGA_MAC_VER_61 &&
 	    r8168_mac_ocp_read(tp, 0xc0b2) & 0xf)
 		return true;
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ