Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/dev/ic Pull up following revision(s) (requested by ml...



details:   https://anonhg.NetBSD.org/src/rev/a047a2bdf012
branches:  netbsd-9
changeset: 462735:a047a2bdf012
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Oct 28 18:30:43 2019 +0000

description:
Pull up following revision(s) (requested by mlelstv in ticket #383):

        sys/dev/ic/ld_nvme.c: revision 1.23

Don't attach an ld device if the format descriptor is unsupported/unused.

diffstat:

 sys/dev/ic/ld_nvme.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r a154c5025d46 -r a047a2bdf012 sys/dev/ic/ld_nvme.c
--- a/sys/dev/ic/ld_nvme.c      Mon Oct 28 16:41:31 2019 +0000
+++ b/sys/dev/ic/ld_nvme.c      Mon Oct 28 18:30:43 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld_nvme.c,v 1.22 2019/04/26 14:28:40 mlelstv Exp $     */
+/*     $NetBSD: ld_nvme.c,v 1.22.2.1 2019/10/28 18:30:43 martin Exp $  */
 
 /*-
  * Copyright (C) 2016 NONAKA Kimihiro <nonaka%netbsd.org@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.22 2019/04/26 14:28:40 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.22.2.1 2019/10/28 18:30:43 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -105,6 +105,19 @@
        KASSERT(ns);
        f = &ns->ident->lbaf[NVME_ID_NS_FLBAS(ns->ident->flbas)];
 
+       /*
+        * NVME1.0e 6.11 Identify command
+        *
+        * LBADS values smaller than 9 are not supported, a value
+        * of zero means that the format is not used.
+        */
+       if (f->lbads < 9) {
+               if (f->lbads > 0)
+                       aprint_error_dev(self,
+                           "unsupported logical data size %u\n", f->lbads);
+               return;
+       }
+
        ld->sc_secsize = 1 << f->lbads;
        ld->sc_secperunit = ns->ident->nsze;
        ld->sc_maxxfer = naa->naa_maxphys;



Home | Main Index | Thread Index | Old Index