Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2014-01-30 Thread Bart Van Assche
On 06/25/13 18:13, Michael Christie wrote: On Jun 25, 2013, at 10:31 AM, Bart Van Assche bvanass...@acm.org wrote: On 06/25/13 15:45, James Bottomley wrote: On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: There is a difference though between moving the EH kthread_stop() call and the

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2014-01-30 Thread James Bottomley
On Thu, 2014-01-30 at 20:46 +0100, Bart Van Assche wrote: On 06/25/13 18:13, Michael Christie wrote: On Jun 25, 2013, at 10:31 AM, Bart Van Assche bvanass...@acm.org wrote: On 06/25/13 15:45, James Bottomley wrote: On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: There is a

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2014-01-30 Thread Bart Van Assche
On 01/31/14 06:58, James Bottomley wrote: On Thu, 2014-01-30 at 20:46 +0100, Bart Van Assche wrote: On 06/25/13 18:13, Michael Christie wrote: Sorry but I'm afraid that making the SCSI core invoke a callback function from a device, target or host release function would create a new challenge,

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread Bart Van Assche
On 06/25/13 00:27, James Bottomley wrote: For a variety of reasons this patch set is incredibly hard to review: Almost every patch touches pieces in the mid layer where you have to be sure in minute detail you know what's going on (and what should be going on), so usually it's a couple of hours

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread James Bottomley
On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: On 06/25/13 00:27, James Bottomley wrote: On Mon, 2013-06-24 at 15:04 -0500, Mike Christie wrote: On 06/24/2013 02:19 PM, James Bottomley wrote: On Wed, 2013-06-12 at 14:55 +0200, Bart Van Assche wrote: A SCSI LLD may start

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread Bart Van Assche
On 06/25/13 15:45, James Bottomley wrote: On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: There is a difference though between moving the EH kthread_stop() call and the patch at the start of this thread: moving the EH kthread_stop() call does not prevent that an ioctl like

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread Michael Christie
On Jun 25, 2013, at 10:31 AM, Bart Van Assche bvanass...@acm.org wrote: On 06/25/13 15:45, James Bottomley wrote: On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: There is a difference though between moving the EH kthread_stop() call and the patch at the start of this thread: moving

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread James Bottomley
On Tue, 2013-06-25 at 11:13 -0500, Michael Christie wrote: On Jun 25, 2013, at 10:31 AM, Bart Van Assche bvanass...@acm.org wrote: On 06/25/13 15:45, James Bottomley wrote: On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: There is a difference though between moving the EH

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread Bart Van Assche
On 06/25/13 19:40, James Bottomley wrote: If I look at what we actually do: all the HBAs treat scsi_remove_host as a waited for transition. The reason this works is the loop over __scsi_remove_device() in scsi_forget_host(). By the time that loop returns, every scsi_device is gone (and so is

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-24 Thread Bart Van Assche
On 06/24/13 03:15, Mike Christie wrote: On 6/12/13 7:55 AM, Bart Van Assche wrote: A SCSI LLD may start cleaning up host resources as soon as scsi_remove_host() returns. These host resources may be needed by the LLD in an implementation of one of the eh_* functions. So if one of the eh_*

RE:[PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-24 Thread Jack Wang
@@ -646,14 +703,20 @@ static int scsi_try_target_reset(struct scsi_cmnd *scmd) static int scsi_try_bus_device_reset(struct scsi_cmnd *scmd) { int rtn; - struct scsi_host_template *hostt = scmd-device-host-hostt; + struct Scsi_Host *host = scmd-device-host; +

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-24 Thread Bart Van Assche
On 06/24/13 12:17, Jack Wang wrote: @@ -646,14 +703,20 @@ static int scsi_try_target_reset(struct scsi_cmnd *scmd) static int scsi_try_bus_device_reset(struct scsi_cmnd *scmd) { int rtn; - struct scsi_host_template *hostt = scmd-device-host-hostt; + struct Scsi_Host

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-24 Thread James Bottomley
On Wed, 2013-06-12 at 14:55 +0200, Bart Van Assche wrote: A SCSI LLD may start cleaning up host resources as soon as scsi_remove_host() returns. These host resources may be needed by the LLD in an implementation of one of the eh_* functions. So if one of the eh_* functions is in progress when

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-24 Thread Mike Christie
On 06/24/2013 02:19 PM, James Bottomley wrote: On Wed, 2013-06-12 at 14:55 +0200, Bart Van Assche wrote: A SCSI LLD may start cleaning up host resources as soon as scsi_remove_host() returns. These host resources may be needed by the LLD in an implementation of one of the eh_* functions. So if

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-24 Thread Mike Christie
On 06/24/2013 05:27 PM, James Bottomley wrote: However, what's the reasoning behind wanting to do this? In theory all necessary resources for the eh thread should only be freed in the release callback. That means they aren't freed until all error recovery completes. I think it makes it

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-24 Thread Michael Christie
On Jun 24, 2013, at 9:26 PM, Mike Christie micha...@cs.wisc.edu wrote: On 06/24/2013 05:27 PM, James Bottomley wrote: However, what's the reasoning behind wanting to do this? In theory all necessary resources for the eh thread should only be freed in the release callback. That means they

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-23 Thread Mike Christie
On 6/12/13 7:55 AM, Bart Van Assche wrote: A SCSI LLD may start cleaning up host resources as soon as scsi_remove_host() returns. These host resources may be needed by the LLD in an implementation of one of the eh_* functions. So if one of the eh_* functions is in progress when

[PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-12 Thread Bart Van Assche
A SCSI LLD may start cleaning up host resources as soon as scsi_remove_host() returns. These host resources may be needed by the LLD in an implementation of one of the eh_* functions. So if one of the eh_* functions is in progress when scsi_remove_host() is invoked, wait until the eh_* function