linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Synchronizing scsi_remove_host and the error handler
@ 2005-08-07 14:59 Alan Stern
  2005-08-07 15:36 ` James Bottomley
  2005-08-08 18:04 ` Luben Tuikov
  0 siblings, 2 replies; 30+ messages in thread
From: Alan Stern @ 2005-08-07 14:59 UTC (permalink / raw)
  To: Mike Anderson; +Cc: SCSI development list

Mike:

What sort of synchronization is there between scsi_remove_host and the 
error-handler thread?  Offhand I can see two possible problems, depending 
on how the LLD is written:

     1.	The error handler asks the LLD to perform a reset just as the LLD
	calls scsi_remove_host as part of rmmod.  scsi_remove_host 
	returns, the LLD's remove method returns, and the LLD is unloaded
	from memory while its reset routine is executing.

     2. The error handler asks the LLD to perform a reset just before the
	LLD calls scsi_remove_host.  The LLD's remove method can't return
	until the reset completes (otherwise the reset would be executing 
	code that is about to be unloaded, as in (1)).  But the reset
	can't get started until it acquires the host adapter's device 
	semaphore, which is owned by the rmmod thread.

(1) causes an oops and (2) causes a deadlock.  Note that (1) can be 
avoided by making scis_remove_host wait until the error handler thread has 
exited, but that will make (2) much more likely to happen.

In general, there needs to be some way for the error handler to prevent
the LLD from being unloaded.  I don't know what the best answer is.  Has
anyone thought about this?

Alan Stern


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

end of thread, other threads:[~2005-08-09 20:45 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-07 14:59 Synchronizing scsi_remove_host and the error handler Alan Stern
2005-08-07 15:36 ` James Bottomley
2005-08-07 18:43   ` Alan Stern
2005-08-07 21:57     ` James Bottomley
2005-08-08 18:24       ` Luben Tuikov
2005-08-08 19:54         ` Mike Anderson
2005-08-08 20:25           ` Luben Tuikov
2005-08-08 20:06       ` Mike Anderson
2005-08-07 22:15     ` Stefan Richter
2005-08-08 20:41       ` Alan Stern
2005-08-08 21:36         ` Mike Anderson
2005-08-08 22:36           ` Alan Stern
2005-08-08 23:10             ` Stefan Richter
2005-08-09 14:23               ` Alan Stern
2005-08-09 19:37                 ` Stefan Richter
2005-08-09 20:07                   ` Alan Stern
2005-08-09 20:45                     ` Stefan Richter
2005-08-08 23:59             ` Stefan Richter
2005-08-09 14:40               ` Alan Stern
2005-08-09 18:21                 ` Stefan Richter
2005-08-09 18:49                   ` Alan Stern
2005-08-08 21:49         ` Stefan Richter
2005-08-08 22:20         ` Luben Tuikov
2005-08-08 22:30           ` Alan Stern
2005-08-09  0:49             ` Luben Tuikov
2005-08-09 14:50               ` Alan Stern
2005-08-08 22:23         ` James Bottomley
2005-08-08 22:40           ` Alan Stern
2005-08-08 18:07   ` Luben Tuikov
2005-08-08 18:04 ` Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).