Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > The conundrum I'm facing is how to make sure that when scsi_remove_host > returns, the mid-layer is no longer sending anything to the host. Sure, > no new commands will be issued once the state is set to DEL (or > DEL_RECOVERY). But what about commands/resets that were already in > progress at that time? (Especially if they were issued before > scsi_remove_host was called.) The routine shouldn't return until they > have completed. This applies to commands coming from either the > high-level driver or from the error handler. > I do not understand why we would not want to wait on the eh thread and shut it down before returning from scsi_remove_host. In the end we are really going to wait on this action anyways. Currently scsi_send_eh_cmnd does not go through scsi_dispatch_cmd and eh_* calls have no checks besides SUCCESS and FAILED. The scsi_send_eh_cmnd should be updated to follow the same model that scsi_dispatch_cmd uses and the eh_* calls good be improved if we allowed another return code that the LLDDs could use to indicate that no device was present. These would only be an optimization to reduce the wait time on the eh thread and if not implemented would just increase the wait time. -andmike -- Michael Anderson andmike@xxxxxxxxxx - : 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