blob: f1d08b1217ba959ed34393e350e8d3ade85c2b02 [file] [log] [blame]
From f8b8187fbde9a1d94351ca403ca02b62eb19c920 Mon Sep 17 00:00:00 2001
From: Mark Hsieh <mark_hsieh@wistron.corp-partner.google.com>
Date: Thu, 26 Nov 2020 11:19:05 +0800
Subject: [PATCH] FROMLIST: nvme-pci: disable write zeros support on specific
SSDs
Like commit 5611ec2b9814 ("nvme-pci: prevent SK hynix PC400 from using
Write Zeroes command"), Samsung, Phison and Kingston have the same issue:
[ 6305.633887] blk_update_request: operation not supported error, dev nvme0n1, sector 340812032 op 0x9:(WRITE_ZEROES) flags 0x0 phys_seg 0 prio class 0
So also disable Write Zeroes command on Samsung, Phison and Kingston.
Signed-off-by: Mark Hsieh <mark_hsieh@wistron.corp-partner.google.com>
(am from https://lore.kernel.org/patchwork/patch/1345363/)
(also found at https://lore.kernel.org/r/20201126031905.29481-1-mark_hsieh@wistron.corp-partner.google.com)
BUG=b:172129782
TEST=tested on an Eldrid
Signed-off-by: Alex Levin <levinale@chromium.org>
Change-Id: I8bd41148039bd7f7d51a6fe88e09df276d95ab61
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2568167
Commit-Queue: Alex Levin <levinale@google.com>
Tested-by: Alex Levin <levinale@google.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: YH Lin <yueherngl@chromium.org>
Conflicts: drivers/nvme/host/pci.c
[rebase510(groeck): Context conflicts]
Signed-off-by: Guenter Roeck <groeck@chromium.org>
---
drivers/nvme/host/pci.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 7249ae74f71f..acbf345b5f2a 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3286,6 +3286,13 @@ static const struct pci_device_id nvme_id_table[] = {
.driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, },
{ PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0xcd02),
.driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, },
+ { PCI_DEVICE(0x144d, 0xa809), /* Samsung 128HBHQ and 256HAJD */
+ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+ { PCI_DEVICE(0x1987, 0x5013), /* Phison PS5013 E13 */
+ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+ { PCI_DEVICE(0x2646, 0x500d), /* Kingston OM3PDP3256B-AH 256G */
+ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+ { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001),
.driver_data = NVME_QUIRK_SINGLE_VECTOR },
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
--
2.17.1