Skip to contentSkip to conversation

ACPI / x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable

PATCH Applied Mario Limonciello 3 participants 3 messages Sep 15, 2022 – Sep 24, 2022 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable

Dell Inspiron 14 2-in-1 has two ACPI nodes under GPP1 both with _ADR of 0, both without _HID. It's ambiguous which the kernel should take, but it seems to take "DEV0". Unfortunately "DEV0" is missing the device property StorageD3Enable which is present on "NVME".

To avoid this causing problems for suspend, add a quirk for this system to behave like StorageD3Enable property was found.

---
I had attempted to modify the heuristics for when two ACPI devices have the same _ADR to prefer the one with a _DSD, but this wasn't enough of a help. As the ACPI node doesn't contain anything valuable besides the _DSD, it seems that a quirk for the system is a fine enough solution.

 drivers/acpi/x86/utils.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/acpi/x86/utils.c +18 -1
index 664070fc8349..d7cdd8406c84 100644
@@ -207,9 +207,26 @@ static const struct x86_cpu_id storage_d3_cpu_ids[] = {
 	{}
 };
 
+static const struct dmi_system_id force_storage_d3_dmi[] = {
+	{
+		/*
+		 * _ADR is ambiguous between GPP1.DEV0 and GPP1.NVME
+		 * but .NVME is needed to get StorageD3Enable node
+		 * https://bugzilla.kernel.org/show_bug.cgi?id=216440
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 14 7425 2-in-1"),
+		}
+	},
+	{}
+};
+
 bool force_storage_d3(void)
 {
-	return x86_match_cpu(storage_d3_cpu_ids);
+	const struct dmi_system_id *dmi_id = dmi_first_match(force_storage_d3_dmi);
+
+	return dmi_id || x86_match_cpu(storage_d3_cpu_ids);
 }
 
 /*
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 11 lines · Mario Limonciello

Dell Inspiron 14 2-in-1 has two ACPI nodes under GPP1 both with _ADR of 0, both without _HID. It's ambiguous which the kernel should take, but it seems to take "DEV0". Unfortunately "DEV0" is missing the device property StorageD3Enable which is present on "NVME".

To avoid this causing problems for suspend, add a quirk for this system to behave like StorageD3Enable property was found.

Thanks, patch looks good to me:

Regards,

Hans

Quoted 41 lines

---
I had attempted to modify the heuristics for when two ACPI devices have the same _ADR to prefer the one with a _DSD, but this wasn't enough of a help. As the ACPI node doesn't contain anything valuable besides the _DSD, it seems that a quirk for the system is a fine enough solution.

 drivers/acpi/x86/utils.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/acpi/x86/utils.c +18 -1
index 664070fc8349..d7cdd8406c84 100644
@@ -207,9 +207,26 @@ static const struct x86_cpu_id storage_d3_cpu_ids[] = {
 	{}
 };
 
+static const struct dmi_system_id force_storage_d3_dmi[] = {
+	{
+		/*
+		 * _ADR is ambiguous between GPP1.DEV0 and GPP1.NVME
+		 * but .NVME is needed to get StorageD3Enable node
+		 * https://bugzilla.kernel.org/show_bug.cgi?id=216440
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 14 7425 2-in-1"),
+		}
+	},
+	{}
+};
+
 bool force_storage_d3(void)
 {
-	return x86_match_cpu(storage_d3_cpu_ids);
+	const struct dmi_system_id *dmi_id = dmi_first_match(force_storage_d3_dmi);
+
+	return dmi_id || x86_match_cpu(storage_d3_cpu_ids);
 }
 
 /*
maintainer Applied
#2 lore raw
Quoted 12 lines · Hans de Goede

Hi,

Quoted 8 lines · Mario Limonciello

Dell Inspiron 14 2-in-1 has two ACPI nodes under GPP1 both with _ADR of 0, both without _HID. It's ambiguous which the kernel should take, but it seems to take "DEV0". Unfortunately "DEV0" is missing the device property StorageD3Enable which is present on "NVME".

To avoid this causing problems for suspend, add a quirk for this system to behave like StorageD3Enable property was found.

Quoted 7 lines
Quoted 3 lines

Thanks, patch looks good to me:

Applied as 6.1 material, thanks!

Quoted 42 lines
Quoted 41 lines

---
I had attempted to modify the heuristics for when two ACPI devices have the same _ADR to prefer the one with a _DSD, but this wasn't enough of a help. As the ACPI node doesn't contain anything valuable besides the _DSD, it seems that a quirk for the system is a fine enough solution.

 drivers/acpi/x86/utils.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/acpi/x86/utils.c +18 -1
index 664070fc8349..d7cdd8406c84 100644
@@ -207,9 +207,26 @@ static const struct x86_cpu_id storage_d3_cpu_ids[] = {
      {}
 };
 
+static const struct dmi_system_id force_storage_d3_dmi[] = {
+     {
+             /*
+              * _ADR is ambiguous between GPP1.DEV0 and GPP1.NVME
+              * but .NVME is needed to get StorageD3Enable node
+              * https://bugzilla.kernel.org/show_bug.cgi?id=216440
+              */
+             .matches = {
+                     DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+                     DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 14 7425 2-in-1"),
+             }
+     },
+     {}
+};
+
 bool force_storage_d3(void)
 {
-     return x86_match_cpu(storage_d3_cpu_ids);
+     const struct dmi_system_id *dmi_id = dmi_first_match(force_storage_d3_dmi);
+
+     return dmi_id || x86_match_cpu(storage_d3_cpu_ids);
 }
 
 /*