SCSI synchronization and error handling
I'm doing some more work on my scsi LLD, libata, and have a few questions for the experts in the crowd.
In ATA, some commands need to be sent when no other commands are queued to hardware. Let's say I have a command stream that looks like
queued write
queued read
queued read
queued write
non-queued SMART command
queued write
queued write
What's the best way to ensure that the SMART command is only executed after preceding, queued commands are completed? My guess is to return MLQUEUE_BUSY if (a) ->queuecommand is passed a non-queued command AND (b) there are commands queued to hardware already.
Quoted 4 lines · Jeff Garzik
What's the best way to ensure that the SMART command is only executed after preceding, queued commands are completed? My guess is to return
MLQUEUE_BUSYif (a) ->queuecommand is passed a non-queued command AND
(b) there are commands queued to hardware already.
So you have to quiesce the device before issuing the smart command? In which case, scsi_quiesce_device() is the API you want. Or is this some type of command ordering problem you're trying to solve?
James