Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic The namespace id is a 32bit value, in particular ...



details:   https://anonhg.NetBSD.org/src/rev/cbff82c03ddc
branches:  trunk
changeset: 368730:cbff82c03ddc
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Jul 31 12:02:28 2022 +0000

description:
The namespace id is a 32bit value, in particular the "all namespaces" value
for global commands is 0xffffffff. While the driver only supports 16bit
numbers (device minor & 0xffff), we need to use the full value for pass
through commands.

This fixes e.g. logpage requests on the controller level.

diffstat:

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

diffs (45 lines):

diff -r 0345e9dc15c2 -r cbff82c03ddc sys/dev/ic/nvme.c
--- a/sys/dev/ic/nvme.c Sun Jul 31 11:58:37 2022 +0000
+++ b/sys/dev/ic/nvme.c Sun Jul 31 12:02:28 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvme.c,v 1.60 2022/05/07 08:20:04 skrll Exp $  */
+/*     $NetBSD: nvme.c,v 1.61 2022/07/31 12:02:28 mlelstv 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.60 2022/05/07 08:20:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.61 2022/07/31 12:02:28 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -131,7 +131,7 @@
 static void    nvme_pt_done(struct nvme_queue *, struct nvme_ccb *,
                    struct nvme_cqe *);
 static int     nvme_command_passthrough(struct nvme_softc *,
-                   struct nvme_pt_command *, uint16_t, struct lwp *, bool);
+                   struct nvme_pt_command *, uint32_t, struct lwp *, bool);
 
 static int     nvme_set_number_of_queues(struct nvme_softc *, u_int, u_int *,
                    u_int *);
@@ -1264,7 +1264,7 @@
 
 static int
 nvme_command_passthrough(struct nvme_softc *sc, struct nvme_pt_command *pt,
-    uint16_t nsid, struct lwp *l, bool is_adminq)
+    uint32_t nsid, struct lwp *l, bool is_adminq)
 {
        struct nvme_queue *q;
        struct nvme_ccb *ccb;
@@ -2218,7 +2218,7 @@
        case NVME_PASSTHROUGH_CMD:
                pt = data;
                return nvme_command_passthrough(sc, data,
-                   nsid == 0 ? pt->cmd.nsid : nsid, l, nsid == 0);
+                   nsid == 0 ? pt->cmd.nsid : (uint32_t)nsid, l, nsid == 0);
        }
 
        return ENOTTY;



Home | Main Index | Thread Index | Old Index