Skip to contentSkip to conversation

SCSI synchronization and error handling

DISCUSSION Jeff Garzik 2 participants 2 messages Jun 30, 2004 – Jul 1, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
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_BUSY if (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