]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvme: add a Identify Namespace Identification Descriptor list quirk
authorChristoph Hellwig <hch@lst.de>
Tue, 28 Jul 2020 11:09:03 +0000 (13:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:44 +0000 (09:58 +0200)
[ Upstream commit 5bedd3afee8eb01ccd256f0cd2cc0fa6f841417a ]

Add a quirk for a device that does not support the Identify Namespace
Identification Descriptor list despite claiming 1.3 compliance.

Fixes: ea43d9709f72 ("nvme: fix identify error status silent ignore")
Reported-by: Ingo Brunberg <ingo_brunberg@web.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Ingo Brunberg <ingo_brunberg@web.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c

index 137d7bcc135852a08e73ad1f4676318e5aed98e0..f7540a9e54fd2efbc5651997d2390569f3fe4671 100644 (file)
@@ -1106,6 +1106,9 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
        int pos;
        int len;
 
+       if (ctrl->quirks & NVME_QUIRK_NO_NS_DESC_LIST)
+               return 0;
+
        c.identify.opcode = nvme_admin_identify;
        c.identify.nsid = cpu_to_le32(nsid);
        c.identify.cns = NVME_ID_CNS_NS_DESC_LIST;
@@ -1119,18 +1122,6 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
        if (status) {
                dev_warn(ctrl->device,
                        "Identify Descriptors failed (%d)\n", status);
-                /*
-                 * Don't treat non-retryable errors as fatal, as we potentially
-                 * already have a NGUID or EUI-64.  If we failed with DNR set,
-                 * we want to silently ignore the error as we can still
-                 * identify the device, but if the status has DNR set, we want
-                 * to propagate the error back specifically for the disk
-                 * revalidation flow to make sure we don't abandon the
-                 * device just because of a temporal retry-able error (such
-                 * as path of transport errors).
-                 */
-               if (status > 0 && (status & NVME_SC_DNR))
-                       status = 0;
                goto free_data;
        }
 
index 46f965f8c9bcd29a888ba0442a767d4208643dc5..8f1b0a30fd2a6e253c00e8651e1f995a8c534593 100644 (file)
@@ -126,6 +126,13 @@ enum nvme_quirks {
         * Don't change the value of the temperature threshold feature
         */
        NVME_QUIRK_NO_TEMP_THRESH_CHANGE        = (1 << 14),
+
+       /*
+        * The controller doesn't handle the Identify Namespace
+        * Identification Descriptor list subcommand despite claiming
+        * NVMe 1.3 compliance.
+        */
+       NVME_QUIRK_NO_NS_DESC_LIST              = (1 << 15),
 };
 
 /*
index 4ad629eb3bc66bdbfe7f2d8e689aa8d13414d71d..10d65f27879fd0c59a30c6168f2f8ed7e41e8f5f 100644 (file)
@@ -3105,6 +3105,8 @@ static const struct pci_device_id nvme_id_table[] = {
        { PCI_VDEVICE(INTEL, 0x5845),   /* Qemu emulated controller */
                .driver_data = NVME_QUIRK_IDENTIFY_CNS |
                                NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+       { PCI_DEVICE(0x126f, 0x2263),   /* Silicon Motion unidentified */
+               .driver_data = NVME_QUIRK_NO_NS_DESC_LIST, },
        { PCI_DEVICE(0x1bb1, 0x0100),   /* Seagate Nytro Flash Storage */
                .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
        { PCI_DEVICE(0x1c58, 0x0003),   /* HGST adapter */