hello. Following up on this issue, I've discovered the problem with devsw_attach is that if one is reattaching a previously detached driver and that driver does not implementa bdev interface, devsw_attach returns an EINVAL error. The following patch fixes this problem. Any reason I should not commit this change and request pullups for NetBSD-9 and NetBSD-10?
-thanks -Brian Index: subr_devsw.c =================================================================== RCS file: /cvsroot/src/sys/kern/subr_devsw.c,v retrieving revision 1.49 diff -u -r1.49 subr_devsw.c --- subr_devsw.c 29 Oct 2022 10:52:36 -0000 1.49 +++ subr_devsw.c 10 Feb 2023 19:11:24 -0000 @@ -1,4 +1,4 @@ -/* $NetBSD$ */ +/* $NetBSD: subr_devsw.c,v 1.49 2022/10/29 10:52:36 riastradh Exp $ */ /*- * Copyright (c) 2001, 2002, 2007, 2008 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD$"); +__KERNEL_RCSID(0, "$NetBSD: subr_devsw.c,v 1.49 2022/10/29 10:52:36 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_dtrace.h" @@ -397,7 +397,7 @@ if (conv->d_name == NULL || strcmp(devname, conv->d_name) != 0) continue; - if (*bmajor < 0) + if ((bdev != NULL) && (*bmajor < 0)) *bmajor = conv->d_bmajor; if (*cmajor < 0) *cmajor = conv->d_cmajor;