aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mid.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2009-08-25 14:36:19 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-12 10:35:22 -0400
commit0d6e61bc6a4f3f54444b088ae6d447f1703a21dd (patch)
tree20594eed50ae777518a1b5d9f3c6dd81cb110dfc /drivers/scsi/qla2xxx/qla_mid.c
parentd970432c48ab8dd28216e80942723aeb505b623e (diff)
[SCSI] qla2xxx: Correct various NPIV issues.
* Consolidate vport-count processing. * Correct vp_idx restrictions during RSCN processing. * Push topology verification check to qla2x00_do_dpc_all_vps(). * Don't skip vport full-login-lip/lip-reset mailbox handling. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mid.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index a748a95efb10..42b799abba57 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -42,7 +42,6 @@ qla24xx_allocate_vp_id(scsi_qla_host_t *vha)
42 42
43 set_bit(vp_id, ha->vp_idx_map); 43 set_bit(vp_id, ha->vp_idx_map);
44 ha->num_vhosts++; 44 ha->num_vhosts++;
45 ha->cur_vport_count++;
46 vha->vp_idx = vp_id; 45 vha->vp_idx = vp_id;
47 list_add_tail(&vha->list, &ha->vp_list); 46 list_add_tail(&vha->list, &ha->vp_list);
48 mutex_unlock(&ha->vport_lock); 47 mutex_unlock(&ha->vport_lock);
@@ -58,7 +57,6 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha)
58 mutex_lock(&ha->vport_lock); 57 mutex_lock(&ha->vport_lock);
59 vp_id = vha->vp_idx; 58 vp_id = vha->vp_idx;
60 ha->num_vhosts--; 59 ha->num_vhosts--;
61 ha->cur_vport_count--;
62 clear_bit(vp_id, ha->vp_idx_map); 60 clear_bit(vp_id, ha->vp_idx_map);
63 list_del(&vha->list); 61 list_del(&vha->list);
64 mutex_unlock(&ha->vport_lock); 62 mutex_unlock(&ha->vport_lock);
@@ -235,7 +233,11 @@ qla2x00_vp_abort_isp(scsi_qla_host_t *vha)
235 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); 233 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
236 } 234 }
237 235
238 /* To exclusively reset vport, we need to log it out first.*/ 236 /*
237 * To exclusively reset vport, we need to log it out first. Note: this
238 * control_vp can fail if ISP reset is already issued, this is
239 * expected, as the vp would be already logged out due to ISP reset.
240 */
239 if (!test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) 241 if (!test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags))
240 qla24xx_control_vp(vha, VCE_COMMAND_DISABLE_VPS_LOGO_ALL); 242 qla24xx_control_vp(vha, VCE_COMMAND_DISABLE_VPS_LOGO_ALL);
241 243
@@ -247,23 +249,11 @@ qla2x00_vp_abort_isp(scsi_qla_host_t *vha)
247static int 249static int
248qla2x00_do_dpc_vp(scsi_qla_host_t *vha) 250qla2x00_do_dpc_vp(scsi_qla_host_t *vha)
249{ 251{
250 struct qla_hw_data *ha = vha->hw;
251 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
252
253 if (!(ha->current_topology & ISP_CFG_F))
254 return 0;
255
256 qla2x00_do_work(vha); 252 qla2x00_do_work(vha);
257 253
258 if (test_and_clear_bit(VP_IDX_ACQUIRED, &vha->vp_flags)) { 254 if (test_and_clear_bit(VP_IDX_ACQUIRED, &vha->vp_flags)) {
259 /* VP acquired. complete port configuration */ 255 /* VP acquired. complete port configuration */
260 if (atomic_read(&base_vha->loop_state) == LOOP_READY) { 256 qla24xx_configure_vp(vha);
261 qla24xx_configure_vp(vha);
262 } else {
263 set_bit(VP_IDX_ACQUIRED, &vha->vp_flags);
264 set_bit(VP_DPC_NEEDED, &base_vha->dpc_flags);
265 }
266
267 return 0; 257 return 0;
268 } 258 }
269 259
@@ -314,6 +304,9 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
314 304
315 clear_bit(VP_DPC_NEEDED, &vha->dpc_flags); 305 clear_bit(VP_DPC_NEEDED, &vha->dpc_flags);
316 306
307 if (!(ha->current_topology & ISP_CFG_F))
308 return;
309
317 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { 310 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
318 if (vp->vp_idx) 311 if (vp->vp_idx)
319 ret = qla2x00_do_dpc_vp(vp); 312 ret = qla2x00_do_dpc_vp(vp);
@@ -418,6 +411,11 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
418 411
419 vha->flags.init_done = 1; 412 vha->flags.init_done = 1;
420 413
414 mutex_lock(&ha->vport_lock);
415 set_bit(vha->vp_idx, ha->vp_idx_map);
416 ha->cur_vport_count++;
417 mutex_unlock(&ha->vport_lock);
418
421 return vha; 419 return vha;
422 420
423create_vhost_failed: 421create_vhost_failed: