Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic PR kern/55839:



details:   https://anonhg.NetBSD.org/src/rev/68ce4b9c4f43
branches:  trunk
changeset: 946625:68ce4b9c4f43
user:      kardel <kardel%NetBSD.org@localhost>
date:      Fri Dec 04 23:03:11 2020 +0000

description:
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 ed675f1a2a04 -r 68ce4b9c4f43 sys/dev/ic/nvme.c
--- a/sys/dev/ic/nvme.c Fri Dec 04 22:47:57 2020 +0000
+++ b/sys/dev/ic/nvme.c Fri Dec 04 23:03:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvme.c,v 1.52 2020/11/10 07:39:12 rin Exp $    */
+/*     $NetBSD: nvme.c,v 1.53 2020/12/04 23:03:11 kardel 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.52 2020/11/10 07:39:12 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.53 2020/12/04 23:03:11 kardel Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -628,6 +628,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 */
 
@@ -665,9 +671,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