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.c95
1 files changed, 54 insertions, 41 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 54ea68cec4c5..1fa067e053d2 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -111,6 +111,7 @@ qla2x00_get_ctx_sp(scsi_qla_host_t *vha, fc_port_t *fcport, size_t size,
111 memset(sp, 0, sizeof(*sp)); 111 memset(sp, 0, sizeof(*sp));
112 sp->fcport = fcport; 112 sp->fcport = fcport;
113 sp->ctx = ctx; 113 sp->ctx = ctx;
114 ctx->iocbs = 1;
114 ctx->u.iocb_cmd = iocb; 115 ctx->u.iocb_cmd = iocb;
115 iocb->free = qla2x00_ctx_sp_free; 116 iocb->free = qla2x00_ctx_sp_free;
116 117
@@ -154,8 +155,8 @@ qla2x00_async_iocb_timeout(srb_t *sp)
154 struct srb_ctx *ctx = sp->ctx; 155 struct srb_ctx *ctx = sp->ctx;
155 156
156 ql_dbg(ql_dbg_disc, fcport->vha, 0x2071, 157 ql_dbg(ql_dbg_disc, fcport->vha, 0x2071,
157 "Async-%s timeout - portid=%02x%02x%02x.\n", 158 "Async-%s timeout - hdl=%x portid=%02x%02x%02x.\n",
158 ctx->name, fcport->d_id.b.domain, fcport->d_id.b.area, 159 ctx->name, sp->handle, fcport->d_id.b.domain, fcport->d_id.b.area,
159 fcport->d_id.b.al_pa); 160 fcport->d_id.b.al_pa);
160 161
161 fcport->flags &= ~FCF_ASYNC_SENT; 162 fcport->flags &= ~FCF_ASYNC_SENT;
@@ -211,9 +212,10 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport,
211 goto done_free_sp; 212 goto done_free_sp;
212 213
213 ql_dbg(ql_dbg_disc, vha, 0x2072, 214 ql_dbg(ql_dbg_disc, vha, 0x2072,
214 "Async-login - loopid=%x portid=%02x%02x%02x retries=%d.\n", 215 "Async-login - hdl=%x, loopid=%x portid=%02x%02x%02x "
215 fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, 216 "retries=%d.\n", sp->handle, fcport->loop_id,
216 fcport->d_id.b.al_pa, fcport->login_retry); 217 fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa,
218 fcport->login_retry);
217 return rval; 219 return rval;
218 220
219done_free_sp: 221done_free_sp:
@@ -258,9 +260,9 @@ qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport)
258 goto done_free_sp; 260 goto done_free_sp;
259 261
260 ql_dbg(ql_dbg_disc, vha, 0x2070, 262 ql_dbg(ql_dbg_disc, vha, 0x2070,
261 "Async-logout - loop-id=%x portid=%02x%02x%02x.\n", 263 "Async-logout - hdl=%x loop-id=%x portid=%02x%02x%02x.\n",
262 fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, 264 sp->handle, fcport->loop_id, fcport->d_id.b.domain,
263 fcport->d_id.b.al_pa); 265 fcport->d_id.b.area, fcport->d_id.b.al_pa);
264 return rval; 266 return rval;
265 267
266done_free_sp: 268done_free_sp:
@@ -308,9 +310,9 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport,
308 goto done_free_sp; 310 goto done_free_sp;
309 311
310 ql_dbg(ql_dbg_disc, vha, 0x206f, 312 ql_dbg(ql_dbg_disc, vha, 0x206f,
311 "Async-adisc - loopid=%x portid=%02x%02x%02x.\n", 313 "Async-adisc - hdl=%x loopid=%x portid=%02x%02x%02x.\n",
312 fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, 314 sp->handle, fcport->loop_id, fcport->d_id.b.domain,
313 fcport->d_id.b.al_pa); 315 fcport->d_id.b.area, fcport->d_id.b.al_pa);
314 return rval; 316 return rval;
315 317
316done_free_sp: 318done_free_sp:
@@ -360,9 +362,9 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun,
360 goto done_free_sp; 362 goto done_free_sp;
361 363
362 ql_dbg(ql_dbg_taskm, vha, 0x802f, 364 ql_dbg(ql_dbg_taskm, vha, 0x802f,
363 "Async-tmf loop-id=%x portid=%02x%02x%02x.\n", 365 "Async-tmf hdl=%x loop-id=%x portid=%02x%02x%02x.\n",
364 fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, 366 sp->handle, fcport->loop_id, fcport->d_id.b.domain,
365 fcport->d_id.b.al_pa); 367 fcport->d_id.b.area, fcport->d_id.b.al_pa);
366 return rval; 368 return rval;
367 369
368done_free_sp: 370done_free_sp:
@@ -514,7 +516,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
514 set_bit(0, ha->req_qid_map); 516 set_bit(0, ha->req_qid_map);
515 set_bit(0, ha->rsp_qid_map); 517 set_bit(0, ha->rsp_qid_map);
516 518
517 ql_log(ql_log_info, vha, 0x0040, 519 ql_dbg(ql_dbg_init, vha, 0x0040,
518 "Configuring PCI space...\n"); 520 "Configuring PCI space...\n");
519 rval = ha->isp_ops->pci_config(vha); 521 rval = ha->isp_ops->pci_config(vha);
520 if (rval) { 522 if (rval) {
@@ -533,7 +535,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
533 } 535 }
534 536
535 ha->isp_ops->get_flash_version(vha, req->ring); 537 ha->isp_ops->get_flash_version(vha, req->ring);
536 ql_log(ql_log_info, vha, 0x0061, 538 ql_dbg(ql_dbg_init, vha, 0x0061,
537 "Configure NVRAM parameters...\n"); 539 "Configure NVRAM parameters...\n");
538 540
539 ha->isp_ops->nvram_config(vha); 541 ha->isp_ops->nvram_config(vha);
@@ -550,7 +552,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
550 return QLA_FUNCTION_FAILED; 552 return QLA_FUNCTION_FAILED;
551 } 553 }
552 554
553 ql_log(ql_log_info, vha, 0x0078, 555 ql_dbg(ql_dbg_init, vha, 0x0078,
554 "Verifying loaded RISC code...\n"); 556 "Verifying loaded RISC code...\n");
555 557
556 if (qla2x00_isp_firmware(vha) != QLA_SUCCESS) { 558 if (qla2x00_isp_firmware(vha) != QLA_SUCCESS) {
@@ -1294,7 +1296,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
1294 ha->flags.fce_enabled = 0; 1296 ha->flags.fce_enabled = 0;
1295 goto try_eft; 1297 goto try_eft;
1296 } 1298 }
1297 ql_log(ql_log_info, vha, 0x00c0, 1299 ql_dbg(ql_dbg_init, vha, 0x00c0,
1298 "Allocate (%d KB) for FCE...\n", FCE_SIZE / 1024); 1300 "Allocate (%d KB) for FCE...\n", FCE_SIZE / 1024);
1299 1301
1300 fce_size = sizeof(struct qla2xxx_fce_chain) + FCE_SIZE; 1302 fce_size = sizeof(struct qla2xxx_fce_chain) + FCE_SIZE;
@@ -1321,7 +1323,7 @@ try_eft:
1321 tc_dma); 1323 tc_dma);
1322 goto cont_alloc; 1324 goto cont_alloc;
1323 } 1325 }
1324 ql_log(ql_log_info, vha, 0x00c3, 1326 ql_dbg(ql_dbg_init, vha, 0x00c3,
1325 "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024); 1327 "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024);
1326 1328
1327 eft_size = EFT_SIZE; 1329 eft_size = EFT_SIZE;
@@ -1358,7 +1360,7 @@ cont_alloc:
1358 } 1360 }
1359 return; 1361 return;
1360 } 1362 }
1361 ql_log(ql_log_info, vha, 0x00c5, 1363 ql_dbg(ql_dbg_init, vha, 0x00c5,
1362 "Allocated (%d KB) for firmware dump.\n", dump_size / 1024); 1364 "Allocated (%d KB) for firmware dump.\n", dump_size / 1024);
1363 1365
1364 ha->fw_dump_len = dump_size; 1366 ha->fw_dump_len = dump_size;
@@ -1929,7 +1931,7 @@ qla2x00_fw_ready(scsi_qla_host_t *vha)
1929 rval = qla84xx_init_chip(vha); 1931 rval = qla84xx_init_chip(vha);
1930 if (rval != QLA_SUCCESS) { 1932 if (rval != QLA_SUCCESS) {
1931 ql_log(ql_log_warn, 1933 ql_log(ql_log_warn,
1932 vha, 0x8026, 1934 vha, 0x8007,
1933 "Init chip failed.\n"); 1935 "Init chip failed.\n");
1934 break; 1936 break;
1935 } 1937 }
@@ -1938,7 +1940,7 @@ qla2x00_fw_ready(scsi_qla_host_t *vha)
1938 cs84xx_time = jiffies - cs84xx_time; 1940 cs84xx_time = jiffies - cs84xx_time;
1939 wtime += cs84xx_time; 1941 wtime += cs84xx_time;
1940 mtime += cs84xx_time; 1942 mtime += cs84xx_time;
1941 ql_dbg(ql_dbg_taskm, vha, 0x8025, 1943 ql_dbg(ql_dbg_taskm, vha, 0x8008,
1942 "Increasing wait time by %ld. " 1944 "Increasing wait time by %ld. "
1943 "New time %ld.\n", cs84xx_time, 1945 "New time %ld.\n", cs84xx_time,
1944 wtime); 1946 wtime);
@@ -1981,16 +1983,13 @@ qla2x00_fw_ready(scsi_qla_host_t *vha)
1981 1983
1982 /* Delay for a while */ 1984 /* Delay for a while */
1983 msleep(500); 1985 msleep(500);
1984
1985 ql_dbg(ql_dbg_taskm, vha, 0x8039,
1986 "fw_state=%x curr time=%lx.\n", state[0], jiffies);
1987 } while (1); 1986 } while (1);
1988 1987
1989 ql_dbg(ql_dbg_taskm, vha, 0x803a, 1988 ql_dbg(ql_dbg_taskm, vha, 0x803a,
1990 "fw_state=%x (%x, %x, %x, %x) " "curr time=%lx.\n", state[0], 1989 "fw_state=%x (%x, %x, %x, %x) " "curr time=%lx.\n", state[0],
1991 state[1], state[2], state[3], state[4], jiffies); 1990 state[1], state[2], state[3], state[4], jiffies);
1992 1991
1993 if (rval) { 1992 if (rval && !(vha->device_flags & DFLG_NO_CABLE)) {
1994 ql_log(ql_log_warn, vha, 0x803b, 1993 ql_log(ql_log_warn, vha, 0x803b,
1995 "Firmware ready **** FAILED ****.\n"); 1994 "Firmware ready **** FAILED ****.\n");
1996 } 1995 }
@@ -2386,7 +2385,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
2386 * internal driver logging. 2385 * internal driver logging.
2387 */ 2386 */
2388 if (nv->host_p[0] & BIT_7) 2387 if (nv->host_p[0] & BIT_7)
2389 ql2xextended_error_logging = 0x7fffffff; 2388 ql2xextended_error_logging = QL_DBG_DEFAULT1_MASK;
2390 ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0); 2389 ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0);
2391 /* Always load RISC code on non ISP2[12]00 chips. */ 2390 /* Always load RISC code on non ISP2[12]00 chips. */
2392 if (!IS_QLA2100(ha) && !IS_QLA2200(ha)) 2391 if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
@@ -4188,7 +4187,8 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
4188 spin_unlock_irqrestore(&ha->vport_slock, flags); 4187 spin_unlock_irqrestore(&ha->vport_slock, flags);
4189 4188
4190 } else { 4189 } else {
4191 ql_log(ql_log_warn, vha, 0x8023, "%s **** FAILED ****.\n"); 4190 ql_log(ql_log_warn, vha, 0x8023, "%s **** FAILED ****.\n",
4191 __func__);
4192 } 4192 }
4193 4193
4194 return(status); 4194 return(status);
@@ -4638,7 +4638,7 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr,
4638 struct req_que *req = ha->req_q_map[0]; 4638 struct req_que *req = ha->req_q_map[0];
4639 4639
4640 ql_dbg(ql_dbg_init, vha, 0x008b, 4640 ql_dbg(ql_dbg_init, vha, 0x008b,
4641 "Loading firmware from flash (%x).\n", faddr); 4641 "FW: Loading firmware from flash (%x).\n", faddr);
4642 4642
4643 rval = QLA_SUCCESS; 4643 rval = QLA_SUCCESS;
4644 4644
@@ -4836,8 +4836,8 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
4836 return QLA_FUNCTION_FAILED; 4836 return QLA_FUNCTION_FAILED;
4837 } 4837 }
4838 4838
4839 ql_log(ql_log_info, vha, 0x0092, 4839 ql_dbg(ql_dbg_init, vha, 0x0092,
4840 "Loading via request-firmware.\n"); 4840 "FW: Loading via request-firmware.\n");
4841 4841
4842 rval = QLA_SUCCESS; 4842 rval = QLA_SUCCESS;
4843 4843
@@ -5425,7 +5425,7 @@ qla82xx_restart_isp(scsi_qla_host_t *vha)
5425 if ((vha->device_flags & DFLG_NO_CABLE)) 5425 if ((vha->device_flags & DFLG_NO_CABLE))
5426 status = 0; 5426 status = 0;
5427 5427
5428 ql_log(ql_log_info, vha, 0x803d, 5428 ql_log(ql_log_info, vha, 0x8000,
5429 "Configure loop done, status = 0x%x.\n", status); 5429 "Configure loop done, status = 0x%x.\n", status);
5430 } 5430 }
5431 5431
@@ -5458,7 +5458,7 @@ qla82xx_restart_isp(scsi_qla_host_t *vha)
5458 ha->fce_dma, ha->fce_bufs, ha->fce_mb, 5458 ha->fce_dma, ha->fce_bufs, ha->fce_mb,
5459 &ha->fce_bufs); 5459 &ha->fce_bufs);
5460 if (rval) { 5460 if (rval) {
5461 ql_log(ql_log_warn, vha, 0x803e, 5461 ql_log(ql_log_warn, vha, 0x8001,
5462 "Unable to reinitialize FCE (%d).\n", 5462 "Unable to reinitialize FCE (%d).\n",
5463 rval); 5463 rval);
5464 ha->flags.fce_enabled = 0; 5464 ha->flags.fce_enabled = 0;
@@ -5470,7 +5470,7 @@ qla82xx_restart_isp(scsi_qla_host_t *vha)
5470 rval = qla2x00_enable_eft_trace(vha, 5470 rval = qla2x00_enable_eft_trace(vha,
5471 ha->eft_dma, EFT_NUM_BUFFERS); 5471 ha->eft_dma, EFT_NUM_BUFFERS);
5472 if (rval) { 5472 if (rval) {
5473 ql_log(ql_log_warn, vha, 0x803f, 5473 ql_log(ql_log_warn, vha, 0x8010,
5474 "Unable to reinitialize EFT (%d).\n", 5474 "Unable to reinitialize EFT (%d).\n",
5475 rval); 5475 rval);
5476 } 5476 }
@@ -5478,7 +5478,7 @@ qla82xx_restart_isp(scsi_qla_host_t *vha)
5478 } 5478 }
5479 5479
5480 if (!status) { 5480 if (!status) {
5481 ql_dbg(ql_dbg_taskm, vha, 0x8040, 5481 ql_dbg(ql_dbg_taskm, vha, 0x8011,
5482 "qla82xx_restart_isp succeeded.\n"); 5482 "qla82xx_restart_isp succeeded.\n");
5483 5483
5484 spin_lock_irqsave(&ha->vport_slock, flags); 5484 spin_lock_irqsave(&ha->vport_slock, flags);
@@ -5496,7 +5496,7 @@ qla82xx_restart_isp(scsi_qla_host_t *vha)
5496 spin_unlock_irqrestore(&ha->vport_slock, flags); 5496 spin_unlock_irqrestore(&ha->vport_slock, flags);
5497 5497
5498 } else { 5498 } else {
5499 ql_log(ql_log_warn, vha, 0x8041, 5499 ql_log(ql_log_warn, vha, 0x8016,
5500 "qla82xx_restart_isp **** FAILED ****.\n"); 5500 "qla82xx_restart_isp **** FAILED ****.\n");
5501 } 5501 }
5502 5502
@@ -5643,13 +5643,26 @@ qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport)
5643 if (priority < 0) 5643 if (priority < 0)
5644 return QLA_FUNCTION_FAILED; 5644 return QLA_FUNCTION_FAILED;
5645 5645
5646 if (IS_QLA82XX(vha->hw)) {
5647 fcport->fcp_prio = priority & 0xf;
5648 return QLA_SUCCESS;
5649 }
5650
5646 ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb); 5651 ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb);
5647 if (ret == QLA_SUCCESS) 5652 if (ret == QLA_SUCCESS) {
5648 fcport->fcp_prio = priority; 5653 if (fcport->fcp_prio != priority)
5649 else 5654 ql_dbg(ql_dbg_user, vha, 0x709e,
5655 "Updated FCP_CMND priority - value=%d loop_id=%d "
5656 "port_id=%02x%02x%02x.\n", priority,
5657 fcport->loop_id, fcport->d_id.b.domain,
5658 fcport->d_id.b.area, fcport->d_id.b.al_pa);
5659 fcport->fcp_prio = priority & 0xf;
5660 } else
5650 ql_dbg(ql_dbg_user, vha, 0x704f, 5661 ql_dbg(ql_dbg_user, vha, 0x704f,
5651 "Unable to activate fcp priority, ret=0x%x.\n", ret); 5662 "Unable to update FCP_CMND priority - ret=0x%x for "
5652 5663 "loop_id=%d port_id=%02x%02x%02x.\n", ret, fcport->loop_id,
5664 fcport->d_id.b.domain, fcport->d_id.b.area,
5665 fcport->d_id.b.al_pa);
5653 return ret; 5666 return ret;
5654} 5667}
5655 5668