[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More power patches



On 11 Jan, M. Warner Losh wrote:
> In message: <200401120002_(_dot_)_i0C02F7E031685_(_at_)_gw_(_dot_)_catspoiler_(_dot_)_org>
>             Don Lewis <truckman_(_at_)_FreeBSD_(_dot_)_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?