Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb usbnet: Print diagnostic about refcnt stragglers.



details:   https://anonhg.NetBSD.org/src/rev/38cdf23f5f04
branches:  trunk
changeset: 362512:38cdf23f5f04
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Mar 03 05:50:31 2022 +0000

description:
usbnet: Print diagnostic about refcnt stragglers.

I don't think there can be any, but this message, if printed, would
falsify my hypothesis!

diffstat:

 sys/dev/usb/usbnet.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 37fa1e67e0a9 -r 38cdf23f5f04 sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c      Thu Mar 03 05:50:22 2022 +0000
+++ b/sys/dev/usb/usbnet.c      Thu Mar 03 05:50:31 2022 +0000
@@ -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 @@
 
        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);



Home | Main Index | Thread Index | Old Index