]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
[SCSI] libfc: avoid exchanges collision during lport reset
authorVasu Dev <vasu.dev@intel.com>
Fri, 28 Oct 2011 18:34:17 +0000 (11:34 -0700)
committerJoe Jin <joe.jin@oracle.com>
Thu, 16 Feb 2012 00:03:30 +0000 (08:03 +0800)
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>
(cherry picked from commit b6e3c84034b93e6acc895711f74730e235dfe9d2)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/scsi/libfc/fc_exch.c

index 3b8a6451ea283ec5093307a774f32d92e7d90878..3670719e0ce2ffdd50a6ca6c69a0d6c5eadc4130 100644 (file)
@@ -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);