diff options
Diffstat (limited to 'drivers/scsi/bnx2i/bnx2i_init.c')
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_init.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c index 6d8172e781cf..5d9296c599f6 100644 --- a/drivers/scsi/bnx2i/bnx2i_init.c +++ b/drivers/scsi/bnx2i/bnx2i_init.c | |||
@@ -177,11 +177,22 @@ void bnx2i_stop(void *handle) | |||
177 | struct bnx2i_hba *hba = handle; | 177 | struct bnx2i_hba *hba = handle; |
178 | 178 | ||
179 | /* check if cleanup happened in GOING_DOWN context */ | 179 | /* check if cleanup happened in GOING_DOWN context */ |
180 | clear_bit(ADAPTER_STATE_UP, &hba->adapter_state); | ||
181 | if (!test_and_clear_bit(ADAPTER_STATE_GOING_DOWN, | 180 | if (!test_and_clear_bit(ADAPTER_STATE_GOING_DOWN, |
182 | &hba->adapter_state)) | 181 | &hba->adapter_state)) |
183 | iscsi_host_for_each_session(hba->shost, | 182 | iscsi_host_for_each_session(hba->shost, |
184 | bnx2i_drop_session); | 183 | bnx2i_drop_session); |
184 | |||
185 | /* Wait for all endpoints to be torn down, Chip will be reset once | ||
186 | * control returns to network driver. So it is required to cleanup and | ||
187 | * release all connection resources before returning from this routine. | ||
188 | */ | ||
189 | wait_event_interruptible_timeout(hba->eh_wait, | ||
190 | (hba->ofld_conns_active == 0), | ||
191 | hba->hba_shutdown_tmo); | ||
192 | /* This flag should be cleared last so that ep_disconnect() gracefully | ||
193 | * cleans up connection context | ||
194 | */ | ||
195 | clear_bit(ADAPTER_STATE_UP, &hba->adapter_state); | ||
185 | } | 196 | } |
186 | 197 | ||
187 | /** | 198 | /** |