aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_bsg.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2010-04-06 15:04:33 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 14:45:24 -0400
commit49198b371e2da20548d1408a7d3a8dea2f91263c (patch)
treeb04993f74b2798bbf9e18f952ec6d1fd18cb0db6 /drivers/scsi/lpfc/lpfc_bsg.c
parent6c8eea54ec62c1a3fdb21de583639c49dcdc8811 (diff)
[SCSI] lpfc 8.3.12: Critical fixes
- Move the code to increase the sg seg count for LP21000 adapters. - Check pcmd on command completion before dereferencing it. - Clear queue memory when creating firmware queues to prevent stale entries. - Replace the use of PAGE_SIZE in many areas that assumed it was always 4k. - Add an else clause to a conditional that needed to unlock the hba_lock. 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_bsg.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index 92ad202a9380..141a1ce9b742 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -2591,7 +2591,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job,
2591 goto job_done; 2591 goto job_done;
2592 } 2592 }
2593 2593
2594 mb = kzalloc(PAGE_SIZE, GFP_KERNEL); 2594 mb = kzalloc(BSG_MBOX_SIZE, GFP_KERNEL);
2595 if (!mb) { 2595 if (!mb) {
2596 rc = -ENOMEM; 2596 rc = -ENOMEM;
2597 goto job_done; 2597 goto job_done;
@@ -2665,13 +2665,12 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job,
2665 rxbmp->virt = lpfc_mbuf_alloc(phba, 0, &rxbmp->phys); 2665 rxbmp->virt = lpfc_mbuf_alloc(phba, 0, &rxbmp->phys);
2666 INIT_LIST_HEAD(&rxbmp->list); 2666 INIT_LIST_HEAD(&rxbmp->list);
2667 rxbpl = (struct ulp_bde64 *) rxbmp->virt; 2667 rxbpl = (struct ulp_bde64 *) rxbmp->virt;
2668 dmp = diag_cmd_data_alloc(phba, rxbpl, PAGE_SIZE, 0); 2668 dmp = diag_cmd_data_alloc(phba, rxbpl, BSG_MBOX_SIZE, 0);
2669 if (!dmp) { 2669 if (!dmp) {
2670 rc = -ENOMEM; 2670 rc = -ENOMEM;
2671 goto job_done; 2671 goto job_done;
2672 } 2672 }
2673 2673
2674 dmp->size = PAGE_SIZE;
2675 INIT_LIST_HEAD(&dmp->dma.list); 2674 INIT_LIST_HEAD(&dmp->dma.list);
2676 pmb->un.varBIUdiag.un.s2.xmit_bde64.addrHigh = 2675 pmb->un.varBIUdiag.un.s2.xmit_bde64.addrHigh =
2677 putPaddrHigh(dmp->dma.phys); 2676 putPaddrHigh(dmp->dma.phys);
@@ -2774,12 +2773,12 @@ lpfc_bsg_mbox_cmd(struct fc_bsg_job *job)
2774 goto job_error; 2773 goto job_error;
2775 } 2774 }
2776 2775
2777 if (job->request_payload.payload_len != PAGE_SIZE) { 2776 if (job->request_payload.payload_len != BSG_MBOX_SIZE) {
2778 rc = -EINVAL; 2777 rc = -EINVAL;
2779 goto job_error; 2778 goto job_error;
2780 } 2779 }
2781 2780
2782 if (job->reply_payload.payload_len != PAGE_SIZE) { 2781 if (job->reply_payload.payload_len != BSG_MBOX_SIZE) {
2783 rc = -EINVAL; 2782 rc = -EINVAL;
2784 goto job_error; 2783 goto job_error;
2785 } 2784 }