Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 2004 19:15:14 -0800 (PST)
From:      Don Lewis <truckman@FreeBSD.org>
To:        imp@bsdimp.com
Cc:        mobile@FreeBSD.org
Subject:   Re: More power patches
Message-ID:  <200401120315.i0C3FE7E032034@gw.catspoiler.org>
In-Reply-To: <20040111.172627.84647422.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11 Jan, M. Warner Losh wrote:
> In message: <200401120002.i0C02F7E031685@gw.catspoiler.org>
>             Don Lewis <truckman@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?



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