summaryrefslogtreecommitdiff
path: root/drivers/scsi/bnx2i/bnx2i_init.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-05-07 11:27:54 +0200
committerIngo Molnar <mingo@elte.hu>2010-05-07 11:27:54 +0200
commit48652ced1533c3372f996a0d83b6e73b1f1c9381 (patch)
tree5e17729cfcdc97bf798a17b57cdb888b4ded65b0 /drivers/scsi/bnx2i/bnx2i_init.c
parent99bd5e2f245d8cd17d040c82d40becdb3efd9b69 (diff)
parent66f41d4c5c8a5deed66fdcc84509376c9a0bf9d8 (diff)
Merge commit 'v2.6.34-rc6' into sched/core
Diffstat (limited to 'drivers/scsi/bnx2i/bnx2i_init.c')
-rw-r--r--drivers/scsi/bnx2i/bnx2i_init.c13
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)
struct bnx2i_hba *hba = handle;
/* check if cleanup happened in GOING_DOWN context */
- clear_bit(ADAPTER_STATE_UP, &hba->adapter_state);
if (!test_and_clear_bit(ADAPTER_STATE_GOING_DOWN,
&hba->adapter_state))
iscsi_host_for_each_session(hba->shost,
bnx2i_drop_session);
+
+ /* Wait for all endpoints to be torn down, Chip will be reset once
+ * control returns to network driver. So it is required to cleanup and
+ * release all connection resources before returning from this routine.
+ */
+ wait_event_interruptible_timeout(hba->eh_wait,
+ (hba->ofld_conns_active == 0),
+ hba->hba_shutdown_tmo);
+ /* This flag should be cleared last so that ep_disconnect() gracefully
+ * cleans up connection context
+ */
+ clear_bit(ADAPTER_STATE_UP, &hba->adapter_state);
}
/**