From b6e3c84034b93e6acc895711f74730e235dfe9d2 Mon Sep 17 00:00:00 2001 From: Vasu Dev Date: Fri, 28 Oct 2011 11:34:17 -0700 Subject: [SCSI] libfc: avoid exchanges collision during lport reset Currently timer delay is large and is using msleep to avoid avoid exchanges collision across lport reset, so instead do this by initializing exches pool indexes during reset also. Signed-off-by: Vasu Dev Tested-by: Bhanu Prakash Gollapudi Signed-off-by: Yi Zou Signed-off-by: James Bottomley --- drivers/scsi/libfc/fc_exch.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/scsi/libfc/fc_exch.c') diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 81235f36adc..1b22130035d 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -1793,6 +1793,9 @@ restart: goto restart; } } + pool->next_index = 0; + pool->left = FC_XID_UNKNOWN; + pool->right = FC_XID_UNKNOWN; spin_unlock_bh(&pool->lock); } @@ -2281,6 +2284,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lport, goto free_mempool; for_each_possible_cpu(cpu) { pool = per_cpu_ptr(mp->pool, cpu); + pool->next_index = 0; pool->left = FC_XID_UNKNOWN; pool->right = FC_XID_UNKNOWN; spin_lock_init(&pool->lock); -- cgit v1.2.3-70-g09d2