Skip to content

Commit 5bedd3a

Browse files
author
Christoph Hellwig
committed
nvme: add a Identify Namespace Identification Descriptor list quirk
Add a quirk for a device that does not support the Identify Namespace Identification Descriptor list despite claiming 1.3 compliance. Fixes: ea43d97 ("nvme: fix identify error status silent ignore") Reported-by: Ingo Brunberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Ingo Brunberg <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]>
1 parent 5611ec2 commit 5bedd3a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-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: 2 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 */

0 commit comments

Comments
 (0)