Module Name: src Committed By: skrll Date: Fri Jun 26 15:39:56 UTC 2015
Modified Files: src/sys/dev/usb [nick-nhusb]: xhci.c Log Message: Revert previous (for now) To generate a diff of this commit: cvs rdiff -u -r1.28.2.30 -r1.28.2.31 src/sys/dev/usb/xhci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/xhci.c diff -u src/sys/dev/usb/xhci.c:1.28.2.30 src/sys/dev/usb/xhci.c:1.28.2.31 --- src/sys/dev/usb/xhci.c:1.28.2.30 Thu Jun 25 06:30:13 2015 +++ src/sys/dev/usb/xhci.c Fri Jun 26 15:39:55 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.28.2.30 2015/06/25 06:30:13 skrll Exp $ */ +/* $NetBSD: xhci.c,v 1.28.2.31 2015/06/26 15:39:55 skrll Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.28.2.30 2015/06/25 06:30:13 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.28.2.31 2015/06/26 15:39:55 skrll Exp $"); #include "opt_usb.h" @@ -1419,8 +1419,7 @@ xhci_stop_endpoint(struct usbd_pipe *pip * Set TR Dequeue Pointer. * xCHI 1.1 4.6.10 6.4.3.9 * Purge all of the transfer requests on ring. - * EPSTATE of endpoint must be ERROR or STOPPED, otherwise CONTEXT_STATE - * error will be generated. + * EPSTATE of endpoint must be ERROR or STOPPED, or CONTEXT_STATE error. */ static usbd_status xhci_set_dequeue(struct usbd_pipe *pipe) @@ -1760,10 +1759,7 @@ xhci_handle_event(struct xhci_softc * co } else { xx = (void *)(uintptr_t)(trb_0 & ~0x3); } - /* - * stop_endpoint may cause ERR_STOPPED_LENGTH_INVALID, - * in which case this condition may happen. - */ + /* XXX this may not happen */ if (xx == NULL) { DPRINTFN(1, "xfer done: xx is NULL", 0, 0, 0, 0); break; @@ -2159,7 +2155,6 @@ xhci_new_device(device_t parent, struct KASSERT(bus->ub_devices[dev->ud_addr] == NULL); bus->ub_devices[dev->ud_addr] = dev; - /* read 64 bytes of device descriptor */ err = usbd_get_initial_ddesc(dev, dd); if (err) goto bad; @@ -2361,10 +2356,6 @@ xhci_ring_put(struct xhci_softc * const * (called from interrupt from xHCI), or timed-out. * Command validation is performed in xhci_handle_event by checking if * trb_0 in CMD_COMPLETE TRB and sc->sc_command_addr are identical. - * locked = 0: called without lock held - * locked = 1: allows called with lock held - * 'locked' is needed as some methods are called with sc_lock_held. - * (see usbdivar.h) */ static usbd_status xhci_do_command1(struct xhci_softc * const sc, struct xhci_trb * const trb, @@ -2382,7 +2373,7 @@ xhci_do_command1(struct xhci_softc * con if (!locked) mutex_enter(&sc->sc_lock); - /* XXX KASSERT may fail when cv_timedwait unlocks sc_lock */ + /* XXX KASSERT may fire when cv_timedwait unlocks sc_lock */ KASSERT(sc->sc_command_addr == 0); sc->sc_command_addr = xhci_ring_trbp(cr, cr->xr_ep);