> Hi all, > > I am trying to submit a usbd_transfer_start, but hitting the assertion > error here: > http://bxr.su/FreeBSD/sys/dev/usb/usb_transfer.c#1954, which is this > line: > USB_XFER_LOCK_ASSERT(xfer, MA_OWNED); > > I noticed that when I lock the device with mtx_lock(sc->sc_mtx) I do > not hit that assertion condition but I do without it. However, looking > at other device drivers, they do not need an explicit > DEVICE_LOCK/UNLOCK around each transfer. > > What is the common pattern that would prevent this? I am probably > missing something, but am unclear on what. > Thank you,
I figured it out...I completely misunderstood how a mutex worked in relation to a USB transfer. In short, the usdb_transfer_start requires the mutex to be locked that was created during the usbd_transfer_setup. Hope that helps someone in the future.