Module Name: src
Committed By: riastradh
Date: Thu Mar 3 05:50:31 UTC 2022
Modified Files:
src/sys/dev/usb: usbnet.c
Log Message:
usbnet: Print diagnostic about refcnt stragglers.
I don't think there can be any, but this message, if printed, would
falsify my hypothesis!
To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/usb/usbnet.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/usbnet.c
diff -u src/sys/dev/usb/usbnet.c:1.71 src/sys/dev/usb/usbnet.c:1.72
--- src/sys/dev/usb/usbnet.c:1.71 Thu Mar 3 05:50:22 2022
+++ src/sys/dev/usb/usbnet.c Thu Mar 3 05:50:31 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: usbnet.c,v 1.71 2022/03/03 05:50:22 riastradh Exp $ */
+/* $NetBSD: usbnet.c,v 1.72 2022/03/03 05:50:31 riastradh Exp $ */
/*
* Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.71 2022/03/03 05:50:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.72 2022/03/03 05:50:31 riastradh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -1671,6 +1671,10 @@ usbnet_detach(device_t self, int flags)
mutex_enter(&unp->unp_core_lock);
unp->unp_refcnt--;
+ if (unp->unp_refcnt >= 0) {
+ aprint_error_dev(un->un_dev, "%d stragglers\n",
+ unp->unp_refcnt + 1);
+ }
while (unp->unp_refcnt >= 0) {
/* Wait for processes to go away */
cv_wait(&unp->unp_detachcv, &unp->unp_core_lock);