aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_exch.c
diff options
context:
space:
mode:
authorVasu Dev <vasu.dev@intel.com>2011-10-28 14:34:17 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-31 05:27:19 -0400
commitb6e3c84034b93e6acc895711f74730e235dfe9d2 (patch)
treed4f80cd98ba82f5900a1f21ff9b623d86ed12c8f /drivers/scsi/libfc/fc_exch.c
parent14fc315fa30d128760c7edeff56530142576cd2e (diff)
[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 <vasu.dev@intel.com> Tested-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libfc/fc_exch.c')
-rw-r--r--drivers/scsi/libfc/fc_exch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 81235f36adc1..1b22130035da 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1793,6 +1793,9 @@ restart:
1793 goto restart; 1793 goto restart;
1794 } 1794 }
1795 } 1795 }
1796 pool->next_index = 0;
1797 pool->left = FC_XID_UNKNOWN;
1798 pool->right = FC_XID_UNKNOWN;
1796 spin_unlock_bh(&pool->lock); 1799 spin_unlock_bh(&pool->lock);
1797} 1800}
1798 1801
@@ -2281,6 +2284,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lport,
2281 goto free_mempool; 2284 goto free_mempool;
2282 for_each_possible_cpu(cpu) { 2285 for_each_possible_cpu(cpu) {
2283 pool = per_cpu_ptr(mp->pool, cpu); 2286 pool = per_cpu_ptr(mp->pool, cpu);
2287 pool->next_index = 0;
2284 pool->left = FC_XID_UNKNOWN; 2288 pool->left = FC_XID_UNKNOWN;
2285 pool->right = FC_XID_UNKNOWN; 2289 pool->right = FC_XID_UNKNOWN;
2286 spin_lock_init(&pool->lock); 2290 spin_lock_init(&pool->lock);