aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_iocb.c
diff options
context:
space:
mode:
authorSeokmann Ju <seokmann.ju@qlogic.com>2008-07-10 19:55:55 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-26 15:14:40 -0400
commit246de42cfc0abc4e25585f2dca53f8226f62391c (patch)
treeb0450362acf42eaeb504a4a901d9de27250833a3 /drivers/scsi/qla2xxx/qla_iocb.c
parent436a7b11234ccccd91e3000aacdbdd25bd7847a8 (diff)
[SCSI] qla2xxx: Always aquire the parent's hardware_lock.
While issuing a marker, manipulating the request/response queues and modifying the outstanding command array. Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 5489d5024673..6e14c8eaca82 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; 272 scsi_qla_host_t *ha, *pha;
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,6 +283,7 @@ 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);
286 reg = &ha->iobase->isp; 287 reg = &ha->iobase->isp;
287 cmd = sp->cmd; 288 cmd = sp->cmd;
288 /* So we know we haven't pci_map'ed anything yet */ 289 /* So we know we haven't pci_map'ed anything yet */
@@ -297,7 +298,7 @@ qla2x00_start_scsi(srb_t *sp)
297 } 298 }
298 299
299 /* Acquire ring specific lock */ 300 /* Acquire ring specific lock */
300 spin_lock_irqsave(&ha->hardware_lock, flags); 301 spin_lock_irqsave(&pha->hardware_lock, flags);
301 302
302 /* Check for room in outstanding command list. */ 303 /* Check for room in outstanding command list. */
303 handle = ha->current_outstanding_cmd; 304 handle = ha->current_outstanding_cmd;
@@ -386,14 +387,14 @@ qla2x00_start_scsi(srb_t *sp)
386 ha->response_ring_ptr->signature != RESPONSE_PROCESSED) 387 ha->response_ring_ptr->signature != RESPONSE_PROCESSED)
387 qla2x00_process_response_queue(ha); 388 qla2x00_process_response_queue(ha);
388 389
389 spin_unlock_irqrestore(&ha->hardware_lock, flags); 390 spin_unlock_irqrestore(&pha->hardware_lock, flags);
390 return (QLA_SUCCESS); 391 return (QLA_SUCCESS);
391 392
392queuing_error: 393queuing_error:
393 if (tot_dsds) 394 if (tot_dsds)
394 scsi_dma_unmap(cmd); 395 scsi_dma_unmap(cmd);
395 396
396 spin_unlock_irqrestore(&ha->hardware_lock, flags); 397 spin_unlock_irqrestore(&pha->hardware_lock, flags);
397 398
398 return (QLA_FUNCTION_FAILED); 399 return (QLA_FUNCTION_FAILED);
399} 400}
@@ -454,10 +455,11 @@ qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
454{ 455{
455 int ret; 456 int ret;
456 unsigned long flags = 0; 457 unsigned long flags = 0;
458 scsi_qla_host_t *pha = to_qla_parent(ha);
457 459
458 spin_lock_irqsave(&ha->hardware_lock, flags); 460 spin_lock_irqsave(&pha->hardware_lock, flags);
459 ret = __qla2x00_marker(ha, loop_id, lun, type); 461 ret = __qla2x00_marker(ha, loop_id, lun, type);
460 spin_unlock_irqrestore(&ha->hardware_lock, flags); 462 spin_unlock_irqrestore(&pha->hardware_lock, flags);
461 463
462 return (ret); 464 return (ret);
463} 465}
@@ -672,7 +674,7 @@ qla24xx_start_scsi(srb_t *sp)
672{ 674{
673 int ret, nseg; 675 int ret, nseg;
674 unsigned long flags; 676 unsigned long flags;
675 scsi_qla_host_t *ha; 677 scsi_qla_host_t *ha, *pha;
676 struct scsi_cmnd *cmd; 678 struct scsi_cmnd *cmd;
677 uint32_t *clr_ptr; 679 uint32_t *clr_ptr;
678 uint32_t index; 680 uint32_t index;
@@ -686,6 +688,7 @@ qla24xx_start_scsi(srb_t *sp)
686 /* Setup device pointers. */ 688 /* Setup device pointers. */
687 ret = 0; 689 ret = 0;
688 ha = sp->ha; 690 ha = sp->ha;
691 pha = to_qla_parent(ha);
689 reg = &ha->iobase->isp24; 692 reg = &ha->iobase->isp24;
690 cmd = sp->cmd; 693 cmd = sp->cmd;
691 /* So we know we haven't pci_map'ed anything yet */ 694 /* So we know we haven't pci_map'ed anything yet */
@@ -700,7 +703,7 @@ qla24xx_start_scsi(srb_t *sp)
700 } 703 }
701 704
702 /* Acquire ring specific lock */ 705 /* Acquire ring specific lock */
703 spin_lock_irqsave(&ha->hardware_lock, flags); 706 spin_lock_irqsave(&pha->hardware_lock, flags);
704 707
705 /* Check for room in outstanding command list. */ 708 /* Check for room in outstanding command list. */
706 handle = ha->current_outstanding_cmd; 709 handle = ha->current_outstanding_cmd;
@@ -795,14 +798,14 @@ qla24xx_start_scsi(srb_t *sp)
795 ha->response_ring_ptr->signature != RESPONSE_PROCESSED) 798 ha->response_ring_ptr->signature != RESPONSE_PROCESSED)
796 qla24xx_process_response_queue(ha); 799 qla24xx_process_response_queue(ha);
797 800
798 spin_unlock_irqrestore(&ha->hardware_lock, flags); 801 spin_unlock_irqrestore(&pha->hardware_lock, flags);
799 return QLA_SUCCESS; 802 return QLA_SUCCESS;
800 803
801queuing_error: 804queuing_error:
802 if (tot_dsds) 805 if (tot_dsds)
803 scsi_dma_unmap(cmd); 806 scsi_dma_unmap(cmd);
804 807
805 spin_unlock_irqrestore(&ha->hardware_lock, flags); 808 spin_unlock_irqrestore(&pha->hardware_lock, flags);
806 809
807 return QLA_FUNCTION_FAILED; 810 return QLA_FUNCTION_FAILED;
808} 811}