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(9): Don't touch unp_stopping in usbnet_pi...



details:   https://anonhg.NetBSD.org/src/rev/d676e776c957
branches:  trunk
changeset: 369498:d676e776c957
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Aug 20 14:06:09 2022 +0000

description:
usbnet(9): Don't touch unp_stopping in usbnet_pipe_intr.

This access was unprotected by a lock, but it's not necessary anyway:
usbnet_stop aborts the pipes, and the xfer doesn't call usbd_transfer
to reschedule itself -- it's an intr pipe, so it's rescheduled
internally by usbdi(9) in a way that usbd_abort_pipe atomically
prevents.

diffstat:

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

diffs (34 lines):

diff -r 32724edd9411 -r d676e776c957 sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c      Sat Aug 20 14:05:58 2022 +0000
+++ b/sys/dev/usb/usbnet.c      Sat Aug 20 14:06:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbnet.c,v 1.100 2022/08/20 14:05:58 riastradh Exp $   */
+/*     $NetBSD: usbnet.c,v 1.101 2022/08/20 14:06:09 riastradh Exp $   */
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.100 2022/08/20 14:05:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.101 2022/08/20 14:06:09 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -460,12 +460,12 @@
        struct usbnet_private * const unp = un->un_pri;
        struct usbnet_intr * const uni __unused = un->un_intr;
 
-       if (usbnet_isdying(un) || unp->unp_stopping ||
+       if (usbnet_isdying(un) ||
            status == USBD_INVAL || status == USBD_NOT_STARTED ||
            status == USBD_CANCELLED) {
-               USBNETHIST_CALLARGS("%jd: uni %#jx d/s %#jx status %#jx",
+               USBNETHIST_CALLARGS("%jd: uni %#jx dying %#jx status %#jx",
                    unp->unp_number, (uintptr_t)uni,
-                   (usbnet_isdying(un) << 8) | unp->unp_stopping, status);
+                   usbnet_isdying(un), status);
                return;
        }
 



Home | Main Index | Thread Index | Old Index