[3421] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: Race in AHA1542 detection

daemon@ATHENA.MIT.EDU (Eric Youngdale)
Sat Feb 28 13:41:39 1998

Date: 	Sat, 28 Feb 1998 13:28:37 -0500 (EST)
From: Eric Youngdale <eric@andante.jic.com>
To: Keith Owens <kaos@ocs.com.au>
cc: linux-scsi@vger.rutgers.edu
In-Reply-To: <19980223221211.20867.qmail@mail.ocs.com.au>


	I spent some time looking at the 1542 driver to see why the
interrupt in question is coming up in the first place.

	The idea is that during mailbox setup, we are essentially issuing
a command to the board - part of the setup for the thing, really. 
Normally the 1542 will raise an interrupt as part of this procedure, but
we don't need it.  The 1542 driver should have all interrupts blocked for
a short period while this is taking place.  Instead of waiting for an
interrupt, setup_mailboxes() sits in a busy loop waiting for the board to
say that it is ready, and then it clears the interrupt once the command is
done. 

	Allowing the interrupt to be delivered would basically be
harmless, I guess, but if the interrupt is delivered it should be ignored.
That is pretty close to what happens now, except that you get the
"interrupts received but no mail" message.

	I still have grave concerns about why cli() wouldn't block
interrupts on all processors.  It has been on my list of things to do to
go through the scsi code and try and eliminate as many cli()/sti() pairs
as I can replacing them with spinlocks, but I am not prepared to go
through and try and do it all now at once.  Each one needs to be analyzed
to see what sorts of conditions need to be protected against, how long the
lock is needed and what sort of lock would be effective to protect against
it.  My plan was to start with the critical code paths to improve
performance, and go on from there.  If cli() isn't blocking interrupts on
all processors any more, I fear that tons of race conditions are being
opened up all over the place.

-Eric

 "The world was a library, and its books were the stones, leaves,
 brooks, grass, and the birds of the earth.   We learned to do what only
 a student of nature ever learns, and that was to feel beauty."
			Chief Luther Standing Bear - Teton Sioux


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post