aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index c987c4fcdadc..648795806a83 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -130,7 +130,7 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
130 130
131 vports = lpfc_create_vport_work_array(phba); 131 vports = lpfc_create_vport_work_array(phba);
132 if (vports != NULL) 132 if (vports != NULL)
133 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) { 133 for(i = 0; i <= phba->max_vpi && vports[i] != NULL; i++) {
134 shost = lpfc_shost_from_vport(vports[i]); 134 shost = lpfc_shost_from_vport(vports[i]);
135 shost_for_each_device(sdev, shost) { 135 shost_for_each_device(sdev, shost) {
136 new_queue_depth = 136 new_queue_depth =
@@ -151,7 +151,7 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
151 new_queue_depth); 151 new_queue_depth);
152 } 152 }
153 } 153 }
154 lpfc_destroy_vport_work_array(vports); 154 lpfc_destroy_vport_work_array(phba, vports);
155 atomic_set(&phba->num_rsrc_err, 0); 155 atomic_set(&phba->num_rsrc_err, 0);
156 atomic_set(&phba->num_cmd_success, 0); 156 atomic_set(&phba->num_cmd_success, 0);
157} 157}
@@ -166,7 +166,7 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba)
166 166
167 vports = lpfc_create_vport_work_array(phba); 167 vports = lpfc_create_vport_work_array(phba);
168 if (vports != NULL) 168 if (vports != NULL)
169 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) { 169 for(i = 0; i <= phba->max_vpi && vports[i] != NULL; i++) {
170 shost = lpfc_shost_from_vport(vports[i]); 170 shost = lpfc_shost_from_vport(vports[i]);
171 shost_for_each_device(sdev, shost) { 171 shost_for_each_device(sdev, shost) {
172 if (sdev->ordered_tags) 172 if (sdev->ordered_tags)
@@ -179,7 +179,7 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba)
179 sdev->queue_depth+1); 179 sdev->queue_depth+1);
180 } 180 }
181 } 181 }
182 lpfc_destroy_vport_work_array(vports); 182 lpfc_destroy_vport_work_array(phba, vports);
183 atomic_set(&phba->num_rsrc_err, 0); 183 atomic_set(&phba->num_rsrc_err, 0);
184 atomic_set(&phba->num_cmd_success, 0); 184 atomic_set(&phba->num_cmd_success, 0);
185} 185}
@@ -380,7 +380,7 @@ lpfc_scsi_prep_dma_buf(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
380 (num_bde * sizeof (struct ulp_bde64)); 380 (num_bde * sizeof (struct ulp_bde64));
381 iocb_cmd->ulpBdeCount = 1; 381 iocb_cmd->ulpBdeCount = 1;
382 iocb_cmd->ulpLe = 1; 382 iocb_cmd->ulpLe = 1;
383 fcp_cmnd->fcpDl = be32_to_cpu(scsi_bufflen(scsi_cmnd)); 383 fcp_cmnd->fcpDl = cpu_to_be32(scsi_bufflen(scsi_cmnd));
384 return 0; 384 return 0;
385} 385}
386 386
@@ -763,6 +763,8 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
763 piocbq->iocb.ulpContext = pnode->nlp_rpi; 763 piocbq->iocb.ulpContext = pnode->nlp_rpi;
764 if (pnode->nlp_fcp_info & NLP_FCP_2_DEVICE) 764 if (pnode->nlp_fcp_info & NLP_FCP_2_DEVICE)
765 piocbq->iocb.ulpFCP2Rcvy = 1; 765 piocbq->iocb.ulpFCP2Rcvy = 1;
766 else
767 piocbq->iocb.ulpFCP2Rcvy = 0;
766 768
767 piocbq->iocb.ulpClass = (pnode->nlp_fcp_info & 0x0f); 769 piocbq->iocb.ulpClass = (pnode->nlp_fcp_info & 0x0f);
768 piocbq->context1 = lpfc_cmd; 770 piocbq->context1 = lpfc_cmd;