Skip to contentSkip to conversation

nvme/pci: Add sleep quirk for Samsung and Toshiba drives

PATCH Superseded Jon Derrick 2 participants 4 messages Jan 21, 2020 – Feb 3, 2020 NVMe

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme/pci: Add sleep quirk for Samsung and Toshiba drives

From: shyjumon <[email protected]>

From: Shyjumon N <[email protected]>

The Samsung SSD SM981/PM981 and Toshiba SSD KBG40ZNT256G on the Lenovo C640 platform experience runtime resume issues when the SSDs are kept in sleep/suspend mode for long time.

This patch applies the 'Simple Suspend' quirk to these configurations. With this patch, the issue had not been observed in a 1+ day test.

[jonathan.derrick: fix up commit message]
---
 drivers/nvme/host/pci.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/nvme/host/pci.c +12 -0
index d37dcc1b629e..4f7770fe2f41 100644
@@ -2733,6 +2733,18 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
 		    (dmi_match(DMI_BOARD_NAME, "PRIME B350M-A") ||
 		     dmi_match(DMI_BOARD_NAME, "PRIME Z370-A")))
 			return NVME_QUIRK_NO_APST;
+	} else if ((pdev->vendor == 0x144d && (pdev->device == 0xa801 ||
+		    pdev->device == 0xa808 || pdev->device == 0xa809)) ||
+		   (pdev->vendor == 0x1e0f && pdev->device == 0x0001)) {
+		/*
+		 * Forcing to use host managed nvme power settings for
+		 * lowest idle power with quick resume latency on
+		 * Samsung and Toshiba SSDs based on suspend behavior
+		 * on Coffee Lake board for LENOVO C640
+		 */
+		if ((dmi_match(DMI_BOARD_VENDOR, "LENOVO")) &&
+		     dmi_match(DMI_BOARD_NAME, "LNVNB161216"))
+			return NVME_QUIRK_SIMPLE_SUSPEND;
 	}
 
 	return 0;
Signature · 7 lines
2.20.1


_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
#1 lore raw
Quoted 8 lines · Jon Derrick

From: shyjumon <[email protected]>

From: Shyjumon N <[email protected]>

The Samsung SSD SM981/PM981 and Toshiba SSD KBG40ZNT256G on the Lenovo C640 platform experience runtime resume issues when the SSDs are kept in sleep/suspend mode for long time.

Quoted 6 lines

This patch applies the 'Simple Suspend' quirk to these configurations. With this patch, the issue had not been observed in a 1+ day test.

[jonathan.derrick: fix up commit message]

Sorry the signoff ordering is reversed here. Should be Shyjumon first.

That being said, I wonder if there's something else the driver should be doing for the whole range of devices and platform combos that seem to require similar pm quirks.

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#2 lore raw
Quoted 3 lines · Jonathan

That being said, I wonder if there's something else the driver should be doing for the whole range of devices and platform combos that seem to require similar pm quirks.

Well, any idea of what we could do? We're trying to follow the spec here, but apparently drivers only get tested with one or two windows drivers. We could try to reverse engineer what they do, and given that the only one with autonomous is the Intel one, maybe someone from Intel could help?

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#3 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 3 lines · Jonathan

That being said, I wonder if there's something else the driver should be doing for the whole range of devices and platform combos that seem to require similar pm quirks.

Well, any idea of what we could do? We're trying to follow the spec here, but apparently drivers only get tested with one or two windows drivers. We could try to reverse engineer what they do, and given that the only one with autonomous is the Intel one, maybe someone from Intel could help?

Actually I was simply thinking of code organization. Right now some PM quirks exist in pci.c and some in core.c. I can't comment on what other vendors do and we're simply reactive to these issues in the platform.
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme