Skip to contentSkip to conversation

Better thermal mode probing + support for 9 models

PATCH In review Kurt Borja 2 participants 9 messages Nov 11, 2024 – Nov 16, 2024

Subsystems (4)
lore
Share & tools
lore

Kurt Borja

author maintainer
#0 lore raw

cover Better thermal mode probing + support for 9 models

Hi!

I added models for all the acpidumps I could find. Also I find a way to not brute force create_thermal_profile and that's always a good thing.

I hope you all have a great week!

Kurt Borja (5):
alienware-wmi: order alienware_quirks[] alphabetically
alienware-wmi: extends the list of supported models
alienware-wmi: Adds support to Alienware x17 R2
alienware-wmi: create_thermal_profile no longer brute-forces IDs
Documentation: alienware-wmi: Describe THERMAL_INFORMATION operation

    0x02
 Documentation/wmi/devices/alienware-wmi.rst |  12 +-
 drivers/platform/x86/dell/alienware-wmi.c   | 150 ++++++++++++++++----
 2 files changed, 136 insertions(+), 26 deletions(-)
Signature · 1 line
2.47.0
author maintainer
#1 lore raw

PATCH 1/5 alienware-wmi: order alienware_quirks[] alphabetically

alienware_quirks[] entries are now ordered alphabetically

---
 drivers/platform/x86/dell/alienware-wmi.c | 52 +++++++++++------------
 1 file changed, 26 insertions(+), 26 deletions(-)
drivers/platform/x86/dell/alienware-wmi.c +26 -26
index a800c28bb4d5..bcc80ca8861c 100644
@@ -206,75 +206,75 @@ static int __init dmi_matched(const struct dmi_system_id *dmi)
 static const struct dmi_system_id alienware_quirks[] __initconst = {
 	{
 		.callback = dmi_matched,
-		.ident = "Alienware X51 R3",
+		.ident = "Alienware ASM100",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51 R3"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "ASM100"),
 		},
-		.driver_data = &quirk_x51_r3,
+		.driver_data = &quirk_asm100,
 	},
 	{
 		.callback = dmi_matched,
-		.ident = "Alienware X51 R2",
+		.ident = "Alienware ASM200",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51 R2"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "ASM200"),
 		},
-		.driver_data = &quirk_x51_r1_r2,
+		.driver_data = &quirk_asm200,
 	},
 	{
 		.callback = dmi_matched,
-		.ident = "Alienware X51 R1",
+		.ident = "Alienware ASM201",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "ASM201"),
 		},
-		.driver_data = &quirk_x51_r1_r2,
+		.driver_data = &quirk_asm201,
 	},
 	{
 		.callback = dmi_matched,
-		.ident = "Alienware ASM100",
+		.ident = "Alienware x15 R1",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ASM100"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15 R1"),
 		},
-		.driver_data = &quirk_asm100,
+		.driver_data = &quirk_x_series,
 	},
 	{
 		.callback = dmi_matched,
-		.ident = "Alienware ASM200",
+		.ident = "Alienware X51 R1",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ASM200"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51"),
 		},
-		.driver_data = &quirk_asm200,
+		.driver_data = &quirk_x51_r1_r2,
 	},
 	{
 		.callback = dmi_matched,
-		.ident = "Alienware ASM201",
+		.ident = "Alienware X51 R2",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ASM201"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51 R2"),
 		},
-		.driver_data = &quirk_asm201,
+		.driver_data = &quirk_x51_r1_r2,
 	},
 	{
 		.callback = dmi_matched,
-		.ident = "Dell Inc. Inspiron 5675",
+		.ident = "Alienware X51 R3",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 5675"),
+			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware X51 R3"),
 		},
-		.driver_data = &quirk_inspiron5675,
+		.driver_data = &quirk_x51_r3,
 	},
 	{
 		.callback = dmi_matched,
-		.ident = "Alienware x15 R1",
+		.ident = "Dell Inc. Inspiron 5675",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15 R1"),
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 5675"),
 		},
-		.driver_data = &quirk_x_series,
+		.driver_data = &quirk_inspiron5675,
 	},
 	{}
 };
Signature · 1 line
2.47.0
author maintainer
#2 lore raw

PATCH 2/5 alienware-wmi: extends the list of supported models

In reply to Kurt Borja

Adds thermal + gmode quirk to:
- Dell G15 5510
- Dell G15 5511
- Dell G15 5515
- Dell G3 3500
- Dell G3 3590
- Dell G5 5500

Adds thermal quirk to:
- Alienware m18 R2
- Alienware m17 R5 AMD

Support for these models was manually verified by reading their respective ACPI tables.

---
 drivers/platform/x86/dell/alienware-wmi.c | 81 +++++++++++++++++++++++
 1 file changed, 81 insertions(+)
drivers/platform/x86/dell/alienware-wmi.c +81 -0
index bcc80ca8861c..d1e72915ed4d 100644
@@ -188,6 +188,15 @@ static struct quirk_entry quirk_asm201 = {
 	.gmode = false,
 };
 
+static struct quirk_entry quirk_g_series = {
+	.num_zones = 2,
+	.hdmi_mux = 0,
+	.amplifier = 0,
+	.deepslp = 0,
+	.thermal = true,
+	.gmode = true,
+};
+
 static struct quirk_entry quirk_x_series = {
 	.num_zones = 2,
 	.hdmi_mux = 0,
@@ -231,6 +240,24 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
 		},
 		.driver_data = &quirk_asm201,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "Alienware m17 R5",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"),
+		},
+		.driver_data = &quirk_x_series,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Alienware m18 R2",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18 R2"),
+		},
+		.driver_data = &quirk_x_series,
+	},
 	{
 		.callback = dmi_matched,
 		.ident = "Alienware x15 R1",
@@ -267,6 +294,60 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
 		},
 		.driver_data = &quirk_x51_r3,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inc. G15 5510",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5510"),
+		},
+		.driver_data = &quirk_g_series,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inc. G15 5511",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5511"),
+		},
+		.driver_data = &quirk_g_series,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inc. G15 5515",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
+		},
+		.driver_data = &quirk_g_series,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inc. G3 3500",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "G3 3500"),
+		},
+		.driver_data = &quirk_g_series,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inc. G3 3590",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "G3 3590"),
+		},
+		.driver_data = &quirk_g_series,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inc. G5 5500",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "G5 5500"),
+		},
+		.driver_data = &quirk_g_series,
+	},
 	{
 		.callback = dmi_matched,
 		.ident = "Dell Inc. Inspiron 5675",
Signature · 1 line
2.47.0
author maintainer
#3 lore raw

PATCH 3/5 alienware-wmi: Adds support to Alienware x17 R2

In reply to Kurt Borja

Adds support to Alienware x17 R2

---
 drivers/platform/x86/dell/alienware-wmi.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/platform/x86/dell/alienware-wmi.c +9 -0
index d1e72915ed4d..36d182f217e2 100644
@@ -267,6 +267,15 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
 		},
 		.driver_data = &quirk_x_series,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "Alienware x17 R2",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x17 R2"),
+		},
+		.driver_data = &quirk_x_series,
+	},
 	{
 		.callback = dmi_matched,
 		.ident = "Alienware X51 R1",
Signature · 1 line
2.47.0
author maintainer
#4 lore raw

PATCH 4/5 alienware-wmi: create_thermal_profile no longer brute-forces IDs

In reply to Kurt Borja

WMAX_METHOD_THERMAL_INFORMATION has a *system description* operation that outputs a buffer with the following structure:

out[0] -> Number of fans
out[1] -> Number of sensors
out[2] -> 0x00
out[3] -> Number of thermal modes

This is now used by create_thermal_profile to retrieve available thermal codes instead of brute-forcing every ID.

Tested on an Alienware x15 R1. Verified by checking ACPI tables of supported models.

---
 drivers/platform/x86/dell/alienware-wmi.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/platform/x86/dell/alienware-wmi.c +12 -2
index 36d182f217e2..77465ed9b449 100644
@@ -68,6 +68,7 @@ enum WMAX_CONTROL_STATES {
 };
 
 enum WMAX_THERMAL_INFORMATION_OPERATIONS {
+	WMAX_OPERATION_SYS_DESCRIPTION		= 0x02,
 	WMAX_OPERATION_LIST_IDS			= 0x03,
 	WMAX_OPERATION_CURRENT_PROFILE		= 0x0B,
 };
@@ -1110,13 +1111,22 @@ static int thermal_profile_set(struct platform_profile_handler *pprof,
 static int create_thermal_profile(void)
 {
 	u32 out_data;
+	u8 sys_desc[4];
+	u32 first_mode;
 	enum wmax_thermal_mode mode;
 	enum platform_profile_option profile;
 	int ret;
 
-	for (u8 i = 0x2; i <= 0xD; i++) {
+	ret = wmax_thermal_information(WMAX_OPERATION_SYS_DESCRIPTION,
+				       0, (u32 *) &sys_desc);
+	if (ret < 0)
+		return ret;
+
+	first_mode = sys_desc[0] + sys_desc[1];
+
+	for (u32 i = 0; i < sys_desc[3]; i++) {
 		ret = wmax_thermal_information(WMAX_OPERATION_LIST_IDS,
-					       i, &out_data);
+					       i + first_mode, &out_data);
 
 		if (ret == -EIO)
 			return ret;
Signature · 1 line
2.47.0
author maintainer
#5 lore raw

PATCH 5/5 Documentation: alienware-wmi: Describe THERMAL_INFORMATION operation 0x02

In reply to Kurt Borja

This operation is used by alienware-wmi driver to avoid brute-forcing operation 0x03.

---
 Documentation/wmi/devices/alienware-wmi.rst | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Documentation/wmi/devices/alienware-wmi.rst +11 -1
index 03f932494d58..ddc5e561960e 100644
@@ -96,7 +96,7 @@ WMI method Thermal_Information([in] uint32 arg2, [out] uint32 argr)
          argr = 1
 
  if BYTE_0(arg2) == 0x02:
-         argr = UNKNOWN_CONSTANT
+         argr = SYSTEM_DESCRIPTION
 
  if BYTE_0(arg2) == 0x03:
          if BYTE_1(arg2) == 0x00:
@@ -179,6 +179,16 @@ WMI method Thermal_Information([in] uint32 arg2, [out] uint32 argr)
          else:
                  argr = 0xFFFFFFFF
 
+Operation 0x02 returns a *system description* buffer with the following
+structure:
+
+::
+
+ out[0] -> Number of fans
+ out[1] -> Number of sensors
+ out[2] -> 0x00
+ out[3] -> Number of thermal modes
+
 Operation 0x03 list all available fan IDs, sensor IDs and thermal profile
 codes in order, but different models may have different number of fans and
 thermal profiles. These are the known ranges:
Signature · 1 line
2.47.0
maintainer Reviewed-by on the v1 series
#6 lore raw
In reply to Kurt Borja
Quoted 13 lines · Kurt Borja

Hi!

I added models for all the acpidumps I could find. Also I find a way to not brute force create_thermal_profile and that's always a good thing.

I hope you all have a great week!

Kurt Borja (5):
alienware-wmi: order alienware_quirks[] alphabetically
alienware-wmi: extends the list of supported models
alienware-wmi: Adds support to Alienware x17 R2
alienware-wmi: create_thermal_profile no longer brute-forces IDs
Documentation: alienware-wmi: Describe THERMAL_INFORMATION operation

Quoted 5 lines
    0x02
 Documentation/wmi/devices/alienware-wmi.rst |  12 +-
 drivers/platform/x86/dell/alienware-wmi.c   | 150 ++++++++++++++++----
 2 files changed, 136 insertions(+), 26 deletions(-)

Looks nice. For the entire series,

Signature · 1 line
 i.
maintainer
#7 lore raw
In reply to Kurt Borja
Quoted 11 lines · Kurt Borja

I added models for all the acpidumps I could find. Also I find a way to not brute force create_thermal_profile and that's always a good thing.

I hope you all have a great week!

Kurt Borja (5):
alienware-wmi: order alienware_quirks[] alphabetically
alienware-wmi: extends the list of supported models
alienware-wmi: Adds support to Alienware x17 R2
alienware-wmi: create_thermal_profile no longer brute-forces IDs
Documentation: alienware-wmi: Describe THERMAL_INFORMATION operation

Quoted 3 lines
    0x02

[...]

Thank you for your contribution, it has been applied to my local review-ilpo branch. Note it will show up in the public platform-drivers-x86/review-ilpo branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/5] alienware-wmi: order alienware_quirks[] alphabetically

      commit: 2b8dc45b8ca31e3a0ed1d71cfc042b9b7af85dfb
[2/5] alienware-wmi: extends the list of supported models
      commit: 1c1eb70e7d235f5feb7b68861637a5fd0b52a9fd
[3/5] alienware-wmi: Adds support to Alienware x17 R2
      commit: 01bd181d21cf65e43f30948f9216571218732a12
[4/5] alienware-wmi: create_thermal_profile no longer brute-forces IDs
      commit: bfcda5cbcdb642a64d5b8a0229842dca7917ac6e
[5/5] Documentation: alienware-wmi: Describe THERMAL_INFORMATION operation 0x02
      commit: 6674c5a0eeb55143cd10514d0083624e056e7d13

--
i.

author maintainer
#8 lore raw
Quoted 15 lines · Ilpo Järvinen
Quoted 13 lines · Kurt Borja

I added models for all the acpidumps I could find. Also I find a way to not brute force create_thermal_profile and that's always a good thing.

I hope you all have a great week!

Kurt Borja (5):
alienware-wmi: order alienware_quirks[] alphabetically
alienware-wmi: extends the list of supported models
alienware-wmi: Adds support to Alienware x17 R2
alienware-wmi: create_thermal_profile no longer brute-forces IDs
Documentation: alienware-wmi: Describe THERMAL_INFORMATION operation

    0x02
Quoted 7 lines
Quoted 1 line

[...]

Thank you for your contribution, it has been applied to my local review-ilpo branch. Note it will show up in the public platform-drivers-x86/review-ilpo branch only once I've pushed my local branch there, which might take a while.

Thank you Ilpo!

Regards,
Kurt

Quoted 16 lines

The list of commits applied:
[1/5] alienware-wmi: order alienware_quirks[] alphabetically

      commit: 2b8dc45b8ca31e3a0ed1d71cfc042b9b7af85dfb
[2/5] alienware-wmi: extends the list of supported models
      commit: 1c1eb70e7d235f5feb7b68861637a5fd0b52a9fd
[3/5] alienware-wmi: Adds support to Alienware x17 R2
      commit: 01bd181d21cf65e43f30948f9216571218732a12
[4/5] alienware-wmi: create_thermal_profile no longer brute-forces IDs
      commit: bfcda5cbcdb642a64d5b8a0229842dca7917ac6e
[5/5] Documentation: alienware-wmi: Describe THERMAL_INFORMATION operation 0x02
      commit: 6674c5a0eeb55143cd10514d0083624e056e7d13

--
i.