Potential problem with USB_THREAD_SUSPEND()?

Hans Petter Selasky hselasky at c2i.net
Mon Jun 29 12:01:15 UTC 2009


On Monday 29 June 2009 13:29:49 Sebastian Huber wrote:
> Hi,
>
> USB_THREAD_SUSPEND(p) is defined as {kproc|kthread}_suspend(p, 0).  This
> means that it will wait until the corresponding thread recognizes its
> suspend request and suspends itself.  It seems that
> {kproc|kthread}_suspend_check() will be used nowhere in the USB system. 
> Thus the USB_THREAD_SUSPEND() will block forever in most cases? It is only
> used in usb_proc_drain() during cold boot.
>
> Have a nice day!

Thanks for your input. This execution path has been tested, but not with the 
latest 8-current, and is a dirty hack around the problem which appears if an 
USB controller fails to attach during boot, that we cannot kill created 
threads?

If you want you can insert an error into the attach routine in 
/sys/dev/usb/controller/uhci.c for example, to verify that the code works.

--HPS



More information about the freebsd-usb mailing list