public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-pci: Avoid the deepest sleep state on Wester Digital SSD
@ 2025-01-17 16:46 Saúl Valdelvira
  2025-01-24 16:31 ` Keith Busch
  0 siblings, 1 reply; 3+ messages in thread
From: Saúl Valdelvira @ 2025-01-17 16:46 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi; +Cc: Saúl Valdelvira, linux-nvme, linux-kernel

The Western Digital PC SN520 NVMe SSD has a firmware issue that causes
it to hang when APST is enabled. This bug freezes the computer and
forces the user to cold-reboot.

Add a quirk for this model to avoid the deepest sleep states.

Signed-off-by: Saúl Valdelvira <saul@saulv.es>
---
Hello, my name is Saúl.
Here's a patch that works arround a firmware issue I've been
experiencing for years in the aforementioned SSD card model.

Long story short:
4 years ago I bought a new laptop, and for some reason I was unable to
install Linux on it. Everytime I booted Linux, the computer hanged after
a few seconds.

I've been working arround this issue by setting the following kernel
parameter: nvme_core.default_ps_max_latency_us=14000

Adding the NVME_QUIRK_NO_DEEPEST_PS flag fixed the issue completely.

This [1] page from Dell's web mentions a firmware update for this SSD
with number 20240012 that seems to address the issue.
The problem is that, as far as i know, Western Digital doesn't offer
official firmware updates for Linux. At least, I haven't been able to
update it.

Here's some info about my SSD
- Model: WDC PC SN520 SDAPNUW-512G-1014
- Vendor: Western Digital
- Firmware Revision: 20110000

Hope you find this patch usefull.

[1] https://www.dell.com/support/home/en-uk/drivers/driversdetails?driverid=ffk91&lwp=rt
---

 drivers/nvme/host/pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index e2634f437f33..20a94e479caf 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3760,6 +3760,8 @@ static const struct pci_device_id nvme_id_table[] = {
 				NVME_QUIRK_SHARED_TAGS |
 				NVME_QUIRK_SKIP_CID_GEN |
 				NVME_QUIRK_IDENTIFY_CNS },
+	{ PCI_DEVICE(0x15b7, 0x5003), /* WDC PC SN520 SDAPNUW-512G-1014 */
+		.driver_data = NVME_QUIRK_NO_DEEPEST_PS },
 	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
 	{ 0, }
 };
--
2.48.1


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

end of thread, other threads:[~2025-01-26 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 16:46 [PATCH] nvme-pci: Avoid the deepest sleep state on Wester Digital SSD Saúl Valdelvira
2025-01-24 16:31 ` Keith Busch
2025-01-26 20:14   ` Saúl Valdelvira

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