]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
mi: Add inter-command-delay quirk for Samsung MZUL2512 devices
authorJeremy Kerr <jk@codeconstruct.com.au>
Wed, 21 Sep 2022 12:57:01 +0000 (20:57 +0800)
committerJeremy Kerr <jk@codeconstruct.com.au>
Thu, 3 Nov 2022 05:53:50 +0000 (13:53 +0800)
This change is our first application of a quirk: Samsung MZUL2512
devices need the inter-command-delay of around 1ms. Make it 1.2ms just
to be safe.

This makes these devices work in my environment. Otherwise, commands
will get dropped, and subsequently time out.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
src/nvme/mi.c

index a3ea7b19dfb5fd713f44fe99897ab3e14dec8abc..269789e7fe137a78812c3ead3fde6b0fc5ea39a4 100644 (file)
@@ -165,7 +165,14 @@ void nvme_mi_ep_probe(struct nvme_mi_ep *ep)
                goto out_close;
        }
 
-       /* no quirks defined yet... */
+       /* Samsung MZUL2512: cannot receive commands sent within ~1ms of
+        * the previous response. Set an inter-command delay of 1.2ms for
+        * a little extra tolerance.
+        */
+       if (nvme_mi_compare_vid_mn(ep, &id, 0x144d, "MZUL2512HCJQ")) {
+               ep->quirks |= NVME_QUIRK_MIN_INTER_COMMAND_TIME;
+               ep->inter_command_us = 1200;
+       }
 
        /* If we're quirking for the inter-command time, record the last
         * command time now, so we don't conflict with the just-sent identify.