diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2011-02-09 04:25:33 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2011-02-09 04:25:33 +0000 |
commit | 61bf9baa06417cfa6d2a64e390751f2dc4da6533 (patch) | |
tree | a8c1c6f1f5073b8299df2e96d8909a99ef6a00d9 /sys/dev/usb/if_run.c | |
parent | 2c19b177a7765189fd2a5a2096dda74c0a308168 (diff) |
revert usb.c to r1.72, and all subsequent changes that depend on it.
this is causing problems with suspend/resume for some people.
Diffstat (limited to 'sys/dev/usb/if_run.c')
-rw-r--r-- | sys/dev/usb/if_run.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 9622756109a..07e071d86e4 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.86 2011/02/05 18:10:44 jakemsr Exp $ */ +/* $OpenBSD: if_run.c,v 1.87 2011/02/09 04:25:32 jakemsr Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -600,8 +600,22 @@ run_detach(struct device *self, int flags) timeout_del(&sc->calib_to); /* wait for all queued asynchronous commands to complete */ +#if 0 + while (sc->cmdq.queued > 0) + tsleep(&sc->cmdq, 0, "cmdq", 0); +#endif + /* the async commands are run in a task */ usb_rem_wait_task(sc->sc_udev, &sc->sc_task); + /* but the task might not have run if it did not start before + * usbd_deactivate() was called, so wakeup now. we're + * detaching, no need to try to run more commands. + */ + if (sc->cmdq.queued > 0) { + sc->cmdq.queued = 0; + wakeup(&sc->cmdq); + } + usbd_ref_wait(sc->sc_udev); if (ifp->if_softc != NULL) { @@ -1471,6 +1485,7 @@ run_task(void *arg) ring->queued--; ring->next = (ring->next + 1) % RUN_HOST_CMD_RING_COUNT; } + wakeup(ring); splx(s); } @@ -3519,7 +3534,8 @@ run_stop(struct ifnet *ifp, int disable) s = splusb(); ieee80211_new_state(ic, IEEE80211_S_INIT, -1); /* wait for all queued asynchronous commands to complete */ - usb_wait_task(sc->sc_udev, &sc->sc_task); + while (sc->cmdq.queued > 0) + tsleep(&sc->cmdq, 0, "cmdq", 0); splx(s); /* disable Tx/Rx */ |