From 49198b371e2da20548d1408a7d3a8dea2f91263c Mon Sep 17 00:00:00 2001 From: James Smart Date: Tue, 6 Apr 2010 15:04:33 -0400 Subject: [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 Signed-off-by: James Smart Signed-off-by: James Bottomley --- drivers/scsi/lpfc/lpfc_bsg.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/scsi/lpfc/lpfc_bsg.c') 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, goto job_done; } - mb = kzalloc(PAGE_SIZE, GFP_KERNEL); + mb = kzalloc(BSG_MBOX_SIZE, GFP_KERNEL); if (!mb) { rc = -ENOMEM; goto job_done; @@ -2665,13 +2665,12 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job, rxbmp->virt = lpfc_mbuf_alloc(phba, 0, &rxbmp->phys); INIT_LIST_HEAD(&rxbmp->list); rxbpl = (struct ulp_bde64 *) rxbmp->virt; - dmp = diag_cmd_data_alloc(phba, rxbpl, PAGE_SIZE, 0); + dmp = diag_cmd_data_alloc(phba, rxbpl, BSG_MBOX_SIZE, 0); if (!dmp) { rc = -ENOMEM; goto job_done; } - dmp->size = PAGE_SIZE; INIT_LIST_HEAD(&dmp->dma.list); pmb->un.varBIUdiag.un.s2.xmit_bde64.addrHigh = putPaddrHigh(dmp->dma.phys); @@ -2774,12 +2773,12 @@ lpfc_bsg_mbox_cmd(struct fc_bsg_job *job) goto job_error; } - if (job->request_payload.payload_len != PAGE_SIZE) { + if (job->request_payload.payload_len != BSG_MBOX_SIZE) { rc = -EINVAL; goto job_error; } - if (job->reply_payload.payload_len != PAGE_SIZE) { + if (job->reply_payload.payload_len != BSG_MBOX_SIZE) { rc = -EINVAL; goto job_error; } -- cgit v1.2.3