From: Vasu Dev Date: Fri, 28 Oct 2011 18:34:17 +0000 (-0700) Subject: [SCSI] libfc: avoid exchanges collision during lport reset X-Git-Tag: v2.6.39-400.9.0~606^2~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f0da655cfa8a3afa0b064b308d56bf62c1d072fe;p=users%2Fjedix%2Flinux-maple.git [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 (cherry picked from commit b6e3c84034b93e6acc895711f74730e235dfe9d2) Signed-off-by: Joe Jin --- diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 3b8a6451ea28..3670719e0ce2 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -1754,6 +1754,9 @@ restart: goto restart; } } + pool->next_index = 0; + pool->left = FC_XID_UNKNOWN; + pool->right = FC_XID_UNKNOWN; spin_unlock_bh(&pool->lock); } @@ -2238,6 +2241,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);