Skip to content

Commit e2c46b5

Browse files
committed
Merge tag 'block-5.8-2020-07-30' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "Three NVMe fixes" * tag 'block-5.8-2020-07-30' of git://git.kernel.dk/linux-block: nvme: add a Identify Namespace Identification Descriptor list quirk nvme-pci: prevent SK hynix PC400 from using Write Zeroes command nvme-tcp: fix possible hang waiting for icresp response
2 parents 0513b9d + d6364a8 commit e2c46b5

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

drivers/nvme/host/core.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,9 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
11021102
int pos;
11031103
int len;
11041104

1105+
if (ctrl->quirks & NVME_QUIRK_NO_NS_DESC_LIST)
1106+
return 0;
1107+
11051108
c.identify.opcode = nvme_admin_identify;
11061109
c.identify.nsid = cpu_to_le32(nsid);
11071110
c.identify.cns = NVME_ID_CNS_NS_DESC_LIST;
@@ -1115,18 +1118,6 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
11151118
if (status) {
11161119
dev_warn(ctrl->device,
11171120
"Identify Descriptors failed (%d)\n", status);
1118-
/*
1119-
* Don't treat non-retryable errors as fatal, as we potentially
1120-
* already have a NGUID or EUI-64. If we failed with DNR set,
1121-
* we want to silently ignore the error as we can still
1122-
* identify the device, but if the status has DNR set, we want
1123-
* to propagate the error back specifically for the disk
1124-
* revalidation flow to make sure we don't abandon the
1125-
* device just because of a temporal retry-able error (such
1126-
* as path of transport errors).
1127-
*/
1128-
if (status > 0 && (status & NVME_SC_DNR))
1129-
status = 0;
11301121
goto free_data;
11311122
}
11321123

drivers/nvme/host/nvme.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ enum nvme_quirks {
129129
* Don't change the value of the temperature threshold feature
130130
*/
131131
NVME_QUIRK_NO_TEMP_THRESH_CHANGE = (1 << 14),
132+
133+
/*
134+
* The controller doesn't handle the Identify Namespace
135+
* Identification Descriptor list subcommand despite claiming
136+
* NVMe 1.3 compliance.
137+
*/
138+
NVME_QUIRK_NO_NS_DESC_LIST = (1 << 15),
132139
};
133140

134141
/*

drivers/nvme/host/pci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,6 +3099,8 @@ static const struct pci_device_id nvme_id_table[] = {
30993099
{ PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */
31003100
.driver_data = NVME_QUIRK_IDENTIFY_CNS |
31013101
NVME_QUIRK_DISABLE_WRITE_ZEROES, },
3102+
{ PCI_DEVICE(0x126f, 0x2263), /* Silicon Motion unidentified */
3103+
.driver_data = NVME_QUIRK_NO_NS_DESC_LIST, },
31023104
{ PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */
31033105
.driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
31043106
{ PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */
@@ -3122,6 +3124,8 @@ static const struct pci_device_id nvme_id_table[] = {
31223124
{ PCI_DEVICE(0x1cc1, 0x8201), /* ADATA SX8200PNP 512GB */
31233125
.driver_data = NVME_QUIRK_NO_DEEPEST_PS |
31243126
NVME_QUIRK_IGNORE_DEV_SUBNQN, },
3127+
{ PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */
3128+
.driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
31253129
{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
31263130
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001),
31273131
.driver_data = NVME_QUIRK_SINGLE_VECTOR },

drivers/nvme/host/tcp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,9 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
13821382
if (nctrl->opts->tos >= 0)
13831383
ip_sock_set_tos(queue->sock->sk, nctrl->opts->tos);
13841384

1385+
/* Set 10 seconds timeout for icresp recvmsg */
1386+
queue->sock->sk->sk_rcvtimeo = 10 * HZ;
1387+
13851388
queue->sock->sk->sk_allocation = GFP_ATOMIC;
13861389
nvme_tcp_set_queue_io_cpu(queue);
13871390
queue->request = NULL;

0 commit comments

Comments
 (0)