> > Do you call scsi_done holding the io_request lock ?
>
> I don't think so. At least, I never explicitly request this lock. Is
> someone else requesting it for me?
Your queue command function is called with it held, any threads you create
and your irq handler (if there is one) need to take that lock if they wish
to complete an I/O. Otherwise you may trash the I/O request queue at which point
'shit happens'
> documentation on exactly how to use spin locks, or what the parameters
> mean. Could you shed some light on the subject? Also, this looks like it
> just protects the data structure without giving me a way to block a thread
> on queue input. Is that the case, or am I reading it wrong?
Always lock data not code (at least as a way of thinking about it). The example
I gave doesnt do any blocking.
spin_lock_irqsave(lock, flags)
disables local interrupts then loops until it takes the lock
spin_unlock_irqrestore(lock, flags)
flushes any pending compiler temporaries to memory, releases the lock and
restores the old interrupt state on that CPU. The irq blocking is needed
if the lock can also be taken by an interrupt so that we dont take an
interrupt on the same CPU while holding the lock - which would deadlock
See Documentation/spinlocks.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]