On Sun, 2005-08-07 at 10:59 -0400, Alan Stern wrote: > 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: There isn't any by design. I think you're not thinking about how this works correctly. What remove host does is loop over the active devices removing them from visibility and trying to do a final put on the generic devices before removing the host from visibility and doing a final put on it. However, any outstanding user will have a reference and will keep all the bits of the hierarchy in place until that reference is relinquished. > 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? I take it the problem is that most LLDs go on to release resources (like interrupts and memory regions) immediately after calling scsi_remove_host()? The solution is probably to trigger the resource cleanup from the host device release method. James - : 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