[2722] in linux-scsi channel archive
Q: Interrupts for low level SCSI drivers
daemon@ATHENA.MIT.EDU (Frans Orsel)
Fri Oct 31 08:14:24 1997
To: linux-scsi@vger.rutgers.edu
Date: Wed, 29 Oct 1997 16:28:29 +0100
From: Frans Orsel <orsel@cs.utwente.nl>
I'm currently writing a low level SCSI driver for the Adaptec 33C96 chip, but
I ran into trouble with interrupts.
At first, I want to make a simple driver that can not queue, therefore I have
set the canqueue variable of my host template to 0. This results in the
mid-level driver calling my command function. I have written this function
as in the scsi paper from Richard Faith (outdated, but only source). I.e.
checking for a simple flag in a while loop letting the command function wait
for an interrupt to occur. The flag is set in my interrupt routine. So far so
good.
Now I noticed that when the mid level driver initializes the SCSI bus
everything works fine, the interrupt routine is called and sets the flag and
my command function exits. But when I also use the scsi disk driver (sd) my
command function never exits because interrupts are disabled.
My solution to this was to turn on interrupts during the while loop. But now
I'm getting oopses in my interrupt routine all the time.
I thought interrupts should be enabled when entering the low level command
function and disabled when entering the queue function. But it seems that they
are always disabled when the sd driver does a scsi request. Is this a bug or
does no one use a non queueing driver anymore?
Can anyone help me with this? Thanks in advance.
Frans Orsel