summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-20 10:24:10 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-20 10:24:10 +0000
commit37c4b29494c12106e716782583e65a21a5b02a6d (patch)
tree1913983bfc762737e0ab2c797f79875a0ac7a1c2 /sys/dev
parent095a86a2f2eee5d33b89f0ba87459aff49cfb069 (diff)
Force a status check of all the ports of a newly attached hub. In the
interrupt routine properly initialize a variable. Finally stop talking about the "bus event handler thread". Our USB stack has only one thread doing discovery for all buses. Prompted by a report from Patrick Wildt.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uhub.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index 06d34cbceb5..46dc395f5f4 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhub.c,v 1.78 2014/11/11 20:57:27 mpi Exp $ */
+/* $OpenBSD: uhub.c,v 1.79 2014/11/20 10:24:09 mpi Exp $ */
/* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
@@ -324,6 +324,8 @@ uhub_attach(struct device *parent, struct device *self, void *aux)
printf("%s: port %d power on failed, %s\n",
sc->sc_dev.dv_xname, port,
usbd_errstr(err));
+ /* Make sure we check the port status at least once. */
+ sc->sc_status |= (1 << port);
}
/* Wait for stable power. */
@@ -573,16 +575,15 @@ uhub_detach(struct device *self, int flags)
}
/*
- * Hub interrupt.
- * This an indication that some port has changed status.
- * Notify the bus event handler thread that we need
- * to be explored again.
+ * This is an indication that some port has changed status. Remember
+ * the ports that need attention and notify the USB task thread that
+ * we need to be explored again.
*/
void
uhub_intr(struct usbd_xfer *xfer, void *addr, usbd_status status)
{
struct uhub_softc *sc = addr;
- uint32_t stats;
+ uint32_t stats = 0;
int i;
if (usbd_is_dying(sc->sc_hub))