logo       

How to force abort of a SCSI command: msg#00292

Subject: How to force abort of a SCSI command
I'm starting to work on a kernel driver that will submit SCSI requests 
directly to a device queue -- rather like the sg driver except that mine 
will operate as a bottom half, not in process context.  There won't be any 
predetermined timeouts for the commands, but sometimes my driver will need 
to abort a command and perform a device reset.

I see that scsi_reset_provider() is available to implement device reset
requests (although it needs to run in a process, no big deal).  But it
won't abort a command that's already in progress.

So I need to know how to abort a queued request.  That actually involves 
two problems: how to abort a request that hasn't yet made it to the head 
of the queue and begun processing, and how to abort a command that has 
already gone to the low-level device driver.  The first problem probably 
doesn't matter much; I'm assuming that nobody else will be using the 
device at the same time as my driver.  But it would be nice to know how to 
cancel _all_ the outstanding requests on the device queue.

The second problem is the real one I have to face.  Is there some way to 
abort an ongoing command, perhaps by following pointers to the scsi_cmnd 
structure and invoking the timeout routine directly?

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



<Prev in Thread] Current Thread [Next in Thread>