Re: null-terminated vs. nul-terminated

2022-03-29 Thread Warner Losh
On Tue, Mar 29, 2022, 5:40 AM Greg Troxel  wrote:

>
> "David H. Gutteridge"  writes:
>
> Thanks for the history and it is  all sensible.
>
> > "nul-terminated" and "null-terminated" seemed more common in man pages
> > that originated from historical BSD sources, so, lacking any style
> > guide, I inferred the lowercase "nul" was more "correct" as "BSD style"
> > (excepting modern OpenBSD), even though that looks a bit odd to me. I
> > then examined where "nul-terminated" came from, and found these bulk
> > commits, which imply a standard.
>
> > date: 2005-01-02 18:38:04 +;  author: wiz;
> > Mark up NULL, and replace null by nul where appropriate.
> >
> > date: 2006-10-16 08:48:45 +;  author: wiz;
> > nul/null/NULL cleanup:
> > when talking about characters/bytes, use "nul" and "nul-terminate"
> > when talking about pointers, use "null pointer" or ".Dv NULL"
> >
> > So that seemed to me the established style.
>
> It may have been BSD style, but I think it's wrong to use lowercase for
> an ASCII codepoint.  And therefore it is confusing to people who know
> that the ASCII zero byte is written NUL.
>

FreeBSD has adopted the POSIX language (null terminated) because it mirrors
the standard and the xopen folks have blanket permission to use it in open
source man pages...

Warner

>


CVS commit: src/sys/dev/pci

2022-03-29 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Mar 30 02:45:14 UTC 2022

Modified Files:
src/sys/dev/pci: if_vmx.c

Log Message:
vmxnet3_stop_rendezvous() requires workqueue_wait() to wait workqueue not 
scheduled yet.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_vmx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_vmx.c
diff -u src/sys/dev/pci/if_vmx.c:1.6 src/sys/dev/pci/if_vmx.c:1.7
--- src/sys/dev/pci/if_vmx.c:1.6	Sun Feb 13 19:07:38 2022
+++ src/sys/dev/pci/if_vmx.c	Wed Mar 30 02:45:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.6 2022/02/13 19:07:38 riastradh Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.7 2022/03/30 02:45:14 knakahara Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.6 2022/02/13 19:07:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.7 2022/03/30 02:45:14 knakahara Exp $");
 
 #include 
 #include 
@@ -2714,6 +2714,7 @@ vmxnet3_stop_rendezvous(struct vmxnet3_s
 {
 	struct vmxnet3_rxqueue *rxq;
 	struct vmxnet3_txqueue *txq;
+	struct vmxnet3_queue *vmxq;
 	int i;
 
 	for (i = 0; i < sc->vmx_nrxqueues; i++) {
@@ -2726,6 +2727,10 @@ vmxnet3_stop_rendezvous(struct vmxnet3_s
 		VMXNET3_TXQ_LOCK(txq);
 		VMXNET3_TXQ_UNLOCK(txq);
 	}
+	for (i = 0; i < sc->vmx_nrxqueues; i++) {
+		vmxq = &sc->vmx_queue[i];
+		workqueue_wait(sc->vmx_queue_wq, &vmxq->vxq_wq_cookie);
+	}
 }
 
 static void



CVS commit: src/sys/dev/pci

2022-03-29 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Mar 30 02:45:14 UTC 2022

Modified Files:
src/sys/dev/pci: if_vmx.c

Log Message:
vmxnet3_stop_rendezvous() requires workqueue_wait() to wait workqueue not 
scheduled yet.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_vmx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/i2c

2022-03-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Mar 30 00:06:51 UTC 2022

Modified Files:
src/sys/dev/i2c: am2315.c dbcool.c hytp14.c scmdi2c.c sgp40.c sht3x.c
sht4x.c si70xx.c spdmem_i2c.c

Log Message:
These modules need to depend on iic, not just on i2cexec.  (They will
still recursively get i2cexec since the iic depends on it.)

Partial fix for kern/56772


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/am2315.c
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/i2c/dbcool.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/i2c/hytp14.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/scmdi2c.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/sgp40.c src/sys/dev/i2c/sht4x.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/sht3x.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/si70xx.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/i2c/spdmem_i2c.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/am2315.c
diff -u src/sys/dev/i2c/am2315.c:1.6 src/sys/dev/i2c/am2315.c:1.7
--- src/sys/dev/i2c/am2315.c:1.6	Tue Jun 15 04:40:13 2021
+++ src/sys/dev/i2c/am2315.c	Wed Mar 30 00:06:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: am2315.c,v 1.6 2021/06/15 04:40:13 mlelstv Exp $	*/
+/*	$NetBSD: am2315.c,v 1.7 2022/03/30 00:06:50 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2017 Brad Spencer 
@@ -17,7 +17,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: am2315.c,v 1.6 2021/06/15 04:40:13 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am2315.c,v 1.7 2022/03/30 00:06:50 pgoyette Exp $");
 
 /*
  * Driver for the Aosong AM2315
@@ -475,7 +475,7 @@ am2315_detach(device_t self, int flags)
 	return 0;
 }
 
-MODULE(MODULE_CLASS_DRIVER, am2315temp, "i2cexec,sysmon_envsys");
+MODULE(MODULE_CLASS_DRIVER, am2315temp, "iic,sysmon_envsys");
 
 #ifdef _MODULE
 #include "ioconf.c"

Index: src/sys/dev/i2c/dbcool.c
diff -u src/sys/dev/i2c/dbcool.c:1.63 src/sys/dev/i2c/dbcool.c:1.64
--- src/sys/dev/i2c/dbcool.c:1.63	Mon Aug  9 20:49:09 2021
+++ src/sys/dev/i2c/dbcool.c	Wed Mar 30 00:06:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool.c,v 1.63 2021/08/09 20:49:09 andvar Exp $ */
+/*	$NetBSD: dbcool.c,v 1.64 2022/03/30 00:06:50 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.63 2021/08/09 20:49:09 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.64 2022/03/30 00:06:50 pgoyette Exp $");
 
 #include 
 #include 
@@ -2189,7 +2189,7 @@ dbcool_set_fan_limits(struct dbcool_soft
 	}
 }
 
-MODULE(MODULE_CLASS_DRIVER, dbcool, "i2cexec,sysmon_envsys");
+MODULE(MODULE_CLASS_DRIVER, dbcool, "iic,sysmon_envsys");
 
 #ifdef _MODULE
 #include "ioconf.c"

Index: src/sys/dev/i2c/hytp14.c
diff -u src/sys/dev/i2c/hytp14.c:1.14 src/sys/dev/i2c/hytp14.c:1.15
--- src/sys/dev/i2c/hytp14.c:1.14	Tue Jun 15 04:39:49 2021
+++ src/sys/dev/i2c/hytp14.c	Wed Mar 30 00:06:50 2022
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1.14 2021/06/15 04:39:49 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1.15 2022/03/30 00:06:50 pgoyette Exp $");
 
 #include 
 #include 
@@ -487,7 +487,7 @@ sysctl_hytp14_interval(SYSCTLFN_ARGS)
 	return 0;
 }
 
-MODULE(MODULE_CLASS_DRIVER, hythygtemp, "i2cexec,sysmon_envsys");
+MODULE(MODULE_CLASS_DRIVER, hythygtemp, "iic,sysmon_envsys");
 
 #ifdef _MODULE
 #include "ioconf.c"

Index: src/sys/dev/i2c/scmdi2c.c
diff -u src/sys/dev/i2c/scmdi2c.c:1.1 src/sys/dev/i2c/scmdi2c.c:1.2
--- src/sys/dev/i2c/scmdi2c.c:1.1	Tue Dec  7 17:39:54 2021
+++ src/sys/dev/i2c/scmdi2c.c	Wed Mar 30 00:06:50 2022
@@ -1,5 +1,5 @@
 
-/*	$NetBSD: scmdi2c.c,v 1.1 2021/12/07 17:39:54 brad Exp $	*/
+/*	$NetBSD: scmdi2c.c,v 1.2 2022/03/30 00:06:50 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2021 Brad Spencer 
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scmdi2c.c,v 1.1 2021/12/07 17:39:54 brad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scmdi2c.c,v 1.2 2022/03/30 00:06:50 pgoyette Exp $");
 
 /*
  * I2C driver for the Sparkfun Serial motor controller.
@@ -233,7 +233,7 @@ scmdi2c_activate(device_t self, enum dev
 	}
 }
 
-MODULE(MODULE_CLASS_DRIVER, scmdi2c, "i2cexec,scmd");
+MODULE(MODULE_CLASS_DRIVER, scmdi2c, "iic,scmd");
 
 #ifdef _MODULE
 /* Like other drivers, we do this because the scmd common

Index: src/sys/dev/i2c/sgp40.c
diff -u src/sys/dev/i2c/sgp40.c:1.2 src/sys/dev/i2c/sgp40.c:1.3
--- src/sys/dev/i2c/sgp40.c:1.2	Wed Oct 20 17:52:44 2021
+++ src/sys/dev/i2c/sgp40.c	Wed Mar 30 00:06:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sgp40.c,v 1.2 2021/10/20 17:52:44 christos Exp $	*/
+/*	$NetBSD: sgp40.c,v 1.3 2022/03/30 00:06:50 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2021 Brad Spencer 
@@ -17,7 +17,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sgp40.c,v 1.2 2021/10/20 17:52:44 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgp40.c,v 1.3 2022/03/30 00:06:50 pgoyette Exp $");
 
 /*
   Driver for the Sensirion SGP40 

CVS commit: src/sys/dev/i2c

2022-03-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Mar 30 00:06:51 UTC 2022

Modified Files:
src/sys/dev/i2c: am2315.c dbcool.c hytp14.c scmdi2c.c sgp40.c sht3x.c
sht4x.c si70xx.c spdmem_i2c.c

Log Message:
These modules need to depend on iic, not just on i2cexec.  (They will
still recursively get i2cexec since the iic depends on it.)

Partial fix for kern/56772


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/am2315.c
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/i2c/dbcool.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/i2c/hytp14.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/scmdi2c.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/sgp40.c src/sys/dev/i2c/sht4x.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/sht3x.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/si70xx.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/i2c/spdmem_i2c.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/mk

2022-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 29 22:48:04 UTC 2022

Modified Files:
src/share/mk: bsd.inc.mk bsd.kinc.mk bsd.kmodule.mk bsd.lib.mk
bsd.links.mk bsd.obj.mk bsd.own.mk

Log Message:
get rid of old style `` command substitution in shell and use $() instead.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/share/mk/bsd.inc.mk
cvs rdiff -u -r1.37 -r1.38 src/share/mk/bsd.kinc.mk
cvs rdiff -u -r1.76 -r1.77 src/share/mk/bsd.kmodule.mk
cvs rdiff -u -r1.388 -r1.389 src/share/mk/bsd.lib.mk
cvs rdiff -u -r1.34 -r1.35 src/share/mk/bsd.links.mk
cvs rdiff -u -r1.52 -r1.53 src/share/mk/bsd.obj.mk
cvs rdiff -u -r1.1275 -r1.1276 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.inc.mk
diff -u src/share/mk/bsd.inc.mk:1.33 src/share/mk/bsd.inc.mk:1.34
--- src/share/mk/bsd.inc.mk:1.33	Wed Dec 26 17:57:22 2018
+++ src/share/mk/bsd.inc.mk	Tue Mar 29 18:48:04 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.inc.mk,v 1.33 2018/12/26 22:57:22 christos Exp $
+#	$NetBSD: bsd.inc.mk,v 1.34 2022/03/29 22:48:04 christos Exp $
 
 .include 
 
@@ -45,7 +45,7 @@ inclinkinstall:	.PHONY
 	 while test $$# -ge 2; do \
 		l=$$1; shift; \
 		t=${DESTDIR}$$1; shift; \
-		if  ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
+		if  ttarg=$$(${TOOL_STAT} -qf '%Y' $$t) && \
 		[ "$$l" = "$$ttarg" ]; then \
 			continue ; \
 		fi ; \

Index: src/share/mk/bsd.kinc.mk
diff -u src/share/mk/bsd.kinc.mk:1.37 src/share/mk/bsd.kinc.mk:1.38
--- src/share/mk/bsd.kinc.mk:1.37	Wed Dec 26 17:57:22 2018
+++ src/share/mk/bsd.kinc.mk	Tue Mar 29 18:48:04 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kinc.mk,v 1.37 2018/12/26 22:57:22 christos Exp $
+#	$NetBSD: bsd.kinc.mk,v 1.38 2022/03/29 22:48:04 christos Exp $
 
 # Variables:
 #
@@ -68,7 +68,7 @@ incinstall::
 	 while test $$# -ge 2; do \
 		l=$$1; shift; \
 		t=${DESTDIR}$$1; shift; \
-		if  ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
+		if  ttarg=$$(${TOOL_STAT} -qf '%Y' $$t) && \
 		[ "$$l" = "$$ttarg" ]; then \
 			continue ; \
 		fi ; \

Index: src/share/mk/bsd.kmodule.mk
diff -u src/share/mk/bsd.kmodule.mk:1.76 src/share/mk/bsd.kmodule.mk:1.77
--- src/share/mk/bsd.kmodule.mk:1.76	Mon Mar 29 01:22:49 2021
+++ src/share/mk/bsd.kmodule.mk	Tue Mar 29 18:48:04 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmodule.mk,v 1.76 2021/03/29 05:22:49 simonb Exp $
+#	$NetBSD: bsd.kmodule.mk,v 1.77 2022/03/29 22:48:04 christos Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -149,8 +149,8 @@ ${KMOD}_tmp.o: ${OBJS} ${DPADD}
 	${_MKTARGET_LINK}
 	${LD} -r -o tmp.o ${OBJS}
 	${LD} -r \
-		`${OBJDUMP} --syms --reloc tmp.o | \
-			${TOOL_AWK} -f ${ARCHDIR}/kmodwrap.awk` \
+		$$(${OBJDUMP} --syms --reloc tmp.o | \
+			${TOOL_AWK} -f ${ARCHDIR}/kmodwrap.awk) \
 		 -o ${.TARGET} tmp.o
 
 ${KMOD}_tramp.S: ${KMOD}_tmp.o ${ARCHDIR}/kmodtramp.awk ${ASM_H}
@@ -166,7 +166,7 @@ ${PROG}: ${KMOD}_tmp.o ${KMOD}_tramp.o
 	${LD} -r -Map=${.TARGET}.map \
 	-o tmp.o ${KMOD}_tmp.o ${KMOD}_tramp.o
 	${OBJCOPY} \
-		`${NM} tmp.o | ${TOOL_AWK} -f ${ARCHDIR}/kmodhide.awk` \
+		$$(${NM} tmp.o | ${TOOL_AWK} -f ${ARCHDIR}/kmodhide.awk) \
 		tmp.o ${.TARGET} && \
 	rm tmp.o
 .else

Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.388 src/share/mk/bsd.lib.mk:1.389
--- src/share/mk/bsd.lib.mk:1.388	Sun Nov 28 10:47:33 2021
+++ src/share/mk/bsd.lib.mk	Tue Mar 29 18:48:04 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.388 2021/11/28 15:47:33 christos Exp $
+#	$NetBSD: bsd.lib.mk,v 1.389 2022/03/29 22:48:04 christos Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include 
@@ -534,7 +534,7 @@ _INSTRANLIB=${empty(PRESERVE):?-a "${RAN
 __archivebuild: .USE
 	${_MKTARGET_BUILD}
 	@rm -f ${.TARGET}
-	${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
+	${AR} ${_ARFL} ${.TARGET} $$(NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT})
 .endif
 
 .if !target(__archiveinstall)
@@ -552,7 +552,7 @@ __archivesymlinkpic: .USE
 __buildstdlib: .USE
 	@echo building standard ${.TARGET:T:S/.o//:S/lib//} library
 	@rm -f ${.TARGET}
-	@${LINK.c:S/-nostdinc//} -nostdlib ${LDFLAGS} -Wno-unused-command-line-argument -r -o ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
+	@${LINK.c:S/-nostdinc//} -nostdlib ${LDFLAGS} -Wno-unused-command-line-argument -r -o ${.TARGET} $$(NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT})
 .endif
 
 .if !target(__buildproflib)
@@ -560,7 +560,7 @@ __buildproflib: .USE
 	@echo building profiled ${.TARGET:T:S/.o//:S/lib//} library
 	${_MKTARGET_BUILD}
 	@rm -f ${.TARGET}
-	@${LINK.c:S/-nostdinc//} -nostdlib ${LDFLAGS} -r -o ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*po} | ${TSORT}`
+	@${LINK.c:S/-nostdinc//} -nostdlib ${LDFLAGS} -r -o ${.TARGET} $$(NM=${NM} ${LORDER} ${.ALLSRC:M*po} | ${TSORT})
 .endif
 
 DPSRCS+=	${_YLSRCS}

Index: src/share/mk/bsd.links.mk
diff -u src/share/mk/bsd.links.mk:1.34 src/share/mk/bsd.links.mk:1.35
--- src/

CVS commit: src/share/mk

2022-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 29 22:48:04 UTC 2022

Modified Files:
src/share/mk: bsd.inc.mk bsd.kinc.mk bsd.kmodule.mk bsd.lib.mk
bsd.links.mk bsd.obj.mk bsd.own.mk

Log Message:
get rid of old style `` command substitution in shell and use $() instead.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/share/mk/bsd.inc.mk
cvs rdiff -u -r1.37 -r1.38 src/share/mk/bsd.kinc.mk
cvs rdiff -u -r1.76 -r1.77 src/share/mk/bsd.kmodule.mk
cvs rdiff -u -r1.388 -r1.389 src/share/mk/bsd.lib.mk
cvs rdiff -u -r1.34 -r1.35 src/share/mk/bsd.links.mk
cvs rdiff -u -r1.52 -r1.53 src/share/mk/bsd.obj.mk
cvs rdiff -u -r1.1275 -r1.1276 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/vfs

2022-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 29 22:30:07 UTC 2022

Modified Files:
src/tests/fs/vfs: t_link.c

Log Message:
ignore EOPNOTSUPP errors for fs's that don't support hard links.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/vfs/t_link.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/vfs/t_link.c
diff -u src/tests/fs/vfs/t_link.c:1.1 src/tests/fs/vfs/t_link.c:1.2
--- src/tests/fs/vfs/t_link.c:1.1	Mon Mar 28 16:51:04 2022
+++ src/tests/fs/vfs/t_link.c	Tue Mar 29 18:30:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_link.c,v 1.1 2022/03/28 20:51:04 christos Exp $	*/
+/*	$NetBSD: t_link.c,v 1.2 2022/03/29 22:30:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@ hardlink(const atf_tc_t *tc, const char 
 	if (rump_sys_setuid(u2) == -1)
 		atf_tc_fail_errno("setuid");
 if (rump_sys_link(name, link) == -1) {
-		if (allowed)
+		if (errno != EOPNOTSUPP && allowed)
 			atf_tc_fail_errno("link");
 	} else {
 		if (!allowed)



CVS commit: src/tests/fs/vfs

2022-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 29 22:30:07 UTC 2022

Modified Files:
src/tests/fs/vfs: t_link.c

Log Message:
ignore EOPNOTSUPP errors for fs's that don't support hard links.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/vfs/t_link.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/secmodel/extensions

2022-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 29 22:29:29 UTC 2022

Modified Files:
src/sys/secmodel/extensions: secmodel_extensions.c

Log Message:
isroot should be bool...


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/secmodel/extensions/secmodel_extensions.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/secmodel/extensions/secmodel_extensions.c
diff -u src/sys/secmodel/extensions/secmodel_extensions.c:1.14 src/sys/secmodel/extensions/secmodel_extensions.c:1.15
--- src/sys/secmodel/extensions/secmodel_extensions.c:1.14	Mon Mar 28 15:08:43 2022
+++ src/sys/secmodel/extensions/secmodel_extensions.c	Tue Mar 29 18:29:29 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_extensions.c,v 1.14 2022/03/28 19:08:43 rillig Exp $ */
+/* $NetBSD: secmodel_extensions.c,v 1.15 2022/03/29 22:29:29 christos Exp $ */
 /*-
  * Copyright (c) 2011 Elad Efrat 
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: secmodel_extensions.c,v 1.14 2022/03/28 19:08:43 rillig Exp $");
+__KERNEL_RCSID(0, "$NetBSD: secmodel_extensions.c,v 1.15 2022/03/29 22:29:29 christos Exp $");
 
 #include 
 #include 
@@ -534,7 +534,8 @@ static int
 secmodel_extensions_vnode_cb(kauth_cred_t cred, kauth_action_t action,
 void *cookie, void *arg0, void *arg1, void *arg2, void *arg3)
 {
-	int error, isroot;
+	int error;
+	bool isroot;
 	struct vattr va;
 
 	if ((action & KAUTH_VNODE_ADD_LINK) == 0)



CVS commit: src/sys/secmodel/extensions

2022-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 29 22:29:29 UTC 2022

Modified Files:
src/sys/secmodel/extensions: secmodel_extensions.c

Log Message:
isroot should be bool...


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/secmodel/extensions/secmodel_extensions.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/gpio

2022-03-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar 29 22:10:42 UTC 2022

Modified Files:
src/sys/dev/gpio: gpiopps.c

Log Message:
gpiopps module requires the gpio module to resolve several symbols


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/gpio/gpiopps.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/gpio/gpiopps.c
diff -u src/sys/dev/gpio/gpiopps.c:1.2 src/sys/dev/gpio/gpiopps.c:1.3
--- src/sys/dev/gpio/gpiopps.c:1.2	Fri Jun  1 13:42:14 2018
+++ src/sys/dev/gpio/gpiopps.c	Tue Mar 29 22:10:42 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gpiopps.c,v 1.2 2018/06/01 13:42:14 thorpej Exp $ */
+/* $NetBSD: gpiopps.c,v 1.3 2022/03/29 22:10:42 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2016 Brad Spencer 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gpiopps.c,v 1.2 2018/06/01 13:42:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpiopps.c,v 1.3 2022/03/29 22:10:42 pgoyette Exp $");
 
 /*
  * GPIO interface to the pps subsystem for ntp support.
@@ -492,7 +492,7 @@ gpioppsioctl(dev_t dev, u_long cmd, void
 	return (error);
 }
 
-MODULE(MODULE_CLASS_DRIVER, gpiopps, NULL);
+MODULE(MODULE_CLASS_DRIVER, gpiopps, "gpio");
 
 #ifdef _MODULE
 #include "ioconf.c"



CVS commit: src/sys/dev/gpio

2022-03-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Mar 29 22:10:42 UTC 2022

Modified Files:
src/sys/dev/gpio: gpiopps.c

Log Message:
gpiopps module requires the gpio module to resolve several symbols


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/gpio/gpiopps.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-03-29 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Mar 29 22:09:58 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
zlib-1.2.12 out


To generate a diff of this commit:
cvs rdiff -u -r1.1847 -r1.1848 src/doc/3RDPARTY

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1847 src/doc/3RDPARTY:1.1848
--- src/doc/3RDPARTY:1.1847	Tue Mar 22 17:49:30 2022
+++ src/doc/3RDPARTY	Tue Mar 29 22:09:58 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1847 2022/03/22 17:49:30 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1848 2022/03/29 22:09:58 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1446,7 +1446,7 @@ See /usr/src/external/bsd/wpa/NetBSD-upg
 
 Package:	zlib
 Version:	1.2.10
-Current Vers:	1.2.11
+Current Vers:	1.2.12
 Maintainer:	Jean-loup Gailly and Mark Adler 
 Archive Site:	http://www.zlib.net/
 Home Page:	http://www.zlib.net/



CVS commit: src/doc

2022-03-29 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Mar 29 22:09:58 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
zlib-1.2.12 out


To generate a diff of this commit:
cvs rdiff -u -r1.1847 -r1.1848 src/doc/3RDPARTY

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: null-terminated vs. nul-terminated

2022-03-29 Thread Robert Elz
And yes I know nl isnot really ascii, but lf and cr are also
typically used in lower case.

This whole discussion is childish.  It doesn't matter.

kre


Re: null-terminated vs. nul-terminated

2022-03-29 Thread Robert Elz
Date:Tue, 29 Mar 2022 07:40:04 -0400
From:Greg Troxel 
Message-ID:  

  | It may have been BSD style, but I think it's wrong to use lowercase for
  | an ASCII codepoint.

But we use soh esc nl del (etc) in lower case all the time.

You might also want to look at share/misc/ascii

kre


Re: null-terminated vs. nul-terminated

2022-03-29 Thread Greg Troxel

"David H. Gutteridge"  writes:

Thanks for the history and it is  all sensible.

> "nul-terminated" and "null-terminated" seemed more common in man pages
> that originated from historical BSD sources, so, lacking any style
> guide, I inferred the lowercase "nul" was more "correct" as "BSD style"
> (excepting modern OpenBSD), even though that looks a bit odd to me. I
> then examined where "nul-terminated" came from, and found these bulk
> commits, which imply a standard.

> date: 2005-01-02 18:38:04 +;  author: wiz;
> Mark up NULL, and replace null by nul where appropriate.
>
> date: 2006-10-16 08:48:45 +;  author: wiz;
> nul/null/NULL cleanup:
> when talking about characters/bytes, use "nul" and "nul-terminate"
> when talking about pointers, use "null pointer" or ".Dv NULL"
>
> So that seemed to me the established style.

It may have been BSD style, but I think it's wrong to use lowercase for
an ASCII codepoint.  And therefore it is confusing to people who know
that the ASCII zero byte is written NUL.




signature.asc
Description: PGP signature


CVS commit: src/sys/arch/sandpoint/conf

2022-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 29 09:37:39 UTC 2022

Modified Files:
src/sys/arch/sandpoint/conf: INSTALL_KURO

Log Message:
More space for the memory disk image is needed here too (follow the
last change in INSTALL)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/conf/INSTALL_KURO

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sandpoint/conf/INSTALL_KURO
diff -u src/sys/arch/sandpoint/conf/INSTALL_KURO:1.3 src/sys/arch/sandpoint/conf/INSTALL_KURO:1.4
--- src/sys/arch/sandpoint/conf/INSTALL_KURO:1.3	Sun Aug 10 17:58:51 2014
+++ src/sys/arch/sandpoint/conf/INSTALL_KURO	Tue Mar 29 09:37:39 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL_KURO,v 1.3 2014/08/10 17:58:51 joerg Exp $
+#	$NetBSD: INSTALL_KURO,v 1.4 2022/03/29 09:37:39 martin Exp $
 #
 # GENERIC install kernel for KuroBox / LinkStation
 #
@@ -7,7 +7,7 @@ include "arch/sandpoint/conf/KUROBOX"
 
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT		# Force root on RAM disk
-options 	MEMORY_DISK_ROOT_SIZE=4600	# 2300KB
+options 	MEMORY_DISK_ROOT_SIZE=4800	# 2400KB
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 pseudo-device	md		



CVS commit: src/sys/arch/sandpoint/conf

2022-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 29 09:37:39 UTC 2022

Modified Files:
src/sys/arch/sandpoint/conf: INSTALL_KURO

Log Message:
More space for the memory disk image is needed here too (follow the
last change in INSTALL)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/conf/INSTALL_KURO

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev

2022-03-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 29 09:19:56 UTC 2022

Modified Files:
src/sys/dev: sequencer.c

Log Message:
sequencer(4): Don't use mutex_spin_exit on an IPL_NONE lock.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/sequencer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sequencer.c
diff -u src/sys/dev/sequencer.c:1.74 src/sys/dev/sequencer.c:1.75
--- src/sys/dev/sequencer.c:1.74	Sun Sep 26 01:16:08 2021
+++ src/sys/dev/sequencer.c	Tue Mar 29 09:19:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sequencer.c,v 1.74 2021/09/26 01:16:08 thorpej Exp $	*/
+/*	$NetBSD: sequencer.c,v 1.75 2022/03/29 09:19:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.74 2021/09/26 01:16:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.75 2022/03/29 09:19:56 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "sequencer.h"
@@ -414,7 +414,7 @@ seq_timeout(void *addr)
 
 	mutex_enter(&sc->lock);
 	if (sc->timeout == 0) {
-		mutex_spin_exit(&sc->lock);
+		mutex_exit(&sc->lock);
 		return;
 	}
 	sc->timeout = 0;



CVS commit: src/sys/dev

2022-03-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 29 09:19:56 UTC 2022

Modified Files:
src/sys/dev: sequencer.c

Log Message:
sequencer(4): Don't use mutex_spin_exit on an IPL_NONE lock.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/sequencer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-03-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 29 09:16:24 UTC 2022

Modified Files:
src/sys/dev/pci: cs4281.c

Log Message:
cs4281(4): Fix lock ordering in suspend.

No idea if this code works -- obviously this path has never been
tested in the >decade it's been here!


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/cs4281.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/cs4281.c
diff -u src/sys/dev/pci/cs4281.c:1.57 src/sys/dev/pci/cs4281.c:1.58
--- src/sys/dev/pci/cs4281.c:1.57	Wed Feb  3 14:44:32 2021
+++ src/sys/dev/pci/cs4281.c	Tue Mar 29 09:16:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4281.c,v 1.57 2021/02/03 14:44:32 isaki Exp $	*/
+/*	$NetBSD: cs4281.c,v 1.58 2022/03/29 09:16:24 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000 Tatoku Ogaito.  All rights reserved.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.57 2021/02/03 14:44:32 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.58 2022/03/29 09:16:24 riastradh Exp $");
 
 #include 
 #include 
@@ -613,7 +613,7 @@ cs4281_suspend(device_t dv, const pmf_qu
 	struct cs428x_softc *sc = device_private(dv);
 
 	mutex_enter(&sc->sc_lock);
-	mutex_spin_exit(&sc->sc_intr_lock);
+	mutex_spin_enter(&sc->sc_intr_lock);
 
 	/* save current playback status */
 	if (sc->sc_prun) {



CVS commit: src/sys/dev/pci

2022-03-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 29 09:16:24 UTC 2022

Modified Files:
src/sys/dev/pci: cs4281.c

Log Message:
cs4281(4): Fix lock ordering in suspend.

No idea if this code works -- obviously this path has never been
tested in the >decade it's been here!


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/cs4281.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/usb

2022-03-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 29 09:08:44 UTC 2022

Modified Files:
src/sys/dev/usb: emdtv.c emdtv_dtv.c emdtv_ir.c

Log Message:
emdtv(4): Fix issues in detach.

- Use config_detach_children, and do it up front, and handle failure
  (not relevant for yanking usb but relevant for drvctl which doesn't
  pass DETACH_FORCE).

- Fix teardown order: stop interrupts so we stop issuing new work,
  and _then_ wait for pending work to drain and destroy the
  workqueue.

- Omit needless empty  mutex_enter(lock); mutex_exit(lock)  dance
  which probably only appeared necessary because of the wrong
  teardown order.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/usb/emdtv.c \
src/sys/dev/usb/emdtv_dtv.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/emdtv_ir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/emdtv.c
diff -u src/sys/dev/usb/emdtv.c:1.16 src/sys/dev/usb/emdtv.c:1.17
--- src/sys/dev/usb/emdtv.c:1.16	Sat Mar 12 18:31:39 2022
+++ src/sys/dev/usb/emdtv.c	Tue Mar 29 09:08:44 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: emdtv.c,v 1.16 2022/03/12 18:31:39 riastradh Exp $ */
+/* $NetBSD: emdtv.c,v 1.17 2022/03/29 09:08:44 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2008, 2011 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emdtv.c,v 1.16 2022/03/12 18:31:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emdtv.c,v 1.17 2022/03/29 09:08:44 riastradh Exp $");
 
 #include 
 #include 
@@ -155,9 +155,14 @@ emdtv_detach(device_t self, int flags)
 {
 	struct emdtv_softc *sc = device_private(self);
 	usbd_status status;
+	int error;
 
 	sc->sc_dying = true;
 
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
+
 	emdtv_ir_detach(sc, flags);
 	emdtv_dtv_detach(sc, flags);
 
Index: src/sys/dev/usb/emdtv_dtv.c
diff -u src/sys/dev/usb/emdtv_dtv.c:1.16 src/sys/dev/usb/emdtv_dtv.c:1.17
--- src/sys/dev/usb/emdtv_dtv.c:1.16	Sat Aug  7 16:19:16 2021
+++ src/sys/dev/usb/emdtv_dtv.c	Tue Mar 29 09:08:44 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: emdtv_dtv.c,v 1.16 2021/08/07 16:19:16 thorpej Exp $ */
+/* $NetBSD: emdtv_dtv.c,v 1.17 2022/03/29 09:08:44 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2008, 2011 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emdtv_dtv.c,v 1.16 2021/08/07 16:19:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emdtv_dtv.c,v 1.17 2022/03/29 09:08:44 riastradh Exp $");
 
 #include 
 #include 
@@ -142,12 +142,8 @@ emdtv_dtv_free_xfers(struct emdtv_softc 
 void
 emdtv_dtv_detach(struct emdtv_softc *sc, int flags)
 {
-	sc->sc_streaming = false;
 
-	if (sc->sc_dtvdev != NULL) {
-		config_detach(sc->sc_dtvdev, flags);
-		sc->sc_dtvdev = NULL;
-	}
+	sc->sc_streaming = false;
 
 	if (sc->sc_xc3028)
 		xc3028_close(sc->sc_xc3028);

Index: src/sys/dev/usb/emdtv_ir.c
diff -u src/sys/dev/usb/emdtv_ir.c:1.4 src/sys/dev/usb/emdtv_ir.c:1.5
--- src/sys/dev/usb/emdtv_ir.c:1.4	Sat Aug  7 16:19:16 2021
+++ src/sys/dev/usb/emdtv_ir.c	Tue Mar 29 09:08:44 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: emdtv_ir.c,v 1.4 2021/08/07 16:19:16 thorpej Exp $ */
+/* $NetBSD: emdtv_ir.c,v 1.5 2022/03/29 09:08:44 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2008 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emdtv_ir.c,v 1.4 2021/08/07 16:19:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emdtv_ir.c,v 1.5 2022/03/29 09:08:44 riastradh Exp $");
 
 #include 
 #include 
@@ -108,8 +108,6 @@ emdtv_ir_attach(struct emdtv_softc *sc)
 void
 emdtv_ir_detach(struct emdtv_softc *sc, int flags)
 {
-	if (sc->sc_ir_wq != NULL)
-		workqueue_destroy(sc->sc_ir_wq);
 
 	if (sc->sc_intr_pipe != NULL) {
 		usbd_abort_pipe(sc->sc_intr_pipe);
@@ -117,12 +115,10 @@ emdtv_ir_detach(struct emdtv_softc *sc, 
 		sc->sc_intr_pipe = NULL;
 	}
 
-	mutex_enter(&sc->sc_ir_mutex);
-	mutex_exit(&sc->sc_ir_mutex);
-	mutex_destroy(&sc->sc_ir_mutex);
+	if (sc->sc_ir_wq != NULL)
+		workqueue_destroy(sc->sc_ir_wq);
 
-	if (sc->sc_cirdev != NULL)
-		config_detach(sc->sc_cirdev, flags);
+	mutex_destroy(&sc->sc_ir_mutex);
 }
 
 static void



CVS commit: src/sys/dev/usb

2022-03-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 29 09:08:44 UTC 2022

Modified Files:
src/sys/dev/usb: emdtv.c emdtv_dtv.c emdtv_ir.c

Log Message:
emdtv(4): Fix issues in detach.

- Use config_detach_children, and do it up front, and handle failure
  (not relevant for yanking usb but relevant for drvctl which doesn't
  pass DETACH_FORCE).

- Fix teardown order: stop interrupts so we stop issuing new work,
  and _then_ wait for pending work to drain and destroy the
  workqueue.

- Omit needless empty  mutex_enter(lock); mutex_exit(lock)  dance
  which probably only appeared necessary because of the wrong
  teardown order.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/usb/emdtv.c \
src/sys/dev/usb/emdtv_dtv.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/emdtv_ir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.