Understanding USB callback + assertion panic

From: Farhan Khan <farhan_at_farhan.codes>
Date: Tue, 08 Mar 2022 23:59:11 UTC
Hi all,

I am trying to understand how FreeBSD's USB subsystem works and appear to be running into a kernel panic due to a failed assertion that I do not understand. the assertion in question is /usr/src/sys/dev/usb/usb_transfer.c:1954.

My understanding is that you first configure usbd_transfer_setup(9). To start a bulk transfer, you populate the appropriate list (typically an STAIL_* list), then initiate a transfer by calling usbd_transfer_start(9) with the correct transfer. In my case, my callback is a simple printf().

Upon the usbd_transfer_start(9) call, I am hitting the assertion error. I have looked at other device drivers and have not identified what they are doing differently.

Any suggestions?