More power patches

Don Lewis truckman at FreeBSD.org
Sun Jan 11 19:15:29 PST 2004


On 11 Jan, M. Warner Losh wrote:
> In message: <200401120002.i0C02F7E031685 at gw.catspoiler.org>
>             Don Lewis <truckman at FreeBSD.org> writes:

> : There is still the issue of the irq breakage caused by the attach
> : failure.
> 
> I don't understand that one at all..  Unless it is a failure message
> is a cut-n-pasto or something weird is happening.

There is something wierd happening.  The problem appears to be in
ithread_remove_handler() or ithread_loop().  ithread_remove_handler() is
executing the
	if (!TD_AWAITING_INTR(ithread->it_td)) {
condition and setting the IH_DEAD flag.  If this flag is set,
ithread_remove_handler() should msleep() to wait for the thread to do
the removal.  The problem is that ithread_remove_handler() doesn't
appear to sleep for any significant amount of time, and ithread_loop()
never seems to execute the the block of code that detects IH_DEAD and
executes TAILQ_REMOVE().  When ithread_remove_handler() calls
ithread_update() after the msleep() call, ithread_update() is still
finding the handler on the list, and then ithread_remove_handler()
proceeds to free the handler back to the heap where it is undoubtably
getting stomped on and causing havoc later on.

Is there a problem with calling msleep() this early in the boot
sequence?


More information about the freebsd-mobile mailing list