mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] nvme-pci: Add suspend quirk for HP mt645 thin client
@ 2023-07-06 18:06 Alexandru Gagniuc
  2023-07-08  4:28 ` Limonciello, Mario
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandru Gagniuc @ 2023-07-06 18:06 UTC (permalink / raw)
  To: linux-nvme
  Cc: kbusch, axboe, hch, sagi, linux-kernel, eniac-xw.zhang,
	Alexandru Gagniuc, stable

The HP Elite mt645 thin client exhibits resume times of over one
minute when using the normal nvme resume path. BIOS has tried to work
around this by setting the "StorageD3Enable" ACPI property, but only
if it detected the "Linux-HPI-Hybrid-Graphics" _OSI() flag. This flag
does not exist, so the BIOS workaround can't work.

Instead, just set NVME_QUIRK_SIMPLE_SUSPEND when running on an mt645.
The DMI_PRODUCT_NAME cannot be used because this string can be changed
in the field. Match against DMI_BOARD_NAME, which should be immutable.

Cc: stable@vger.kernel.org
Signed-off-by: Alexandru Gagniuc <alexandru.gagniuc@hp.com>
---
 drivers/nvme/host/pci.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 492f319ebdf3..25b59f5ce874 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2897,6 +2897,15 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
 		if ((dmi_match(DMI_BOARD_VENDOR, "LENOVO")) &&
 		     dmi_match(DMI_BOARD_NAME, "LNVNB161216"))
 			return NVME_QUIRK_SIMPLE_SUSPEND;
+	} else if (dmi_match(DMI_SYS_VENDOR, "HP") &&
+		   (dmi_match(DMI_BOARD_NAME, "8B0F") ||
+		    dmi_match(DMI_BOARD_NAME, "8B59"))) {
+		/*
+		 * Force simple suspend to work around long resume latencies
+		 * (1 minute or longer).
+		 */
+		dev_info(&pdev->dev, "simple suspend quirk for HP mt645\n");
+		return NVME_QUIRK_SIMPLE_SUSPEND;
 	}
 
 	return 0;
-- 
2.39.1


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

* Re: [PATCH] nvme-pci: Add suspend quirk for HP mt645 thin client
  2023-07-06 18:06 [PATCH] nvme-pci: Add suspend quirk for HP mt645 thin client Alexandru Gagniuc
@ 2023-07-08  4:28 ` Limonciello, Mario
  2023-07-10 20:06   ` Gagniuc, Alexandru
  0 siblings, 1 reply; 4+ messages in thread
From: Limonciello, Mario @ 2023-07-08  4:28 UTC (permalink / raw)
  To: Alexandru Gagniuc, linux-nvme
  Cc: kbusch, axboe, hch, sagi, linux-kernel, eniac-xw.zhang, stable


On 7/6/2023 1:06 PM, Alexandru Gagniuc wrote:
> The HP Elite mt645 thin client exhibits resume times of over one
> minute when using the normal nvme resume path.

Is this the specific product you're referring to?

https://www.amd.com/system/files/documents/hp-elite-mt645-g7-mobile-thin-client.pdf

> BIOS has tried to work
> around this by setting the "StorageD3Enable" ACPI property, but only
> if it detected the "Linux-HPI-Hybrid-Graphics" _OSI() flag. This flag
> does not exist, so the BIOS workaround can't work.
>
> Instead, just set NVME_QUIRK_SIMPLE_SUSPEND when running on an mt645.
> The DMI_PRODUCT_NAME cannot be used because this string can be changed
> in the field. Match against DMI_BOARD_NAME, which should be immutable.
I'm quite confused why this is necessary.  If the product link
I sent above is correct, this is an AMD Barcelo APU.

Cezanne and Barcelo report as the exact same X86 model.

Cezanne will already always identify as simple
suspend due to bugs that were reported on some other machines.
It's been this way since kernel 6.3-rc1.

e2a56364485e ("ACPI: x86: utils: Add Cezanne to the list for forcing 
StorageD3Enable")

>
> Cc: stable@vger.kernel.org
> Signed-off-by: Alexandru Gagniuc <alexandru.gagniuc@hp.com>
> ---
>   drivers/nvme/host/pci.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 492f319ebdf3..25b59f5ce874 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -2897,6 +2897,15 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
>   		if ((dmi_match(DMI_BOARD_VENDOR, "LENOVO")) &&
>   		     dmi_match(DMI_BOARD_NAME, "LNVNB161216"))
>   			return NVME_QUIRK_SIMPLE_SUSPEND;
> +	} else if (dmi_match(DMI_SYS_VENDOR, "HP") &&
> +		   (dmi_match(DMI_BOARD_NAME, "8B0F") ||
> +		    dmi_match(DMI_BOARD_NAME, "8B59"))) {
> +		/*
> +		 * Force simple suspend to work around long resume latencies
> +		 * (1 minute or longer).
> +		 */
> +		dev_info(&pdev->dev, "simple suspend quirk for HP mt645\n");
> +		return NVME_QUIRK_SIMPLE_SUSPEND;
>   	}
>   
>   	return 0;

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

* Re: [PATCH] nvme-pci: Add suspend quirk for HP mt645 thin client
  2023-07-08  4:28 ` Limonciello, Mario
@ 2023-07-10 20:06   ` Gagniuc, Alexandru
  2023-07-10 22:28     ` Limonciello, Mario
  0 siblings, 1 reply; 4+ messages in thread
From: Gagniuc, Alexandru @ 2023-07-10 20:06 UTC (permalink / raw)
  To: Limonciello, Mario, linux-nvme
  Cc: kbusch, axboe, hch, sagi, linux-kernel, Zhang, Eniac, stable



________________________________________
From: Limonciello, Mario <mario.limonciello@amd.com>
Sent: Friday, July 7, 2023 11:28 PM
To: Gagniuc, Alexandru; linux-nvme@lists.infradead.org
Cc: kbusch@kernel.org; axboe@fb.com; hch@lst.de; sagi@grimberg.me; linux-kernel@vger.kernel.org; Zhang, Eniac; stable@vger.kernel.org
Subject: Re: [PATCH] nvme-pci: Add suspend quirk for HP mt645 thin client

CAUTION: External Email

On 7/6/2023 1:06 PM, Alexandru Gagniuc wrote:
> The HP Elite mt645 thin client exhibits resume times of over one
> minute when using the normal nvme resume path.

Is this the specific product you're referring to?

https://www.amd.com/system/files/documents/hp-elite-mt645-g7-mobile-thin-client.pdf<https://www.amd.com/system/files/documents/hp-elite-mt645-g7-mobile-thin-client.pdf>

> BIOS has tried to work
> around this by setting the "StorageD3Enable" ACPI property, but only
> if it detected the "Linux-HPI-Hybrid-Graphics" _OSI() flag. This flag
> does not exist, so the BIOS workaround can't work.
>
> Instead, just set NVME_QUIRK_SIMPLE_SUSPEND when running on an mt645.
> The DMI_PRODUCT_NAME cannot be used because this string can be changed
> in the field. Match against DMI_BOARD_NAME, which should be immutable.
I'm quite confused why this is necessary.  If the product link
I sent above is correct, this is an AMD Barcelo APU.

Cezanne and Barcelo report as the exact same X86 model.

Cezanne will already always identify as simple
suspend due to bugs that were reported on some other machines.
It's been this way since kernel 6.3-rc1.

e2a56364485e ("ACPI: x86: utils: Add Cezanne to the list for forcing
StorageD3Enable")
[snip]

Hi Mario,

The product link you posted is correct. I was not aware of e2a56364485e
when I developed the fix herein before v6.3. After some quick testing, I can
confirm that e2a56364485e solves the original issue.

We do not need this patch then.

Thank you,
Alex



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

* Re: [PATCH] nvme-pci: Add suspend quirk for HP mt645 thin client
  2023-07-10 20:06   ` Gagniuc, Alexandru
@ 2023-07-10 22:28     ` Limonciello, Mario
  0 siblings, 0 replies; 4+ messages in thread
From: Limonciello, Mario @ 2023-07-10 22:28 UTC (permalink / raw)
  To: Gagniuc, Alexandru, linux-nvme
  Cc: kbusch, axboe, hch, sagi, linux-kernel, Zhang, Eniac, stable


On 7/10/2023 3:06 PM, Gagniuc, Alexandru wrote:
> [snip]
> Hi Mario,
>
> The product link you posted is correct. I was not aware of e2a56364485e
> when I developed the fix herein before v6.3. After some quick testing, I can
> confirm that e2a56364485e solves the original issue.
>
> We do not need this patch then.
>
> Thank you,
> Alex
>
Great, thanks for confirming.  Just as an FYI to you we don't have any 
intention
to grow that list any further.  Those were added because the platforms 
came at
a time that StorageD3Enable was just being introduced and there were 
bugs with too
many missing it.

If you have future AMD based products that use newer hardware such as 
Rembrandt or
Phoenix that you need to fix this in the BIOS properly.


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

end of thread, other threads:[~2023-07-10 22:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 18:06 [PATCH] nvme-pci: Add suspend quirk for HP mt645 thin client Alexandru Gagniuc
2023-07-08  4:28 ` Limonciello, Mario
2023-07-10 20:06   ` Gagniuc, Alexandru
2023-07-10 22:28     ` Limonciello, Mario

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®