aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_scsi.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2010-07-14 15:30:54 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:05:40 -0400
commit589a52d6a97e01c5ff6c244ee6c8ea57726c610f (patch)
treec8df31220d1b46c792552cd04fe4697a12af139d /drivers/scsi/lpfc/lpfc_scsi.c
parent75576bb9b208d7c66822f310cdef9ca2d72c879c (diff)
[SCSI] lpfc 8.3.15: BSG, Discovery, and Misc fixes
- BSG interface related: - Fix node reference count if node is active - Warn if we're overwriting an active CT context - Discovery related: - Clear "Ignore Reg Login" flag when purging mailbox queue - Pay attention to return code for fc_block_scsi_eh() - Stall device loss code if we're almost done when it fires (we're logged in, but PRLI is outstanding) - Bugs - Correct DIF code for endianness issues - Correct where we had missed points to check txq on i/o completion/cleanup Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 7b66b71a14fe..d6089c985c3f 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -623,6 +623,7 @@ lpfc_sli4_fcp_xri_aborted(struct lpfc_hba *phba,
623 unsigned long iflag = 0; 623 unsigned long iflag = 0;
624 struct lpfc_iocbq *iocbq; 624 struct lpfc_iocbq *iocbq;
625 int i; 625 int i;
626 struct lpfc_sli_ring *pring = &phba->sli.ring[LPFC_ELS_RING];
626 627
627 spin_lock_irqsave(&phba->hbalock, iflag); 628 spin_lock_irqsave(&phba->hbalock, iflag);
628 spin_lock(&phba->sli4_hba.abts_scsi_buf_list_lock); 629 spin_lock(&phba->sli4_hba.abts_scsi_buf_list_lock);
@@ -651,6 +652,8 @@ lpfc_sli4_fcp_xri_aborted(struct lpfc_hba *phba,
651 psb = container_of(iocbq, struct lpfc_scsi_buf, cur_iocbq); 652 psb = container_of(iocbq, struct lpfc_scsi_buf, cur_iocbq);
652 psb->exch_busy = 0; 653 psb->exch_busy = 0;
653 spin_unlock_irqrestore(&phba->hbalock, iflag); 654 spin_unlock_irqrestore(&phba->hbalock, iflag);
655 if (pring->txq_cnt)
656 lpfc_worker_wake_up(phba);
654 return; 657 return;
655 658
656 } 659 }
@@ -1322,6 +1325,10 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
1322 bf_set(pde5_type, pde5, LPFC_PDE5_DESCRIPTOR); 1325 bf_set(pde5_type, pde5, LPFC_PDE5_DESCRIPTOR);
1323 pde5->reftag = reftag; 1326 pde5->reftag = reftag;
1324 1327
1328 /* Endian convertion if necessary for PDE5 */
1329 pde5->word0 = cpu_to_le32(pde5->word0);
1330 pde5->reftag = cpu_to_le32(pde5->reftag);
1331
1325 /* advance bpl and increment bde count */ 1332 /* advance bpl and increment bde count */
1326 num_bde++; 1333 num_bde++;
1327 bpl++; 1334 bpl++;
@@ -1340,6 +1347,11 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
1340 bf_set(pde6_ai, pde6, 1); 1347 bf_set(pde6_ai, pde6, 1);
1341 bf_set(pde6_apptagval, pde6, apptagval); 1348 bf_set(pde6_apptagval, pde6, apptagval);
1342 1349
1350 /* Endian convertion if necessary for PDE6 */
1351 pde6->word0 = cpu_to_le32(pde6->word0);
1352 pde6->word1 = cpu_to_le32(pde6->word1);
1353 pde6->word2 = cpu_to_le32(pde6->word2);
1354
1343 /* advance bpl and increment bde count */ 1355 /* advance bpl and increment bde count */
1344 num_bde++; 1356 num_bde++;
1345 bpl++; 1357 bpl++;
@@ -1447,6 +1459,10 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
1447 bf_set(pde5_type, pde5, LPFC_PDE5_DESCRIPTOR); 1459 bf_set(pde5_type, pde5, LPFC_PDE5_DESCRIPTOR);
1448 pde5->reftag = reftag; 1460 pde5->reftag = reftag;
1449 1461
1462 /* Endian convertion if necessary for PDE5 */
1463 pde5->word0 = cpu_to_le32(pde5->word0);
1464 pde5->reftag = cpu_to_le32(pde5->reftag);
1465
1450 /* advance bpl and increment bde count */ 1466 /* advance bpl and increment bde count */
1451 num_bde++; 1467 num_bde++;
1452 bpl++; 1468 bpl++;
@@ -1463,6 +1479,11 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
1463 bf_set(pde6_ai, pde6, 1); 1479 bf_set(pde6_ai, pde6, 1);
1464 bf_set(pde6_apptagval, pde6, apptagval); 1480 bf_set(pde6_apptagval, pde6, apptagval);
1465 1481
1482 /* Endian convertion if necessary for PDE6 */
1483 pde6->word0 = cpu_to_le32(pde6->word0);
1484 pde6->word1 = cpu_to_le32(pde6->word1);
1485 pde6->word2 = cpu_to_le32(pde6->word2);
1486
1466 /* advance bpl and increment bde count */ 1487 /* advance bpl and increment bde count */
1467 num_bde++; 1488 num_bde++;
1468 bpl++; 1489 bpl++;
@@ -1474,7 +1495,6 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
1474 prot_bde->addrLow = le32_to_cpu(putPaddrHigh(protphysaddr)); 1495 prot_bde->addrLow = le32_to_cpu(putPaddrHigh(protphysaddr));
1475 protgroup_len = sg_dma_len(sgpe); 1496 protgroup_len = sg_dma_len(sgpe);
1476 1497
1477
1478 /* must be integer multiple of the DIF block length */ 1498 /* must be integer multiple of the DIF block length */
1479 BUG_ON(protgroup_len % 8); 1499 BUG_ON(protgroup_len % 8);
1480 1500
@@ -3047,7 +3067,9 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
3047 int ret = SUCCESS; 3067 int ret = SUCCESS;
3048 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq); 3068 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq);
3049 3069
3050 fc_block_scsi_eh(cmnd); 3070 ret = fc_block_scsi_eh(cmnd);
3071 if (ret)
3072 return ret;
3051 lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble; 3073 lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble;
3052 BUG_ON(!lpfc_cmd); 3074 BUG_ON(!lpfc_cmd);
3053 3075
@@ -3365,7 +3387,9 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
3365 return FAILED; 3387 return FAILED;
3366 } 3388 }
3367 pnode = rdata->pnode; 3389 pnode = rdata->pnode;
3368 fc_block_scsi_eh(cmnd); 3390 status = fc_block_scsi_eh(cmnd);
3391 if (status)
3392 return status;
3369 3393
3370 status = lpfc_chk_tgt_mapped(vport, cmnd); 3394 status = lpfc_chk_tgt_mapped(vport, cmnd);
3371 if (status == FAILED) { 3395 if (status == FAILED) {
@@ -3430,7 +3454,9 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd)
3430 return FAILED; 3454 return FAILED;
3431 } 3455 }
3432 pnode = rdata->pnode; 3456 pnode = rdata->pnode;
3433 fc_block_scsi_eh(cmnd); 3457 status = fc_block_scsi_eh(cmnd);
3458 if (status)
3459 return status;
3434 3460
3435 status = lpfc_chk_tgt_mapped(vport, cmnd); 3461 status = lpfc_chk_tgt_mapped(vport, cmnd);
3436 if (status == FAILED) { 3462 if (status == FAILED) {
@@ -3496,7 +3522,9 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd)
3496 fc_host_post_vendor_event(shost, fc_get_event_number(), 3522 fc_host_post_vendor_event(shost, fc_get_event_number(),
3497 sizeof(scsi_event), (char *)&scsi_event, LPFC_NL_VENDOR_ID); 3523 sizeof(scsi_event), (char *)&scsi_event, LPFC_NL_VENDOR_ID);
3498 3524
3499 fc_block_scsi_eh(cmnd); 3525 ret = fc_block_scsi_eh(cmnd);
3526 if (ret)
3527 return ret;
3500 3528
3501 /* 3529 /*
3502 * Since the driver manages a single bus device, reset all 3530 * Since the driver manages a single bus device, reset all