linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI / x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable
@ 2022-09-15 18:23 Mario Limonciello
  2022-09-16  8:43 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Mario Limonciello @ 2022-09-15 18:23 UTC (permalink / raw)
  To: mario.limonciello, linux-kernel
  Cc: Hans de Goede, Luya Tshimbalanga, Rafael J. Wysocki, Len Brown,
	linux-acpi

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.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216440
Reported-and-tested-by: Luya Tshimbalanga <luya@fedoraproject.org>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
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(-)

diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
index 664070fc8349..d7cdd8406c84 100644
--- a/drivers/acpi/x86/utils.c
+++ b/drivers/acpi/x86/utils.c
@@ -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);
 }
 
 /*
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPI / x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable
  2022-09-15 18:23 [PATCH] ACPI / x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable Mario Limonciello
@ 2022-09-16  8:43 ` Hans de Goede
  2022-09-24 16:11   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2022-09-16  8:43 UTC (permalink / raw)
  To: Mario Limonciello, linux-kernel
  Cc: Luya Tshimbalanga, Rafael J. Wysocki, Len Brown, linux-acpi

Hi,

On 9/15/22 20:23, Mario Limonciello wrote:
> 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.
> 
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=216440
> Reported-and-tested-by: Luya Tshimbalanga <luya@fedoraproject.org>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
> 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(-)
> 
> diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
> index 664070fc8349..d7cdd8406c84 100644
> --- a/drivers/acpi/x86/utils.c
> +++ b/drivers/acpi/x86/utils.c
> @@ -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);
>  }
>  
>  /*


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPI / x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable
  2022-09-16  8:43 ` Hans de Goede
@ 2022-09-24 16:11   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-09-24 16:11 UTC (permalink / raw)
  To: Hans de Goede, Mario Limonciello
  Cc: Linux Kernel Mailing List, Luya Tshimbalanga, Rafael J. Wysocki,
	Len Brown, ACPI Devel Maling List

On Fri, Sep 16, 2022 at 10:43 AM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 9/15/22 20:23, Mario Limonciello wrote:
> > 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.
> >
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=216440
> > Reported-and-tested-by: Luya Tshimbalanga <luya@fedoraproject.org>
> > Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>
> Thanks, patch looks good to me:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Applied as 6.1 material, thanks!

> > ---
> > 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(-)
> >
> > diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
> > index 664070fc8349..d7cdd8406c84 100644
> > --- a/drivers/acpi/x86/utils.c
> > +++ b/drivers/acpi/x86/utils.c
> > @@ -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);
> >  }
> >
> >  /*
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-24 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-15 18:23 [PATCH] ACPI / x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable Mario Limonciello
2022-09-16  8:43 ` Hans de Goede
2022-09-24 16:11   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).