aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2008-07-24 11:31:49 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-26 15:31:30 -0400
commitc9c5ced90abc22a94c96fa7db0e29c13483a6db0 (patch)
treec85876a934f54735e98b88fef3ee63a63ec7ae30
parentbf6583b5831d3195c45f98ec3016499389cbe18f (diff)
[SCSI] qla2xxx: Additional NPIV corrections.
Minor fixes addressing: - rport managements during vport deletion. - acquire proper physical-ha during qla24xx_abort_command() and qla24xx_queuecommand() - do not needlessly acquire the pha for non-NPIV capable ISPs. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c5
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c9
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c7
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c1
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c6
6 files changed, 19 insertions, 12 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index fcec43a32be3..7a4409ab30ea 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1177,6 +1177,11 @@ static int
1177qla24xx_vport_delete(struct fc_vport *fc_vport) 1177qla24xx_vport_delete(struct fc_vport *fc_vport)
1178{ 1178{
1179 scsi_qla_host_t *vha = fc_vport->dd_data; 1179 scsi_qla_host_t *vha = fc_vport->dd_data;
1180 scsi_qla_host_t *pha = to_qla_parent(vha);
1181
1182 while (test_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags) ||
1183 test_bit(FCPORT_UPDATE_NEEDED, &pha->dpc_flags))
1184 msleep(1000);
1180 1185
1181 qla24xx_disable_vp(vha); 1186 qla24xx_disable_vp(vha);
1182 qla24xx_deallocate_vp_id(vha); 1187 qla24xx_deallocate_vp_id(vha);
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 597ac201969c..601a6b29750c 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -3231,7 +3231,8 @@ qla2x00_update_fcports(scsi_qla_host_t *ha)
3231 3231
3232 /* Go with deferred removal of rport references. */ 3232 /* Go with deferred removal of rport references. */
3233 list_for_each_entry(fcport, &ha->fcports, list) 3233 list_for_each_entry(fcport, &ha->fcports, list)
3234 if (fcport->drport) 3234 if (fcport->drport &&
3235 atomic_read(&fcport->state) != FCS_UNCONFIGURED)
3235 qla2x00_rport_del(fcport); 3236 qla2x00_rport_del(fcport);
3236} 3237}
3237 3238
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 6e14c8eaca82..d57669aa4615 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -269,7 +269,7 @@ qla2x00_start_scsi(srb_t *sp)
269{ 269{
270 int ret, nseg; 270 int ret, nseg;
271 unsigned long flags; 271 unsigned long flags;
272 scsi_qla_host_t *ha, *pha; 272 scsi_qla_host_t *ha;
273 struct scsi_cmnd *cmd; 273 struct scsi_cmnd *cmd;
274 uint32_t *clr_ptr; 274 uint32_t *clr_ptr;
275 uint32_t index; 275 uint32_t index;
@@ -283,7 +283,6 @@ qla2x00_start_scsi(srb_t *sp)
283 /* Setup device pointers. */ 283 /* Setup device pointers. */
284 ret = 0; 284 ret = 0;
285 ha = sp->ha; 285 ha = sp->ha;
286 pha = to_qla_parent(ha);
287 reg = &ha->iobase->isp; 286 reg = &ha->iobase->isp;
288 cmd = sp->cmd; 287 cmd = sp->cmd;
289 /* So we know we haven't pci_map'ed anything yet */ 288 /* So we know we haven't pci_map'ed anything yet */
@@ -298,7 +297,7 @@ qla2x00_start_scsi(srb_t *sp)
298 } 297 }
299 298
300 /* Acquire ring specific lock */ 299 /* Acquire ring specific lock */
301 spin_lock_irqsave(&pha->hardware_lock, flags); 300 spin_lock_irqsave(&ha->hardware_lock, flags);
302 301
303 /* Check for room in outstanding command list. */ 302 /* Check for room in outstanding command list. */
304 handle = ha->current_outstanding_cmd; 303 handle = ha->current_outstanding_cmd;
@@ -387,14 +386,14 @@ qla2x00_start_scsi(srb_t *sp)
387 ha->response_ring_ptr->signature != RESPONSE_PROCESSED) 386 ha->response_ring_ptr->signature != RESPONSE_PROCESSED)
388 qla2x00_process_response_queue(ha); 387 qla2x00_process_response_queue(ha);
389 388
390 spin_unlock_irqrestore(&pha->hardware_lock, flags); 389 spin_unlock_irqrestore(&ha->hardware_lock, flags);
391 return (QLA_SUCCESS); 390 return (QLA_SUCCESS);
392 391
393queuing_error: 392queuing_error:
394 if (tot_dsds) 393 if (tot_dsds)
395 scsi_dma_unmap(cmd); 394 scsi_dma_unmap(cmd);
396 395
397 spin_unlock_irqrestore(&pha->hardware_lock, flags); 396 spin_unlock_irqrestore(&ha->hardware_lock, flags);
398 397
399 return (QLA_FUNCTION_FAILED); 398 return (QLA_FUNCTION_FAILED);
400} 399}
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 7d7de592f720..bc90d6b8d0a0 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -749,18 +749,17 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
749 uint32_t handle; 749 uint32_t handle;
750 mbx_cmd_t mc; 750 mbx_cmd_t mc;
751 mbx_cmd_t *mcp = &mc; 751 mbx_cmd_t *mcp = &mc;
752 scsi_qla_host_t *pha = to_qla_parent(ha);
753 752
754 DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no)); 753 DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no));
755 754
756 fcport = sp->fcport; 755 fcport = sp->fcport;
757 756
758 spin_lock_irqsave(&pha->hardware_lock, flags); 757 spin_lock_irqsave(&ha->hardware_lock, flags);
759 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { 758 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) {
760 if (ha->outstanding_cmds[handle] == sp) 759 if (ha->outstanding_cmds[handle] == sp)
761 break; 760 break;
762 } 761 }
763 spin_unlock_irqrestore(&pha->hardware_lock, flags); 762 spin_unlock_irqrestore(&ha->hardware_lock, flags);
764 763
765 if (handle == MAX_OUTSTANDING_COMMANDS) { 764 if (handle == MAX_OUTSTANDING_COMMANDS) {
766 /* command not found */ 765 /* command not found */
@@ -2172,7 +2171,7 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp)
2172 2171
2173 spin_lock_irqsave(&pha->hardware_lock, flags); 2172 spin_lock_irqsave(&pha->hardware_lock, flags);
2174 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { 2173 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) {
2175 if (ha->outstanding_cmds[handle] == sp) 2174 if (pha->outstanding_cmds[handle] == sp)
2176 break; 2175 break;
2177 } 2176 }
2178 spin_unlock_irqrestore(&pha->hardware_lock, flags); 2177 spin_unlock_irqrestore(&pha->hardware_lock, flags);
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 9a850a24b38a..50baf6a1d67c 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -106,6 +106,7 @@ qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha)
106 vha->host_no, fcport->loop_id, fcport->vp_idx)); 106 vha->host_no, fcport->loop_id, fcport->vp_idx));
107 107
108 qla2x00_mark_device_lost(vha, fcport, 0, 0); 108 qla2x00_mark_device_lost(vha, fcport, 0, 0);
109 atomic_set(&fcport->state, FCS_UNCONFIGURED);
109 } 110 }
110} 111}
111 112
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 8fc712bbf344..7c8af7ed2a5d 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -449,7 +449,7 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
449 int rval; 449 int rval;
450 scsi_qla_host_t *pha = to_qla_parent(ha); 450 scsi_qla_host_t *pha = to_qla_parent(ha);
451 451
452 if (unlikely(pci_channel_offline(ha->pdev))) { 452 if (unlikely(pci_channel_offline(pha->pdev))) {
453 cmd->result = DID_REQUEUE << 16; 453 cmd->result = DID_REQUEUE << 16;
454 goto qc24_fail_command; 454 goto qc24_fail_command;
455 } 455 }
@@ -2335,8 +2335,10 @@ qla2x00_do_dpc(void *data)
2335 ha->host_no)); 2335 ha->host_no));
2336 } 2336 }
2337 2337
2338 if (test_and_clear_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags)) 2338 if (test_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags)) {
2339 qla2x00_update_fcports(ha); 2339 qla2x00_update_fcports(ha);
2340 clear_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags);
2341 }
2340 2342
2341 if (test_and_clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) && 2343 if (test_and_clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) &&
2342 (!(test_and_set_bit(RESET_ACTIVE, &ha->dpc_flags)))) { 2344 (!(test_and_set_bit(RESET_ACTIVE, &ha->dpc_flags)))) {