summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2019-11-25 11:32:18 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2019-11-25 11:32:18 +0000
commitb21e6127c4a0b89dda430814e381515b26a84dbc (patch)
tree351aba858e2c2a28f07b5f29f94ef787d6f69b73 /sys
parent6e52b1bf41b752e63982cf0ec1d0253463f5649f (diff)
Convert to tsleep_nsec(9) and use the correct timeout period in msec.
Tested by kevlo@, ok stsp@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_athn_usb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c
index 0c0d06b6d86..7cd0644df36 100644
--- a/sys/dev/usb/if_athn_usb.c
+++ b/sys/dev/usb/if_athn_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_athn_usb.c,v 1.54 2019/11/12 07:47:30 mpi Exp $ */
+/* $OpenBSD: if_athn_usb.c,v 1.55 2019/11/25 11:32:17 mpi Exp $ */
/*-
* Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr>
@@ -853,12 +853,13 @@ athn_usb_wmi_xcmd(struct athn_usb_softc *usc, uint16_t cmd_id, void *ibuf,
s = splusb();
while (usc->wait_cmd_id) {
- /*
+ /*
* The previous USB transfer is not done yet. We can't use
* data->xfer until it is done or we'll cause major confusion
* in the USB stack.
*/
- tsleep(&usc->wait_cmd_id, 0, "athnwmx", ATHN_USB_CMD_TIMEOUT);
+ tsleep_nsec(&usc->wait_cmd_id, 0, "athnwmx",
+ MSEC_TO_NSEC(ATHN_USB_CMD_TIMEOUT));
if (usbd_is_dying(usc->sc_udev)) {
splx(s);
return ENXIO;
@@ -894,7 +895,8 @@ athn_usb_wmi_xcmd(struct athn_usb_softc *usc, uint16_t cmd_id, void *ibuf,
* Wait for WMI command complete interrupt. In case it does not fire
* wait until the USB transfer times out to avoid racing the transfer.
*/
- error = tsleep(&usc->wait_cmd_id, 0, "athnwmi", ATHN_USB_CMD_TIMEOUT);
+ error = tsleep_nsec(&usc->wait_cmd_id, 0, "athnwmi",
+ MSEC_TO_NSEC(ATHN_USB_CMD_TIMEOUT));
if (error) {
if (error == EWOULDBLOCK) {
printf("%s: firmware command 0x%x timed out\n",