Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/nick-nhusb]: src/sys/dev/usb Remove a tsleep
details: https://anonhg.NetBSD.org/src/rev/0ff8446e4fb8
branches: nick-nhusb
changeset: 334273:0ff8446e4fb8
user: skrll <skrll%NetBSD.org@localhost>
date: Sat Oct 17 10:24:58 2015 +0000
description:
Remove a tsleep
diffstat:
sys/dev/usb/TODO.usbmp | 3 +--
sys/dev/usb/if_athn_usb.c | 10 +++++++---
sys/dev/usb/if_athn_usb.h | 3 ++-
3 files changed, 10 insertions(+), 6 deletions(-)
diffs (80 lines):
diff -r 5b21ccd3da2c -r 0ff8446e4fb8 sys/dev/usb/TODO.usbmp
--- a/sys/dev/usb/TODO.usbmp Fri Oct 16 17:05:19 2015 +0000
+++ b/sys/dev/usb/TODO.usbmp Sat Oct 17 10:24:58 2015 +0000
@@ -1,4 +1,4 @@
-$NetBSD: TODO.usbmp,v 1.8.4.2 2015/04/06 15:18:13 skrll Exp $
+$NetBSD: TODO.usbmp,v 1.8.4.3 2015/10/17 10:24:58 skrll Exp $
the majority of the USB MP device interface is documented in usbdivar.h.
@@ -90,7 +90,6 @@
- udsir.c
wakeup/tsleep drivers:
- - if_athn_usb.c
- if_otus.c
- if_run.c
- if_upgt.c
diff -r 5b21ccd3da2c -r 0ff8446e4fb8 sys/dev/usb/if_athn_usb.c
--- a/sys/dev/usb/if_athn_usb.c Fri Oct 16 17:05:19 2015 +0000
+++ b/sys/dev/usb/if_athn_usb.c Sat Oct 17 10:24:58 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_athn_usb.c,v 1.6.8.6 2015/10/06 21:32:15 skrll Exp $ */
+/* $NetBSD: if_athn_usb.c,v 1.6.8.7 2015/10/17 10:24:59 skrll Exp $ */
/* $OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $ */
/*-
@@ -22,7 +22,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.6 2015/10/06 21:32:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.7 2015/10/17 10:24:59 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -267,6 +267,7 @@
sc->sc_ops.write = athn_usb_write;
sc->sc_ops.write_barrier = athn_usb_write_barrier;
+ cv_init(&usc->usc_task_cv, "athntsk");
mutex_init(&usc->usc_task_mtx, MUTEX_DEFAULT, IPL_NET);
mutex_init(&usc->usc_tx_mtx, MUTEX_DEFAULT, IPL_NONE);
@@ -466,6 +467,7 @@
mutex_destroy(&usc->usc_tx_mtx);
mutex_destroy(&usc->usc_task_mtx);
+ cv_destroy(&usc->usc_task_cv);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, usc->usc_udev, sc->sc_dev);
return 0;
@@ -781,8 +783,10 @@
DPRINTFN(DBG_FN, usc, "\n");
/* Wait for all queued asynchronous commands to complete. */
+ mutex_spin_enter(&usc->usc_task_mtx);
while (usc->usc_cmdq.queued > 0)
- tsleep(&usc->usc_cmdq, 0, "cmdq", 0);
+ cv_wait(&usc->usc_task_cv, &usc->usc_task_mtx);
+ mutex_spin_exit(&usc->usc_task_mtx);
}
Static int
diff -r 5b21ccd3da2c -r 0ff8446e4fb8 sys/dev/usb/if_athn_usb.h
--- a/sys/dev/usb/if_athn_usb.h Fri Oct 16 17:05:19 2015 +0000
+++ b/sys/dev/usb/if_athn_usb.h Sat Oct 17 10:24:58 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_athn_usb.h,v 1.2.16.2 2015/03/19 17:26:42 skrll Exp $ */
+/* $NetBSD: if_athn_usb.h,v 1.2.16.3 2015/10/17 10:24:59 skrll Exp $ */
/* $OpenBSD: if_athn_usb.h,v 1.3 2012/11/10 14:35:06 mikeb Exp $ */
/*-
@@ -443,6 +443,7 @@
int usc_athn_attached;
+ kcondvar_t usc_task_cv;
kmutex_t usc_task_mtx;
kmutex_t usc_tx_mtx;
Home |
Main Index |
Thread Index |
Old Index