Skip to content

Commit 107b4e0

Browse files
Georg Gottleuberkeithbusch
authored andcommitted
nvme-pci: Add sleep quirk for Kingston drives
Some Kingston NV1 and A2000 are wasting a lot of power on specific TUXEDO platforms in s2idle sleep if 'Simple Suspend' is used. This patch applies a new quirk 'Force No Simple Suspend' to achieve a low power sleep without 'Simple Suspend'. Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Signed-off-by: Georg Gottleuber <ggo@tuxedocomputers.com> Cc: <stable@vger.kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 839a40d commit 107b4e0

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

drivers/nvme/host/nvme.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ enum nvme_quirks {
156156
* No temperature thresholds for channels other than 0 (Composite).
157157
*/
158158
NVME_QUIRK_NO_SECONDARY_TEMP_THRESH = (1 << 19),
159+
160+
/*
161+
* Disables simple suspend/resume path.
162+
*/
163+
NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND = (1 << 20),
159164
};
160165

161166
/*

drivers/nvme/host/pci.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2902,6 +2902,18 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
29022902
if ((dmi_match(DMI_BOARD_VENDOR, "LENOVO")) &&
29032903
dmi_match(DMI_BOARD_NAME, "LNVNB161216"))
29042904
return NVME_QUIRK_SIMPLE_SUSPEND;
2905+
} else if (pdev->vendor == 0x2646 && (pdev->device == 0x2263 ||
2906+
pdev->device == 0x500f)) {
2907+
/*
2908+
* Exclude some Kingston NV1 and A2000 devices from
2909+
* NVME_QUIRK_SIMPLE_SUSPEND. Do a full suspend to save a
2910+
* lot fo energy with s2idle sleep on some TUXEDO platforms.
2911+
*/
2912+
if (dmi_match(DMI_BOARD_NAME, "NS5X_NS7XAU") ||
2913+
dmi_match(DMI_BOARD_NAME, "NS5x_7xAU") ||
2914+
dmi_match(DMI_BOARD_NAME, "NS5x_7xPU") ||
2915+
dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1"))
2916+
return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND;
29052917
}
29062918

29072919
return 0;
@@ -2932,7 +2944,9 @@ static struct nvme_dev *nvme_pci_alloc_dev(struct pci_dev *pdev,
29322944
dev->dev = get_device(&pdev->dev);
29332945

29342946
quirks |= check_vendor_combination_bug(pdev);
2935-
if (!noacpi && acpi_storage_d3(&pdev->dev)) {
2947+
if (!noacpi &&
2948+
!(quirks & NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND) &&
2949+
acpi_storage_d3(&pdev->dev)) {
29362950
/*
29372951
* Some systems use a bios work around to ask for D3 on
29382952
* platforms that support kernel managed suspend.

0 commit comments

Comments
 (0)