What's the right way to wait for an USB transfer to complete ?

Sebastien B sebastien.b at swissinfo.org
Sat Mar 26 15:18:55 PST 2005


Hello,

> > Locking the mutex in the software interrupt handler causes a kernel panic
> > in propagate_priority (it seems to occur only when the mutex is already
> > held by another thread, therefore mtx_lock() blocks) :
> >
> > Fatal trap 12: page fault while in kernel mode
> > fault virtual address     = 0x24
>
> Likely you are using a NULL pointer as mutex.

No, it is not NULL, the instruction I believe to have caused the fault is 
"mtx_lock(&sc->brg_rx.comp_mp)".
"&sc->brg_rx.comp_mp" can't be NULL, AFAIK.
You can have a look at my code, it's at 
http://yoshiyo.ath.cx/seb/download/prism54u-bsd-20050326.tar.bz2
See the "bottom halves" section of usb_transport.c

> If you want your driver GIANT free that's fine, but don't forget
> that calling USB layer requires you to acquire GIANT first.

You mean I must hold Giant every time I call any USB function ? I've never 
seen any driver doing this...

Regards,
Sebastien



More information about the freebsd-usb mailing list