aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2012-09-29 11:28:52 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-10-08 06:47:32 -0400
commitee02006b5336db1a259f34c3a390be43b32063b7 (patch)
tree887ef7921b504413c6044ee953d88733aeb30777 /drivers/scsi
parent33cb82dc8c38d451b5220611102dccda16431be5 (diff)
[SCSI] lpfc 8.3.35: Fix interrupt delay multipler conversion for eq_create
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c15
-rw-r--r--drivers/scsi/lpfc/lpfc_sli4.h2
2 files changed, 12 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 219bf534ef99..f0e5aea80810 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -12099,6 +12099,7 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq)
12099 struct lpfc_queue *eq; 12099 struct lpfc_queue *eq;
12100 int cnt, rc, length, status = 0; 12100 int cnt, rc, length, status = 0;
12101 uint32_t shdr_status, shdr_add_status; 12101 uint32_t shdr_status, shdr_add_status;
12102 uint32_t result;
12102 int fcp_eqidx; 12103 int fcp_eqidx;
12103 union lpfc_sli4_cfg_shdr *shdr; 12104 union lpfc_sli4_cfg_shdr *shdr;
12104 uint16_t dmult; 12105 uint16_t dmult;
@@ -12117,8 +12118,11 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq)
12117 eq_delay = &mbox->u.mqe.un.eq_delay; 12118 eq_delay = &mbox->u.mqe.un.eq_delay;
12118 12119
12119 /* Calculate delay multiper from maximum interrupt per second */ 12120 /* Calculate delay multiper from maximum interrupt per second */
12120 dmult = phba->cfg_fcp_imax / phba->cfg_fcp_io_channel; 12121 result = phba->cfg_fcp_imax / phba->cfg_fcp_io_channel;
12121 dmult = LPFC_DMULT_CONST/dmult - 1; 12122 if (result > LPFC_DMULT_CONST)
12123 dmult = 0;
12124 else
12125 dmult = LPFC_DMULT_CONST/result - 1;
12122 12126
12123 cnt = 0; 12127 cnt = 0;
12124 for (fcp_eqidx = startq; fcp_eqidx < phba->cfg_fcp_io_channel; 12128 for (fcp_eqidx = startq; fcp_eqidx < phba->cfg_fcp_io_channel;
@@ -12174,7 +12178,7 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq)
12174 * fails this function will return -ENXIO. 12178 * fails this function will return -ENXIO.
12175 **/ 12179 **/
12176uint32_t 12180uint32_t
12177lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint16_t imax) 12181lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax)
12178{ 12182{
12179 struct lpfc_mbx_eq_create *eq_create; 12183 struct lpfc_mbx_eq_create *eq_create;
12180 LPFC_MBOXQ_t *mbox; 12184 LPFC_MBOXQ_t *mbox;
@@ -12206,7 +12210,10 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint16_t imax)
12206 LPFC_EQE_SIZE); 12210 LPFC_EQE_SIZE);
12207 bf_set(lpfc_eq_context_valid, &eq_create->u.request.context, 1); 12211 bf_set(lpfc_eq_context_valid, &eq_create->u.request.context, 1);
12208 /* Calculate delay multiper from maximum interrupt per second */ 12212 /* Calculate delay multiper from maximum interrupt per second */
12209 dmult = LPFC_DMULT_CONST/imax - 1; 12213 if (imax > LPFC_DMULT_CONST)
12214 dmult = 0;
12215 else
12216 dmult = LPFC_DMULT_CONST/imax - 1;
12210 bf_set(lpfc_eq_context_delay_multi, &eq_create->u.request.context, 12217 bf_set(lpfc_eq_context_delay_multi, &eq_create->u.request.context,
12211 dmult); 12218 dmult);
12212 switch (eq->entry_count) { 12219 switch (eq->entry_count) {
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h
index bd4bc4342ae2..61ff9aac918d 100644
--- a/drivers/scsi/lpfc/lpfc_sli4.h
+++ b/drivers/scsi/lpfc/lpfc_sli4.h
@@ -626,7 +626,7 @@ void lpfc_sli4_hba_reset(struct lpfc_hba *);
626struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t, 626struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t,
627 uint32_t); 627 uint32_t);
628void lpfc_sli4_queue_free(struct lpfc_queue *); 628void lpfc_sli4_queue_free(struct lpfc_queue *);
629uint32_t lpfc_eq_create(struct lpfc_hba *, struct lpfc_queue *, uint16_t); 629uint32_t lpfc_eq_create(struct lpfc_hba *, struct lpfc_queue *, uint32_t);
630uint32_t lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint16_t); 630uint32_t lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint16_t);
631uint32_t lpfc_cq_create(struct lpfc_hba *, struct lpfc_queue *, 631uint32_t lpfc_cq_create(struct lpfc_hba *, struct lpfc_queue *,
632 struct lpfc_queue *, uint32_t, uint32_t); 632 struct lpfc_queue *, uint32_t, uint32_t);