When must the io_request_lock be held?

Jamie Wellnitz
2002-08-05T23:53:25Z

When does a low-level driver have to hold the io_request_lock? I know
that a driver should take the lock when it calls a SCSI command's done
function. Also, when the driver's queuecommand is entered, it already
holds this lock.

I've seen some drivers that drop the lock (via either spin_unlock or
spin_unlock_irq) inside their queuecommand. What are the rules for
dropping (and reacquiring) the lock here?

Thanks,
Jamie Wellnitz