aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/nvme/host/core.c3
-rw-r--r--drivers/nvme/host/nvme.h5
-rw-r--r--drivers/nvme/host/pci.c3
3 files changed, 9 insertions, 2 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index b92fab434066..951e9f31b57c 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1531,7 +1531,8 @@ static inline void nvme_config_write_zeroes(struct nvme_ns *ns)
1531 u32 max_sectors; 1531 u32 max_sectors;
1532 unsigned short bs = 1 << ns->lba_shift; 1532 unsigned short bs = 1 << ns->lba_shift;
1533 1533
1534 if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES)) 1534 if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) ||
1535 (ns->ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES))
1535 return; 1536 return;
1536 /* 1537 /*
1537 * Even though NVMe spec explicitly states that MDTS is not 1538 * Even though NVMe spec explicitly states that MDTS is not
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index b91f1838bbd5..527d64545023 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -87,6 +87,11 @@ enum nvme_quirks {
87 * Ignore device provided subnqn. 87 * Ignore device provided subnqn.
88 */ 88 */
89 NVME_QUIRK_IGNORE_DEV_SUBNQN = (1 << 8), 89 NVME_QUIRK_IGNORE_DEV_SUBNQN = (1 << 8),
90
91 /*
92 * Broken Write Zeroes.
93 */
94 NVME_QUIRK_DISABLE_WRITE_ZEROES = (1 << 9),
90}; 95};
91 96
92/* 97/*
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index f54718b63637..3a2377888a46 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2975,7 +2975,8 @@ static const struct pci_device_id nvme_id_table[] = {
2975 { PCI_VDEVICE(INTEL, 0xf1a6), /* Intel 760p/Pro 7600p */ 2975 { PCI_VDEVICE(INTEL, 0xf1a6), /* Intel 760p/Pro 7600p */
2976 .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, 2976 .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, },
2977 { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */ 2977 { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */
2978 .driver_data = NVME_QUIRK_IDENTIFY_CNS, }, 2978 .driver_data = NVME_QUIRK_IDENTIFY_CNS |
2979 NVME_QUIRK_DISABLE_WRITE_ZEROES, },
2979 { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */ 2980 { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */
2980 .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, 2981 .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
2981 { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */ 2982 { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */