public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Discussion: soft unbinding
@ 2008-05-03 16:03 Alan Stern
  2008-05-03 17:22 ` Stefan Richter
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Stern @ 2008-05-03 16:03 UTC (permalink / raw)
  To: Matthew Dharm, Oliver Neukum, Stefan Richter
  Cc: USB Storage list, SCSI development list

When talking about "soft" unbinding, the main question seems to be: How 
soft?

It would be easy, for instance, to change usb-storage so that unbinding
would wait until the current command was finished.  But clearly one
wants to do more: Give the upper-level SCSI drivers a chance to
shutdown cleanly and issue their FLUSH CACHE commands, wait for all
pending commands to complete, and so on.

It's the "wait for pending commands to complete" part that is hard.  
Some commands have relatively long timeouts.  Error handler operations
have no timeouts.  Commands submitted through sg can have effectively
infinite timeouts.  So how long should we wait?

Should there be a scsi_soft_remove_host() routine that accepts a
timeout value?  It would remove the devices under the host and wait
until the timeout expires (if necessary) before aborting all pending
commands.  Unlike scsi_remove_host(), it would really abort these
commands as though they had timed out, instead of simply cancelling
them.  It would guarantee that when it returned, no commands were still
running on the host and no more commands would be submitted.

This would essentially be a standardized version of the special code 
Stefan has put into the sbp2 and firewire-sbp2 drivers.

Alan Stern


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-05-05  3:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-03 16:03 Discussion: soft unbinding Alan Stern
2008-05-03 17:22 ` Stefan Richter
2008-05-03 20:42   ` Alan Stern
2008-05-03 22:32     ` James Bottomley
2008-05-04  2:28       ` Alan Stern
2008-05-04 10:53         ` Stefan Richter
2008-05-04 14:15         ` James Bottomley
2008-05-04 21:14           ` Alan Stern
2008-05-05  3:42             ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox