Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb usb(4): Cancel and wait for async task on closin...



details:   https://anonhg.NetBSD.org/src/rev/51c52e3c45af
branches:  trunk
changeset: 983862:51c52e3c45af
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Jun 12 13:57:40 2021 +0000

description:
usb(4): Cancel and wait for async task on closing pipe.

XXX usbd_kill_pipe and usbd_close_pipe should not be copypasta; there
should be only one instance of this logic.

diffstat:

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

diffs (27 lines):

diff -r dfbf94bf585f -r 51c52e3c45af sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Sat Jun 12 12:15:54 2021 +0000
+++ b/sys/dev/usb/usbdi.c       Sat Jun 12 13:57:40 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.204 2020/08/19 02:19:07 msaitoh Exp $      */
+/*     $NetBSD: usbdi.c,v 1.205 2021/06/12 13:57:40 riastradh Exp $    */
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.204 2020/08/19 02:19:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.205 2021/06/12 13:57:40 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -327,6 +327,8 @@
        }
 
        usbd_unlock_pipe(pipe);
+       usb_rem_task_wait(pipe->up_dev, &pipe->up_async_task, USB_TASKQ_DRIVER,
+           NULL);
        kmem_free(pipe, pipe->up_dev->ud_bus->ub_pipesize);
 
        return USBD_NORMAL_COMPLETION;



Home | Main Index | Thread Index | Old Index