aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
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
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')
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.c9
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.h1
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c16
-rw-r--r--drivers/scsi/lpfc/lpfc_mbox.c16
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c47
6 files changed, 56 insertions, 35 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 }
diff --git a/drivers/scsi/lpfc/lpfc_bsg.h b/drivers/scsi/lpfc/lpfc_bsg.h
index e89ed22bbb01..2d98689dd693 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.h
+++ b/drivers/scsi/lpfc/lpfc_bsg.h
@@ -91,6 +91,7 @@ struct get_mgmt_rev_reply {
91 struct MgmtRevInfo info; 91 struct MgmtRevInfo info;
92}; 92};
93 93
94#define BSG_MBOX_SIZE 4096 /* mailbox command plus extended data */
94struct dfc_mbox_req { 95struct dfc_mbox_req {
95 uint32_t command; 96 uint32_t command;
96 uint32_t mbOffset; 97 uint32_t mbOffset;
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 9508661fe825..1de60ce6f296 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -5370,7 +5370,7 @@ lpfc_send_els_failure_event(struct lpfc_hba *phba,
5370 sizeof(struct lpfc_name)); 5370 sizeof(struct lpfc_name));
5371 pcmd = (uint32_t *) (((struct lpfc_dmabuf *) 5371 pcmd = (uint32_t *) (((struct lpfc_dmabuf *)
5372 cmdiocbp->context2)->virt); 5372 cmdiocbp->context2)->virt);
5373 lsrjt_event.command = *pcmd; 5373 lsrjt_event.command = (pcmd != NULL) ? *pcmd : 0;
5374 stat.un.lsRjtError = be32_to_cpu(rspiocbp->iocb.un.ulpWord[4]); 5374 stat.un.lsRjtError = be32_to_cpu(rspiocbp->iocb.un.ulpWord[4]);
5375 lsrjt_event.reason_code = stat.un.b.lsRjtRsnCode; 5375 lsrjt_event.reason_code = stat.un.b.lsRjtRsnCode;
5376 lsrjt_event.explanation = stat.un.b.lsRjtRsnCodeExp; 5376 lsrjt_event.explanation = stat.un.b.lsRjtRsnCodeExp;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 8341d44fe87b..03681013d804 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -2600,15 +2600,6 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev)
2600 init_timer(&vport->els_tmofunc); 2600 init_timer(&vport->els_tmofunc);
2601 vport->els_tmofunc.function = lpfc_els_timeout; 2601 vport->els_tmofunc.function = lpfc_els_timeout;
2602 vport->els_tmofunc.data = (unsigned long)vport; 2602 vport->els_tmofunc.data = (unsigned long)vport;
2603 if (phba->pcidev->device == PCI_DEVICE_ID_HORNET) {
2604 phba->menlo_flag |= HBA_MENLO_SUPPORT;
2605 /* check for menlo minimum sg count */
2606 if (phba->cfg_sg_seg_cnt < LPFC_DEFAULT_MENLO_SG_SEG_CNT) {
2607 phba->cfg_sg_seg_cnt = LPFC_DEFAULT_MENLO_SG_SEG_CNT;
2608 shost->sg_tablesize = phba->cfg_sg_seg_cnt;
2609 }
2610 }
2611
2612 error = scsi_add_host_with_dma(shost, dev, &phba->pcidev->dev); 2603 error = scsi_add_host_with_dma(shost, dev, &phba->pcidev->dev);
2613 if (error) 2604 if (error)
2614 goto out_put_shost; 2605 goto out_put_shost;
@@ -3852,6 +3843,13 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba)
3852 3843
3853 /* Get all the module params for configuring this host */ 3844 /* Get all the module params for configuring this host */
3854 lpfc_get_cfgparam(phba); 3845 lpfc_get_cfgparam(phba);
3846 if (phba->pcidev->device == PCI_DEVICE_ID_HORNET) {
3847 phba->menlo_flag |= HBA_MENLO_SUPPORT;
3848 /* check for menlo minimum sg count */
3849 if (phba->cfg_sg_seg_cnt < LPFC_DEFAULT_MENLO_SG_SEG_CNT)
3850 phba->cfg_sg_seg_cnt = LPFC_DEFAULT_MENLO_SG_SEG_CNT;
3851 }
3852
3855 /* 3853 /*
3856 * Since the sg_tablesize is module parameter, the sg_dma_buf_size 3854 * Since the sg_tablesize is module parameter, the sg_dma_buf_size
3857 * used to create the sg_dma_buf_pool must be dynamically calculated. 3855 * used to create the sg_dma_buf_pool must be dynamically calculated.
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index f9b056ec6186..e84dc33ca201 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -1611,7 +1611,7 @@ lpfc_sli4_mbox_cmd_free(struct lpfc_hba *phba, struct lpfcMboxq *mbox)
1611 for (sgentry = 0; sgentry < sgecount; sgentry++) { 1611 for (sgentry = 0; sgentry < sgecount; sgentry++) {
1612 lpfc_sli4_mbx_sge_get(mbox, sgentry, &sge); 1612 lpfc_sli4_mbx_sge_get(mbox, sgentry, &sge);
1613 phyaddr = getPaddr(sge.pa_hi, sge.pa_lo); 1613 phyaddr = getPaddr(sge.pa_hi, sge.pa_lo);
1614 dma_free_coherent(&phba->pcidev->dev, PAGE_SIZE, 1614 dma_free_coherent(&phba->pcidev->dev, SLI4_PAGE_SIZE,
1615 mbox->sge_array->addr[sgentry], phyaddr); 1615 mbox->sge_array->addr[sgentry], phyaddr);
1616 } 1616 }
1617 /* Free the sge address array memory */ 1617 /* Free the sge address array memory */
@@ -1669,7 +1669,7 @@ lpfc_sli4_config(struct lpfc_hba *phba, struct lpfcMboxq *mbox,
1669 } 1669 }
1670 1670
1671 /* Setup for the none-embedded mbox command */ 1671 /* Setup for the none-embedded mbox command */
1672 pcount = (PAGE_ALIGN(length))/PAGE_SIZE; 1672 pcount = (PAGE_ALIGN(length))/SLI4_PAGE_SIZE;
1673 pcount = (pcount > LPFC_SLI4_MBX_SGE_MAX_PAGES) ? 1673 pcount = (pcount > LPFC_SLI4_MBX_SGE_MAX_PAGES) ?
1674 LPFC_SLI4_MBX_SGE_MAX_PAGES : pcount; 1674 LPFC_SLI4_MBX_SGE_MAX_PAGES : pcount;
1675 /* Allocate record for keeping SGE virtual addresses */ 1675 /* Allocate record for keeping SGE virtual addresses */
@@ -1684,24 +1684,24 @@ lpfc_sli4_config(struct lpfc_hba *phba, struct lpfcMboxq *mbox,
1684 for (pagen = 0, alloc_len = 0; pagen < pcount; pagen++) { 1684 for (pagen = 0, alloc_len = 0; pagen < pcount; pagen++) {
1685 /* The DMA memory is always allocated in the length of a 1685 /* The DMA memory is always allocated in the length of a
1686 * page even though the last SGE might not fill up to a 1686 * page even though the last SGE might not fill up to a
1687 * page, this is used as a priori size of PAGE_SIZE for 1687 * page, this is used as a priori size of SLI4_PAGE_SIZE for
1688 * the later DMA memory free. 1688 * the later DMA memory free.
1689 */ 1689 */
1690 viraddr = dma_alloc_coherent(&phba->pcidev->dev, PAGE_SIZE, 1690 viraddr = dma_alloc_coherent(&phba->pcidev->dev, SLI4_PAGE_SIZE,
1691 &phyaddr, GFP_KERNEL); 1691 &phyaddr, GFP_KERNEL);
1692 /* In case of malloc fails, proceed with whatever we have */ 1692 /* In case of malloc fails, proceed with whatever we have */
1693 if (!viraddr) 1693 if (!viraddr)
1694 break; 1694 break;
1695 memset(viraddr, 0, PAGE_SIZE); 1695 memset(viraddr, 0, SLI4_PAGE_SIZE);
1696 mbox->sge_array->addr[pagen] = viraddr; 1696 mbox->sge_array->addr[pagen] = viraddr;
1697 /* Keep the first page for later sub-header construction */ 1697 /* Keep the first page for later sub-header construction */
1698 if (pagen == 0) 1698 if (pagen == 0)
1699 cfg_shdr = (union lpfc_sli4_cfg_shdr *)viraddr; 1699 cfg_shdr = (union lpfc_sli4_cfg_shdr *)viraddr;
1700 resid_len = length - alloc_len; 1700 resid_len = length - alloc_len;
1701 if (resid_len > PAGE_SIZE) { 1701 if (resid_len > SLI4_PAGE_SIZE) {
1702 lpfc_sli4_mbx_sge_set(mbox, pagen, phyaddr, 1702 lpfc_sli4_mbx_sge_set(mbox, pagen, phyaddr,
1703 PAGE_SIZE); 1703 SLI4_PAGE_SIZE);
1704 alloc_len += PAGE_SIZE; 1704 alloc_len += SLI4_PAGE_SIZE;
1705 } else { 1705 } else {
1706 lpfc_sli4_mbx_sge_set(mbox, pagen, phyaddr, 1706 lpfc_sli4_mbx_sge_set(mbox, pagen, phyaddr,
1707 resid_len); 1707 resid_len);
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 2c88999b7095..73259bca1d14 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -4296,7 +4296,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
4296 "2570 Failed to read FCoE parameters\n"); 4296 "2570 Failed to read FCoE parameters\n");
4297 4297
4298 /* Issue READ_REV to collect vpd and FW information. */ 4298 /* Issue READ_REV to collect vpd and FW information. */
4299 vpd_size = PAGE_SIZE; 4299 vpd_size = SLI4_PAGE_SIZE;
4300 vpd = kzalloc(vpd_size, GFP_KERNEL); 4300 vpd = kzalloc(vpd_size, GFP_KERNEL);
4301 if (!vpd) { 4301 if (!vpd) {
4302 rc = -ENOMEM; 4302 rc = -ENOMEM;
@@ -7136,13 +7136,11 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
7136 */ 7136 */
7137 list_del_init(&abort_iocb->list); 7137 list_del_init(&abort_iocb->list);
7138 pring->txcmplq_cnt--; 7138 pring->txcmplq_cnt--;
7139 spin_unlock_irq(&phba->hbalock);
7140 7139
7141 /* Firmware could still be in progress of DMAing 7140 /* Firmware could still be in progress of DMAing
7142 * payload, so don't free data buffer till after 7141 * payload, so don't free data buffer till after
7143 * a hbeat. 7142 * a hbeat.
7144 */ 7143 */
7145 spin_lock_irq(&phba->hbalock);
7146 abort_iocb->iocb_flag |= LPFC_DELAY_MEM_FREE; 7144 abort_iocb->iocb_flag |= LPFC_DELAY_MEM_FREE;
7147 abort_iocb->iocb_flag &= ~LPFC_DRIVER_ABORTED; 7145 abort_iocb->iocb_flag &= ~LPFC_DRIVER_ABORTED;
7148 spin_unlock_irq(&phba->hbalock); 7146 spin_unlock_irq(&phba->hbalock);
@@ -7150,7 +7148,8 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
7150 abort_iocb->iocb.ulpStatus = IOSTAT_LOCAL_REJECT; 7148 abort_iocb->iocb.ulpStatus = IOSTAT_LOCAL_REJECT;
7151 abort_iocb->iocb.un.ulpWord[4] = IOERR_ABORT_REQUESTED; 7149 abort_iocb->iocb.un.ulpWord[4] = IOERR_ABORT_REQUESTED;
7152 (abort_iocb->iocb_cmpl)(phba, abort_iocb, abort_iocb); 7150 (abort_iocb->iocb_cmpl)(phba, abort_iocb, abort_iocb);
7153 } 7151 } else
7152 spin_unlock_irq(&phba->hbalock);
7154 } 7153 }
7155 7154
7156 lpfc_sli_release_iocbq(phba, cmdiocb); 7155 lpfc_sli_release_iocbq(phba, cmdiocb);
@@ -9544,7 +9543,7 @@ lpfc_sli4_queue_free(struct lpfc_queue *queue)
9544 while (!list_empty(&queue->page_list)) { 9543 while (!list_empty(&queue->page_list)) {
9545 list_remove_head(&queue->page_list, dmabuf, struct lpfc_dmabuf, 9544 list_remove_head(&queue->page_list, dmabuf, struct lpfc_dmabuf,
9546 list); 9545 list);
9547 dma_free_coherent(&queue->phba->pcidev->dev, PAGE_SIZE, 9546 dma_free_coherent(&queue->phba->pcidev->dev, SLI4_PAGE_SIZE,
9548 dmabuf->virt, dmabuf->phys); 9547 dmabuf->virt, dmabuf->phys);
9549 kfree(dmabuf); 9548 kfree(dmabuf);
9550 } 9549 }
@@ -9572,7 +9571,6 @@ lpfc_sli4_queue_alloc(struct lpfc_hba *phba, uint32_t entry_size,
9572 void *dma_pointer; 9571 void *dma_pointer;
9573 uint32_t hw_page_size = phba->sli4_hba.pc_sli4_params.if_page_sz; 9572 uint32_t hw_page_size = phba->sli4_hba.pc_sli4_params.if_page_sz;
9574 9573
9575
9576 if (!phba->sli4_hba.pc_sli4_params.supported) 9574 if (!phba->sli4_hba.pc_sli4_params.supported)
9577 hw_page_size = SLI4_PAGE_SIZE; 9575 hw_page_size = SLI4_PAGE_SIZE;
9578 9576
@@ -9647,6 +9645,10 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint16_t imax)
9647 uint32_t shdr_status, shdr_add_status; 9645 uint32_t shdr_status, shdr_add_status;
9648 union lpfc_sli4_cfg_shdr *shdr; 9646 union lpfc_sli4_cfg_shdr *shdr;
9649 uint16_t dmult; 9647 uint16_t dmult;
9648 uint32_t hw_page_size = phba->sli4_hba.pc_sli4_params.if_page_sz;
9649
9650 if (!phba->sli4_hba.pc_sli4_params.supported)
9651 hw_page_size = SLI4_PAGE_SIZE;
9650 9652
9651 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 9653 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
9652 if (!mbox) 9654 if (!mbox)
@@ -9696,6 +9698,7 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint16_t imax)
9696 break; 9698 break;
9697 } 9699 }
9698 list_for_each_entry(dmabuf, &eq->page_list, list) { 9700 list_for_each_entry(dmabuf, &eq->page_list, list) {
9701 memset(dmabuf->virt, 0, hw_page_size);
9699 eq_create->u.request.page[dmabuf->buffer_tag].addr_lo = 9702 eq_create->u.request.page[dmabuf->buffer_tag].addr_lo =
9700 putPaddrLow(dmabuf->phys); 9703 putPaddrLow(dmabuf->phys);
9701 eq_create->u.request.page[dmabuf->buffer_tag].addr_hi = 9704 eq_create->u.request.page[dmabuf->buffer_tag].addr_hi =
@@ -9758,6 +9761,11 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq,
9758 int rc, length, status = 0; 9761 int rc, length, status = 0;
9759 uint32_t shdr_status, shdr_add_status; 9762 uint32_t shdr_status, shdr_add_status;
9760 union lpfc_sli4_cfg_shdr *shdr; 9763 union lpfc_sli4_cfg_shdr *shdr;
9764 uint32_t hw_page_size = phba->sli4_hba.pc_sli4_params.if_page_sz;
9765
9766 if (!phba->sli4_hba.pc_sli4_params.supported)
9767 hw_page_size = SLI4_PAGE_SIZE;
9768
9761 9769
9762 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 9770 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
9763 if (!mbox) 9771 if (!mbox)
@@ -9795,6 +9803,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq,
9795 break; 9803 break;
9796 } 9804 }
9797 list_for_each_entry(dmabuf, &cq->page_list, list) { 9805 list_for_each_entry(dmabuf, &cq->page_list, list) {
9806 memset(dmabuf->virt, 0, hw_page_size);
9798 cq_create->u.request.page[dmabuf->buffer_tag].addr_lo = 9807 cq_create->u.request.page[dmabuf->buffer_tag].addr_lo =
9799 putPaddrLow(dmabuf->phys); 9808 putPaddrLow(dmabuf->phys);
9800 cq_create->u.request.page[dmabuf->buffer_tag].addr_hi = 9809 cq_create->u.request.page[dmabuf->buffer_tag].addr_hi =
@@ -9924,7 +9933,10 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq,
9924 int rc, length, status = 0; 9933 int rc, length, status = 0;
9925 uint32_t shdr_status, shdr_add_status; 9934 uint32_t shdr_status, shdr_add_status;
9926 union lpfc_sli4_cfg_shdr *shdr; 9935 union lpfc_sli4_cfg_shdr *shdr;
9936 uint32_t hw_page_size = phba->sli4_hba.pc_sli4_params.if_page_sz;
9927 9937
9938 if (!phba->sli4_hba.pc_sli4_params.supported)
9939 hw_page_size = SLI4_PAGE_SIZE;
9928 9940
9929 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 9941 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
9930 if (!mbox) 9942 if (!mbox)
@@ -9973,6 +9985,7 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq,
9973 break; 9985 break;
9974 } 9986 }
9975 list_for_each_entry(dmabuf, &mq->page_list, list) { 9987 list_for_each_entry(dmabuf, &mq->page_list, list) {
9988 memset(dmabuf->virt, 0, hw_page_size);
9976 mq_create_ext->u.request.page[dmabuf->buffer_tag].addr_lo = 9989 mq_create_ext->u.request.page[dmabuf->buffer_tag].addr_lo =
9977 putPaddrLow(dmabuf->phys); 9990 putPaddrLow(dmabuf->phys);
9978 mq_create_ext->u.request.page[dmabuf->buffer_tag].addr_hi = 9991 mq_create_ext->u.request.page[dmabuf->buffer_tag].addr_hi =
@@ -10054,6 +10067,10 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq,
10054 int rc, length, status = 0; 10067 int rc, length, status = 0;
10055 uint32_t shdr_status, shdr_add_status; 10068 uint32_t shdr_status, shdr_add_status;
10056 union lpfc_sli4_cfg_shdr *shdr; 10069 union lpfc_sli4_cfg_shdr *shdr;
10070 uint32_t hw_page_size = phba->sli4_hba.pc_sli4_params.if_page_sz;
10071
10072 if (!phba->sli4_hba.pc_sli4_params.supported)
10073 hw_page_size = SLI4_PAGE_SIZE;
10057 10074
10058 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 10075 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
10059 if (!mbox) 10076 if (!mbox)
@@ -10069,6 +10086,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq,
10069 bf_set(lpfc_mbx_wq_create_cq_id, &wq_create->u.request, 10086 bf_set(lpfc_mbx_wq_create_cq_id, &wq_create->u.request,
10070 cq->queue_id); 10087 cq->queue_id);
10071 list_for_each_entry(dmabuf, &wq->page_list, list) { 10088 list_for_each_entry(dmabuf, &wq->page_list, list) {
10089 memset(dmabuf->virt, 0, hw_page_size);
10072 wq_create->u.request.page[dmabuf->buffer_tag].addr_lo = 10090 wq_create->u.request.page[dmabuf->buffer_tag].addr_lo =
10073 putPaddrLow(dmabuf->phys); 10091 putPaddrLow(dmabuf->phys);
10074 wq_create->u.request.page[dmabuf->buffer_tag].addr_hi = 10092 wq_create->u.request.page[dmabuf->buffer_tag].addr_hi =
@@ -10137,6 +10155,10 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq,
10137 int rc, length, status = 0; 10155 int rc, length, status = 0;
10138 uint32_t shdr_status, shdr_add_status; 10156 uint32_t shdr_status, shdr_add_status;
10139 union lpfc_sli4_cfg_shdr *shdr; 10157 union lpfc_sli4_cfg_shdr *shdr;
10158 uint32_t hw_page_size = phba->sli4_hba.pc_sli4_params.if_page_sz;
10159
10160 if (!phba->sli4_hba.pc_sli4_params.supported)
10161 hw_page_size = SLI4_PAGE_SIZE;
10140 10162
10141 if (hrq->entry_count != drq->entry_count) 10163 if (hrq->entry_count != drq->entry_count)
10142 return -EINVAL; 10164 return -EINVAL;
@@ -10181,6 +10203,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq,
10181 bf_set(lpfc_rq_context_buf_size, &rq_create->u.request.context, 10203 bf_set(lpfc_rq_context_buf_size, &rq_create->u.request.context,
10182 LPFC_HDR_BUF_SIZE); 10204 LPFC_HDR_BUF_SIZE);
10183 list_for_each_entry(dmabuf, &hrq->page_list, list) { 10205 list_for_each_entry(dmabuf, &hrq->page_list, list) {
10206 memset(dmabuf->virt, 0, hw_page_size);
10184 rq_create->u.request.page[dmabuf->buffer_tag].addr_lo = 10207 rq_create->u.request.page[dmabuf->buffer_tag].addr_lo =
10185 putPaddrLow(dmabuf->phys); 10208 putPaddrLow(dmabuf->phys);
10186 rq_create->u.request.page[dmabuf->buffer_tag].addr_hi = 10209 rq_create->u.request.page[dmabuf->buffer_tag].addr_hi =
@@ -10753,7 +10776,7 @@ lpfc_sli4_post_sgl_list(struct lpfc_hba *phba)
10753 10776
10754 reqlen = els_xri_cnt * sizeof(struct sgl_page_pairs) + 10777 reqlen = els_xri_cnt * sizeof(struct sgl_page_pairs) +
10755 sizeof(union lpfc_sli4_cfg_shdr) + sizeof(uint32_t); 10778 sizeof(union lpfc_sli4_cfg_shdr) + sizeof(uint32_t);
10756 if (reqlen > PAGE_SIZE) { 10779 if (reqlen > SLI4_PAGE_SIZE) {
10757 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, 10780 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
10758 "2559 Block sgl registration required DMA " 10781 "2559 Block sgl registration required DMA "
10759 "size (%d) great than a page\n", reqlen); 10782 "size (%d) great than a page\n", reqlen);
@@ -10859,7 +10882,7 @@ lpfc_sli4_post_scsi_sgl_block(struct lpfc_hba *phba, struct list_head *sblist,
10859 /* Calculate the requested length of the dma memory */ 10882 /* Calculate the requested length of the dma memory */
10860 reqlen = cnt * sizeof(struct sgl_page_pairs) + 10883 reqlen = cnt * sizeof(struct sgl_page_pairs) +
10861 sizeof(union lpfc_sli4_cfg_shdr) + sizeof(uint32_t); 10884 sizeof(union lpfc_sli4_cfg_shdr) + sizeof(uint32_t);
10862 if (reqlen > PAGE_SIZE) { 10885 if (reqlen > SLI4_PAGE_SIZE) {
10863 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, 10886 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
10864 "0217 Block sgl registration required DMA " 10887 "0217 Block sgl registration required DMA "
10865 "size (%d) great than a page\n", reqlen); 10888 "size (%d) great than a page\n", reqlen);
@@ -11695,8 +11718,8 @@ lpfc_sli4_handle_received_buffer(struct lpfc_hba *phba,
11695 * 11718 *
11696 * This routine is invoked to post rpi header templates to the 11719 * This routine is invoked to post rpi header templates to the
11697 * HBA consistent with the SLI-4 interface spec. This routine 11720 * HBA consistent with the SLI-4 interface spec. This routine
11698 * posts a PAGE_SIZE memory region to the port to hold up to 11721 * posts a SLI4_PAGE_SIZE memory region to the port to hold up to
11699 * PAGE_SIZE modulo 64 rpi context headers. 11722 * SLI4_PAGE_SIZE modulo 64 rpi context headers.
11700 * 11723 *
11701 * This routine does not require any locks. It's usage is expected 11724 * This routine does not require any locks. It's usage is expected
11702 * to be driver load or reset recovery when the driver is 11725 * to be driver load or reset recovery when the driver is
@@ -11799,8 +11822,8 @@ lpfc_sli4_post_rpi_hdr(struct lpfc_hba *phba, struct lpfc_rpi_hdr *rpi_page)
11799 * 11822 *
11800 * This routine is invoked to post rpi header templates to the 11823 * This routine is invoked to post rpi header templates to the
11801 * HBA consistent with the SLI-4 interface spec. This routine 11824 * HBA consistent with the SLI-4 interface spec. This routine
11802 * posts a PAGE_SIZE memory region to the port to hold up to 11825 * posts a SLI4_PAGE_SIZE memory region to the port to hold up to
11803 * PAGE_SIZE modulo 64 rpi context headers. 11826 * SLI4_PAGE_SIZE modulo 64 rpi context headers.
11804 * 11827 *
11805 * Returns 11828 * Returns
11806 * A nonzero rpi defined as rpi_base <= rpi < max_rpi if successful 11829 * A nonzero rpi defined as rpi_base <= rpi < max_rpi if successful