[PATCH v2] r8169: enable ASPM on Dell platforms

Chia-Lin Kao (AceLan) posted 1 patch 2 weeks, 3 days ago
drivers/net/ethernet/realtek/r8169_main.c | 30 +++++++++++++++++++++++
1 file changed, 30 insertions(+)
[PATCH v2] r8169: enable ASPM on Dell platforms
Posted by Chia-Lin Kao (AceLan) 2 weeks, 3 days ago
Enable PCIe ASPM for RTL8169 NICs on Dell platforms that have been
verified to work reliably with this power management feature. The
r8169 driver traditionally disables ASPM to prevent random link
failures and system hangs on problematic hardware.

Dell has validated these product families to work correctly with
RTL NIC ASPM and commits to addressing any ASPM-related issues
with RTL hardware in collaboration with Realtek.

This change enables ASPM for the following Dell product families:
- Alienware
- Dell Laptops/Pro Laptops/Pro Max Laptops
- Dell Desktops/Pro Desktops/Pro Max Desktops
- Dell Pro Rugged Laptops

v2. Add missing linux/dmi.h header file

Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 30 +++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 9c601f271c02..1692c38cc739 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -15,6 +15,7 @@
 #include <linux/etherdevice.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
+#include <linux/dmi.h>
 #include <linux/ethtool.h>
 #include <linux/phy.h>
 #include <linux/if_vlan.h>
@@ -5366,6 +5367,32 @@ static void rtl_init_mac_address(struct rtl8169_private *tp)
 	rtl_rar_set(tp, mac_addr);
 }
 
+bool rtl_aspm_new_dell_platforms(void)
+{
+	const char *family = dmi_get_system_info(DMI_PRODUCT_FAMILY);
+	static const char * const dell_product_families[] = {
+		"Alienware",
+		"Dell Laptops",
+		"Dell Pro Laptops",
+		"Dell Pro Max Laptops",
+		"Dell Desktops",
+		"Dell Pro Desktops",
+		"Dell Pro Max Desktops",
+		"Dell Pro Rugged Laptops"
+	};
+	int i;
+
+	if (!family)
+		return false;
+
+	for (i = 0; i < ARRAY_SIZE(dell_product_families); i++) {
+		if (str_has_prefix(family, dell_product_families[i]))
+			return true;
+	}
+
+	return false;
+}
+
 /* register is set if system vendor successfully tested ASPM 1.2 */
 static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
 {
@@ -5373,6 +5400,9 @@ static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
 	    r8168_mac_ocp_read(tp, 0xc0b2) & 0xf)
 		return true;
 
+	if (rtl_aspm_new_dell_platforms())
+		return true;
+
 	return false;
 }
 
-- 
2.43.0
Re: [PATCH v2] r8169: enable ASPM on Dell platforms
Posted by kernel test robot 2 weeks, 2 days ago
Hi Chia-Lin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.17-rc6 next-20250915]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Chia-Lin-Kao-AceLan/r8169-enable-ASPM-on-Dell-platforms/20250915-093648
base:   linus/master
patch link:    https://lore.kernel.org/r/20250915013555.365230-1-acelan.kao%40canonical.com
patch subject: [PATCH v2] r8169: enable ASPM on Dell platforms
config: i386-randconfig-r113-20250916 (https://download.01.org/0day-ci/archive/20250916/202509161457.njlVGwnm-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250916/202509161457.njlVGwnm-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509161457.njlVGwnm-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/realtek/r8169_main.c:5370:6: sparse: sparse: symbol 'rtl_aspm_new_dell_platforms' was not declared. Should it be static?

vim +/rtl_aspm_new_dell_platforms +5370 drivers/net/ethernet/realtek/r8169_main.c

  5369	
> 5370	bool rtl_aspm_new_dell_platforms(void)
  5371	{
  5372		const char *family = dmi_get_system_info(DMI_PRODUCT_FAMILY);
  5373		static const char * const dell_product_families[] = {
  5374			"Alienware",
  5375			"Dell Laptops",
  5376			"Dell Pro Laptops",
  5377			"Dell Pro Max Laptops",
  5378			"Dell Desktops",
  5379			"Dell Pro Desktops",
  5380			"Dell Pro Max Desktops",
  5381			"Dell Pro Rugged Laptops"
  5382		};
  5383		int i;
  5384	
  5385		if (!family)
  5386			return false;
  5387	
  5388		for (i = 0; i < ARRAY_SIZE(dell_product_families); i++) {
  5389			if (str_has_prefix(family, dell_product_families[i]))
  5390				return true;
  5391		}
  5392	
  5393		return false;
  5394	}
  5395	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH v2] r8169: enable ASPM on Dell platforms
Posted by kernel test robot 2 weeks, 3 days ago
Hi Chia-Lin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.17-rc6 next-20250912]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Chia-Lin-Kao-AceLan/r8169-enable-ASPM-on-Dell-platforms/20250915-093648
base:   linus/master
patch link:    https://lore.kernel.org/r/20250915013555.365230-1-acelan.kao%40canonical.com
patch subject: [PATCH v2] r8169: enable ASPM on Dell platforms
config: csky-randconfig-002-20250915 (https://download.01.org/0day-ci/archive/20250915/202509151143.M8cTV3NE-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250915/202509151143.M8cTV3NE-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509151143.M8cTV3NE-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/realtek/r8169_main.c:5370:6: warning: no previous prototype for 'rtl_aspm_new_dell_platforms' [-Wmissing-prototypes]
    5370 | bool rtl_aspm_new_dell_platforms(void)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/rtl_aspm_new_dell_platforms +5370 drivers/net/ethernet/realtek/r8169_main.c

  5369	
> 5370	bool rtl_aspm_new_dell_platforms(void)
  5371	{
  5372		const char *family = dmi_get_system_info(DMI_PRODUCT_FAMILY);
  5373		static const char * const dell_product_families[] = {
  5374			"Alienware",
  5375			"Dell Laptops",
  5376			"Dell Pro Laptops",
  5377			"Dell Pro Max Laptops",
  5378			"Dell Desktops",
  5379			"Dell Pro Desktops",
  5380			"Dell Pro Max Desktops",
  5381			"Dell Pro Rugged Laptops"
  5382		};
  5383		int i;
  5384	
  5385		if (!family)
  5386			return false;
  5387	
  5388		for (i = 0; i < ARRAY_SIZE(dell_product_families); i++) {
  5389			if (str_has_prefix(family, dell_product_families[i]))
  5390				return true;
  5391		}
  5392	
  5393		return false;
  5394	}
  5395	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki