Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jun 2009 14:00:42 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Subject:   Re: Potential problem with USB_THREAD_SUSPEND()?
Message-ID:  <200906291400.42941.hselasky@c2i.net>
In-Reply-To: <4A48A5AD.9040508@embedded-brains.de>
References:  <4A48A5AD.9040508@embedded-brains.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906291400.42941.hselasky>