aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index f6368a1d3021..87f9abc71460 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1226,9 +1226,8 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
1226 icb->firmware_options_2 |= 1226 icb->firmware_options_2 |=
1227 __constant_cpu_to_le32(BIT_18); 1227 __constant_cpu_to_le32(BIT_18);
1228 1228
1229 icb->firmware_options_2 |= __constant_cpu_to_le32(BIT_22); 1229 icb->firmware_options_2 &= __constant_cpu_to_le32(~BIT_22);
1230 icb->firmware_options_2 |= __constant_cpu_to_le32(BIT_23); 1230 icb->firmware_options_2 |= __constant_cpu_to_le32(BIT_23);
1231 ha->rsp_q_map[0]->options = icb->firmware_options_2;
1232 1231
1233 WRT_REG_DWORD(&reg->isp25mq.req_q_in, 0); 1232 WRT_REG_DWORD(&reg->isp25mq.req_q_in, 0);
1234 WRT_REG_DWORD(&reg->isp25mq.req_q_out, 0); 1233 WRT_REG_DWORD(&reg->isp25mq.req_q_out, 0);
@@ -1309,8 +1308,12 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
1309 1308
1310 DEBUG(printk("scsi(%ld): Issue init firmware.\n", vha->host_no)); 1309 DEBUG(printk("scsi(%ld): Issue init firmware.\n", vha->host_no));
1311 1310
1312 if (ha->flags.npiv_supported) 1311 if (ha->flags.npiv_supported) {
1312 if (ha->operating_mode == LOOP)
1313 ha->max_npiv_vports = MIN_MULTI_ID_FABRIC - 1;
1313 mid_init_cb->count = cpu_to_le16(ha->max_npiv_vports); 1314 mid_init_cb->count = cpu_to_le16(ha->max_npiv_vports);
1315 }
1316
1314 1317
1315 mid_init_cb->options = __constant_cpu_to_le16(BIT_1); 1318 mid_init_cb->options = __constant_cpu_to_le16(BIT_1);
1316 1319
@@ -2611,6 +2614,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
2611 port_id_t wrap, nxt_d_id; 2614 port_id_t wrap, nxt_d_id;
2612 struct qla_hw_data *ha = vha->hw; 2615 struct qla_hw_data *ha = vha->hw;
2613 struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev); 2616 struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev);
2617 struct scsi_qla_host *tvp;
2614 2618
2615 rval = QLA_SUCCESS; 2619 rval = QLA_SUCCESS;
2616 2620
@@ -2710,7 +2714,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
2710 /* Bypass virtual ports of the same host. */ 2714 /* Bypass virtual ports of the same host. */
2711 found = 0; 2715 found = 0;
2712 if (ha->num_vhosts) { 2716 if (ha->num_vhosts) {
2713 list_for_each_entry(vp, &ha->vp_list, list) { 2717 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
2714 if (new_fcport->d_id.b24 == vp->d_id.b24) { 2718 if (new_fcport->d_id.b24 == vp->d_id.b24) {
2715 found = 1; 2719 found = 1;
2716 break; 2720 break;
@@ -2833,6 +2837,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev)
2833 uint16_t first_loop_id; 2837 uint16_t first_loop_id;
2834 struct qla_hw_data *ha = vha->hw; 2838 struct qla_hw_data *ha = vha->hw;
2835 struct scsi_qla_host *vp; 2839 struct scsi_qla_host *vp;
2840 struct scsi_qla_host *tvp;
2836 2841
2837 rval = QLA_SUCCESS; 2842 rval = QLA_SUCCESS;
2838 2843
@@ -2857,7 +2862,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev)
2857 /* Check for loop ID being already in use. */ 2862 /* Check for loop ID being already in use. */
2858 found = 0; 2863 found = 0;
2859 fcport = NULL; 2864 fcport = NULL;
2860 list_for_each_entry(vp, &ha->vp_list, list) { 2865 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
2861 list_for_each_entry(fcport, &vp->vp_fcports, list) { 2866 list_for_each_entry(fcport, &vp->vp_fcports, list) {
2862 if (fcport->loop_id == dev->loop_id && 2867 if (fcport->loop_id == dev->loop_id &&
2863 fcport != dev) { 2868 fcport != dev) {
@@ -3292,6 +3297,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
3292 uint8_t status = 0; 3297 uint8_t status = 0;
3293 struct qla_hw_data *ha = vha->hw; 3298 struct qla_hw_data *ha = vha->hw;
3294 struct scsi_qla_host *vp; 3299 struct scsi_qla_host *vp;
3300 struct scsi_qla_host *tvp;
3295 struct req_que *req = ha->req_q_map[0]; 3301 struct req_que *req = ha->req_q_map[0];
3296 3302
3297 if (vha->flags.online) { 3303 if (vha->flags.online) {
@@ -3307,7 +3313,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
3307 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { 3313 if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
3308 atomic_set(&vha->loop_state, LOOP_DOWN); 3314 atomic_set(&vha->loop_state, LOOP_DOWN);
3309 qla2x00_mark_all_devices_lost(vha, 0); 3315 qla2x00_mark_all_devices_lost(vha, 0);
3310 list_for_each_entry(vp, &ha->vp_list, list) 3316 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list)
3311 qla2x00_mark_all_devices_lost(vp, 0); 3317 qla2x00_mark_all_devices_lost(vp, 0);
3312 } else { 3318 } else {
3313 if (!atomic_read(&vha->loop_down_timer)) 3319 if (!atomic_read(&vha->loop_down_timer))
@@ -3404,7 +3410,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
3404 DEBUG(printk(KERN_INFO 3410 DEBUG(printk(KERN_INFO
3405 "qla2x00_abort_isp(%ld): succeeded.\n", 3411 "qla2x00_abort_isp(%ld): succeeded.\n",
3406 vha->host_no)); 3412 vha->host_no));
3407 list_for_each_entry(vp, &ha->vp_list, list) { 3413 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
3408 if (vp->vp_idx) 3414 if (vp->vp_idx)
3409 qla2x00_vp_abort_isp(vp); 3415 qla2x00_vp_abort_isp(vp);
3410 } 3416 }
@@ -3429,7 +3435,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
3429static int 3435static int
3430qla2x00_restart_isp(scsi_qla_host_t *vha) 3436qla2x00_restart_isp(scsi_qla_host_t *vha)
3431{ 3437{
3432 uint8_t status = 0; 3438 int status = 0;
3433 uint32_t wait_time; 3439 uint32_t wait_time;
3434 struct qla_hw_data *ha = vha->hw; 3440 struct qla_hw_data *ha = vha->hw;
3435 struct req_que *req = ha->req_q_map[0]; 3441 struct req_que *req = ha->req_q_map[0];
@@ -3493,7 +3499,7 @@ qla25xx_init_queues(struct qla_hw_data *ha)
3493 rsp = ha->rsp_q_map[i]; 3499 rsp = ha->rsp_q_map[i];
3494 if (rsp) { 3500 if (rsp) {
3495 rsp->options &= ~BIT_0; 3501 rsp->options &= ~BIT_0;
3496 ret = qla25xx_init_rsp_que(base_vha, rsp, rsp->options); 3502 ret = qla25xx_init_rsp_que(base_vha, rsp);
3497 if (ret != QLA_SUCCESS) 3503 if (ret != QLA_SUCCESS)
3498 DEBUG2_17(printk(KERN_WARNING 3504 DEBUG2_17(printk(KERN_WARNING
3499 "%s Rsp que:%d init failed\n", __func__, 3505 "%s Rsp que:%d init failed\n", __func__,
@@ -3507,7 +3513,7 @@ qla25xx_init_queues(struct qla_hw_data *ha)
3507 if (req) { 3513 if (req) {
3508 /* Clear outstanding commands array. */ 3514 /* Clear outstanding commands array. */
3509 req->options &= ~BIT_0; 3515 req->options &= ~BIT_0;
3510 ret = qla25xx_init_req_que(base_vha, req, req->options); 3516 ret = qla25xx_init_req_que(base_vha, req);
3511 if (ret != QLA_SUCCESS) 3517 if (ret != QLA_SUCCESS)
3512 DEBUG2_17(printk(KERN_WARNING 3518 DEBUG2_17(printk(KERN_WARNING
3513 "%s Req que:%d init failed\n", __func__, 3519 "%s Req que:%d init failed\n", __func__,