aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mid.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index f53179c46423..785c61279e6e 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -69,9 +69,10 @@ static scsi_qla_host_t *
69qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name) 69qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name)
70{ 70{
71 scsi_qla_host_t *vha; 71 scsi_qla_host_t *vha;
72 struct scsi_qla_host *tvha;
72 73
73 /* Locate matching device in database. */ 74 /* Locate matching device in database. */
74 list_for_each_entry(vha, &ha->vp_list, list) { 75 list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
75 if (!memcmp(port_name, vha->port_name, WWN_SIZE)) 76 if (!memcmp(port_name, vha->port_name, WWN_SIZE))
76 return vha; 77 return vha;
77 } 78 }
@@ -194,11 +195,11 @@ qla24xx_configure_vp(scsi_qla_host_t *vha)
194void 195void
195qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb) 196qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb)
196{ 197{
197 scsi_qla_host_t *vha; 198 scsi_qla_host_t *vha, *tvha;
198 struct qla_hw_data *ha = rsp->hw; 199 struct qla_hw_data *ha = rsp->hw;
199 int i = 0; 200 int i = 0;
200 201
201 list_for_each_entry(vha, &ha->vp_list, list) { 202 list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
202 if (vha->vp_idx) { 203 if (vha->vp_idx) {
203 switch (mb[0]) { 204 switch (mb[0]) {
204 case MBA_LIP_OCCURRED: 205 case MBA_LIP_OCCURRED:
@@ -300,6 +301,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
300 int ret; 301 int ret;
301 struct qla_hw_data *ha = vha->hw; 302 struct qla_hw_data *ha = vha->hw;
302 scsi_qla_host_t *vp; 303 scsi_qla_host_t *vp;
304 struct scsi_qla_host *tvp;
303 305
304 if (vha->vp_idx) 306 if (vha->vp_idx)
305 return; 307 return;
@@ -308,7 +310,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
308 310
309 clear_bit(VP_DPC_NEEDED, &vha->dpc_flags); 311 clear_bit(VP_DPC_NEEDED, &vha->dpc_flags);
310 312
311 list_for_each_entry(vp, &ha->vp_list, list) { 313 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
312 if (vp->vp_idx) 314 if (vp->vp_idx)
313 ret = qla2x00_do_dpc_vp(vp); 315 ret = qla2x00_do_dpc_vp(vp);
314 } 316 }
@@ -396,7 +398,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
396 398
397 qla2x00_start_timer(vha, qla2x00_timer, WATCH_INTERVAL); 399 qla2x00_start_timer(vha, qla2x00_timer, WATCH_INTERVAL);
398 400
399 memset(vha->req_ques, 0, sizeof(vha->req_ques) * QLA_MAX_HOST_QUES); 401 memset(vha->req_ques, 0, sizeof(vha->req_ques));
400 vha->req_ques[0] = ha->req_q_map[0]->id; 402 vha->req_ques[0] = ha->req_q_map[0]->id;
401 host->can_queue = ha->req_q_map[0]->length + 128; 403 host->can_queue = ha->req_q_map[0]->length + 128;
402 host->this_id = 255; 404 host->this_id = 255;
@@ -471,7 +473,7 @@ qla25xx_delete_req_que(struct scsi_qla_host *vha, struct req_que *req)
471 473
472 if (req) { 474 if (req) {
473 req->options |= BIT_0; 475 req->options |= BIT_0;
474 ret = qla25xx_init_req_que(vha, req, req->options); 476 ret = qla25xx_init_req_que(vha, req);
475 } 477 }
476 if (ret == QLA_SUCCESS) 478 if (ret == QLA_SUCCESS)
477 qla25xx_free_req_que(vha, req); 479 qla25xx_free_req_que(vha, req);
@@ -486,7 +488,7 @@ qla25xx_delete_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp)
486 488
487 if (rsp) { 489 if (rsp) {
488 rsp->options |= BIT_0; 490 rsp->options |= BIT_0;
489 ret = qla25xx_init_rsp_que(vha, rsp, rsp->options); 491 ret = qla25xx_init_rsp_que(vha, rsp);
490 } 492 }
491 if (ret == QLA_SUCCESS) 493 if (ret == QLA_SUCCESS)
492 qla25xx_free_rsp_que(vha, rsp); 494 qla25xx_free_rsp_que(vha, rsp);
@@ -502,7 +504,7 @@ int qla25xx_update_req_que(struct scsi_qla_host *vha, uint8_t que, uint8_t qos)
502 504
503 req->options |= BIT_3; 505 req->options |= BIT_3;
504 req->qos = qos; 506 req->qos = qos;
505 ret = qla25xx_init_req_que(vha, req, req->options); 507 ret = qla25xx_init_req_que(vha, req);
506 if (ret != QLA_SUCCESS) 508 if (ret != QLA_SUCCESS)
507 DEBUG2_17(printk(KERN_WARNING "%s failed\n", __func__)); 509 DEBUG2_17(printk(KERN_WARNING "%s failed\n", __func__));
508 /* restore options bit */ 510 /* restore options bit */
@@ -632,7 +634,7 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options,
632 req->max_q_depth = ha->req_q_map[0]->max_q_depth; 634 req->max_q_depth = ha->req_q_map[0]->max_q_depth;
633 mutex_unlock(&ha->vport_lock); 635 mutex_unlock(&ha->vport_lock);
634 636
635 ret = qla25xx_init_req_que(base_vha, req, options); 637 ret = qla25xx_init_req_que(base_vha, req);
636 if (ret != QLA_SUCCESS) { 638 if (ret != QLA_SUCCESS) {
637 qla_printk(KERN_WARNING, ha, "%s failed\n", __func__); 639 qla_printk(KERN_WARNING, ha, "%s failed\n", __func__);
638 mutex_lock(&ha->vport_lock); 640 mutex_lock(&ha->vport_lock);
@@ -710,7 +712,7 @@ qla25xx_create_rsp_que(struct qla_hw_data *ha, uint16_t options,
710 if (ret) 712 if (ret)
711 goto que_failed; 713 goto que_failed;
712 714
713 ret = qla25xx_init_rsp_que(base_vha, rsp, options); 715 ret = qla25xx_init_rsp_que(base_vha, rsp);
714 if (ret != QLA_SUCCESS) { 716 if (ret != QLA_SUCCESS) {
715 qla_printk(KERN_WARNING, ha, "%s failed\n", __func__); 717 qla_printk(KERN_WARNING, ha, "%s failed\n", __func__);
716 mutex_lock(&ha->vport_lock); 718 mutex_lock(&ha->vport_lock);