Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/211f8c935c36
branches:  netbsd-8
changeset: 946754:211f8c935c36
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Dec 07 20:05:36 2020 +0000

description:
Pull up following revision(s) (requested by kardel in ticket #1633):

        sys/dev/ic/nvme.c: revision 1.53

PR kern/55839:

handle multiple nvme_rescan()s correctly by doing the
name-space identify only once per nsid.
fixes issue where modloading triggers multiple
rescans.

diffstat:

 sys/dev/ic/nvme.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r 135cce3edc32 -r 211f8c935c36 sys/dev/ic/nvme.c
--- a/sys/dev/ic/nvme.c Mon Dec 07 20:01:01 2020 +0000
+++ b/sys/dev/ic/nvme.c Mon Dec 07 20:05:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvme.c,v 1.30.2.8 2020/09/27 10:33:45 martin Exp $     */
+/*     $NetBSD: nvme.c,v 1.30.2.9 2020/12/07 20:05:36 martin Exp $     */
 /*     $OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.30.2.8 2020/09/27 10:33:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.30.2.9 2020/12/07 20:05:36 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -625,6 +625,12 @@
 
        KASSERT(nsid > 0);
 
+       ns = nvme_ns_get(sc, nsid);
+       KASSERT(ns);
+
+       if (ns->ident != NULL)
+               return 0;
+
        ccb = nvme_ccb_get(sc->sc_admin_q, false);
        KASSERT(ccb != NULL); /* it's a bug if we don't have spare ccb here */
 
@@ -662,9 +668,6 @@
        /* Convert data to host endian */
        nvme_identify_namespace_swapbytes(identify);
 
-       ns = nvme_ns_get(sc, nsid);
-       KASSERT(ns);
-       KASSERT(ns->ident == NULL);
        ns->ident = identify;
 
 done:



Home | Main Index | Thread Index | Old Index