| .. | .. |
|---|
| 483 | 483 | void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) |
|---|
| 484 | 484 | { |
|---|
| 485 | 485 | struct fc_port *fcport = ea->fcport; |
|---|
| 486 | + unsigned long flags; |
|---|
| 486 | 487 | |
|---|
| 487 | 488 | ql_dbg(ql_dbg_disc, vha, 0x20d2, |
|---|
| 488 | 489 | "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d lid %d\n", |
|---|
| .. | .. |
|---|
| 497 | 498 | ql_dbg(ql_dbg_disc, vha, 0x2066, |
|---|
| 498 | 499 | "%s %8phC: adisc fail: post delete\n", |
|---|
| 499 | 500 | __func__, ea->fcport->port_name); |
|---|
| 501 | + |
|---|
| 502 | + spin_lock_irqsave(&vha->work_lock, flags); |
|---|
| 500 | 503 | /* deleted = 0 & logout_on_delete = force fw cleanup */ |
|---|
| 501 | | - fcport->deleted = 0; |
|---|
| 504 | + if (fcport->deleted == QLA_SESS_DELETED) |
|---|
| 505 | + fcport->deleted = 0; |
|---|
| 506 | + |
|---|
| 502 | 507 | fcport->logout_on_delete = 1; |
|---|
| 508 | + spin_unlock_irqrestore(&vha->work_lock, flags); |
|---|
| 509 | + |
|---|
| 503 | 510 | qlt_schedule_sess_for_deletion(ea->fcport); |
|---|
| 504 | 511 | return; |
|---|
| 505 | 512 | } |
|---|
| .. | .. |
|---|
| 1405 | 1412 | |
|---|
| 1406 | 1413 | spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); |
|---|
| 1407 | 1414 | ea->fcport->login_gen++; |
|---|
| 1408 | | - ea->fcport->deleted = 0; |
|---|
| 1409 | 1415 | ea->fcport->logout_on_delete = 1; |
|---|
| 1410 | 1416 | |
|---|
| 1411 | 1417 | if (!ea->fcport->login_succ && !IS_SW_RESV_ADDR(ea->fcport->d_id)) { |
|---|
| .. | .. |
|---|
| 4336 | 4342 | memcpy(ha->port_name, ha->init_cb->port_name, WWN_SIZE); |
|---|
| 4337 | 4343 | } |
|---|
| 4338 | 4344 | |
|---|
| 4345 | + QLA_FW_STARTED(ha); |
|---|
| 4339 | 4346 | rval = qla2x00_init_firmware(vha, ha->init_cb_size); |
|---|
| 4340 | 4347 | next_check: |
|---|
| 4341 | 4348 | if (rval) { |
|---|
| 4349 | + QLA_FW_STOPPED(ha); |
|---|
| 4342 | 4350 | ql_log(ql_log_fatal, vha, 0x00d2, |
|---|
| 4343 | 4351 | "Init Firmware **** FAILED ****.\n"); |
|---|
| 4344 | 4352 | } else { |
|---|
| 4345 | 4353 | ql_dbg(ql_dbg_init, vha, 0x00d3, |
|---|
| 4346 | 4354 | "Init Firmware -- success.\n"); |
|---|
| 4347 | | - QLA_FW_STARTED(ha); |
|---|
| 4348 | 4355 | vha->u_ql2xexchoffld = vha->u_ql2xiniexchg = 0; |
|---|
| 4349 | 4356 | } |
|---|
| 4350 | 4357 | |
|---|
| .. | .. |
|---|
| 5639 | 5646 | void |
|---|
| 5640 | 5647 | qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) |
|---|
| 5641 | 5648 | { |
|---|
| 5649 | + unsigned long flags; |
|---|
| 5650 | + |
|---|
| 5642 | 5651 | if (IS_SW_RESV_ADDR(fcport->d_id)) |
|---|
| 5643 | 5652 | return; |
|---|
| 5644 | 5653 | |
|---|
| .. | .. |
|---|
| 5648 | 5657 | qla2x00_set_fcport_disc_state(fcport, DSC_UPD_FCPORT); |
|---|
| 5649 | 5658 | fcport->login_retry = vha->hw->login_retry_count; |
|---|
| 5650 | 5659 | fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); |
|---|
| 5660 | + |
|---|
| 5661 | + spin_lock_irqsave(&vha->work_lock, flags); |
|---|
| 5651 | 5662 | fcport->deleted = 0; |
|---|
| 5663 | + spin_unlock_irqrestore(&vha->work_lock, flags); |
|---|
| 5664 | + |
|---|
| 5652 | 5665 | if (vha->hw->current_topology == ISP_CFG_NL) |
|---|
| 5653 | 5666 | fcport->logout_on_delete = 0; |
|---|
| 5654 | 5667 | else |
|---|
| .. | .. |
|---|
| 6913 | 6926 | } |
|---|
| 6914 | 6927 | |
|---|
| 6915 | 6928 | /* purge MBox commands */ |
|---|
| 6916 | | - if (atomic_read(&ha->num_pend_mbx_stage3)) { |
|---|
| 6929 | + spin_lock_irqsave(&ha->hardware_lock, flags); |
|---|
| 6930 | + if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags)) { |
|---|
| 6917 | 6931 | clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); |
|---|
| 6918 | 6932 | complete(&ha->mbx_intr_comp); |
|---|
| 6919 | 6933 | } |
|---|
| 6934 | + spin_unlock_irqrestore(&ha->hardware_lock, flags); |
|---|
| 6920 | 6935 | |
|---|
| 6921 | 6936 | i = 0; |
|---|
| 6922 | | - while (atomic_read(&ha->num_pend_mbx_stage3) || |
|---|
| 6923 | | - atomic_read(&ha->num_pend_mbx_stage2) || |
|---|
| 6937 | + while (atomic_read(&ha->num_pend_mbx_stage2) || |
|---|
| 6924 | 6938 | atomic_read(&ha->num_pend_mbx_stage1)) { |
|---|
| 6925 | 6939 | msleep(20); |
|---|
| 6926 | 6940 | i++; |
|---|
| .. | .. |
|---|
| 6969 | 6983 | } |
|---|
| 6970 | 6984 | spin_unlock_irqrestore(&ha->vport_slock, flags); |
|---|
| 6971 | 6985 | |
|---|
| 6972 | | - if (!ha->flags.eeh_busy) { |
|---|
| 6973 | | - /* Make sure for ISP 82XX IO DMA is complete */ |
|---|
| 6974 | | - if (IS_P3P_TYPE(ha)) { |
|---|
| 6975 | | - qla82xx_chip_reset_cleanup(vha); |
|---|
| 6976 | | - ql_log(ql_log_info, vha, 0x00b4, |
|---|
| 6977 | | - "Done chip reset cleanup.\n"); |
|---|
| 6986 | + /* Make sure for ISP 82XX IO DMA is complete */ |
|---|
| 6987 | + if (IS_P3P_TYPE(ha)) { |
|---|
| 6988 | + qla82xx_chip_reset_cleanup(vha); |
|---|
| 6989 | + ql_log(ql_log_info, vha, 0x00b4, |
|---|
| 6990 | + "Done chip reset cleanup.\n"); |
|---|
| 6978 | 6991 | |
|---|
| 6979 | | - /* Done waiting for pending commands. |
|---|
| 6980 | | - * Reset the online flag. |
|---|
| 6981 | | - */ |
|---|
| 6982 | | - vha->flags.online = 0; |
|---|
| 6983 | | - } |
|---|
| 6984 | | - |
|---|
| 6985 | | - /* Requeue all commands in outstanding command list. */ |
|---|
| 6986 | | - qla2x00_abort_all_cmds(vha, DID_RESET << 16); |
|---|
| 6992 | + /* Done waiting for pending commands. Reset online flag */ |
|---|
| 6993 | + vha->flags.online = 0; |
|---|
| 6987 | 6994 | } |
|---|
| 6995 | + |
|---|
| 6996 | + /* Requeue all commands in outstanding command list. */ |
|---|
| 6997 | + qla2x00_abort_all_cmds(vha, DID_RESET << 16); |
|---|
| 6988 | 6998 | /* memory barrier */ |
|---|
| 6989 | 6999 | wmb(); |
|---|
| 6990 | 7000 | } |
|---|
| .. | .. |
|---|
| 7011 | 7021 | |
|---|
| 7012 | 7022 | if (vha->flags.online) { |
|---|
| 7013 | 7023 | qla2x00_abort_isp_cleanup(vha); |
|---|
| 7024 | + |
|---|
| 7025 | + if (qla2x00_isp_reg_stat(ha)) { |
|---|
| 7026 | + ql_log(ql_log_info, vha, 0x803f, |
|---|
| 7027 | + "ISP Abort - ISP reg disconnect, exiting.\n"); |
|---|
| 7028 | + return status; |
|---|
| 7029 | + } |
|---|
| 7014 | 7030 | |
|---|
| 7015 | 7031 | if (test_and_clear_bit(ISP_ABORT_TO_ROM, &vha->dpc_flags)) { |
|---|
| 7016 | 7032 | ha->flags.chip_reset_done = 1; |
|---|
| .. | .. |
|---|
| 7052 | 7068 | |
|---|
| 7053 | 7069 | ha->isp_ops->get_flash_version(vha, req->ring); |
|---|
| 7054 | 7070 | |
|---|
| 7071 | + if (qla2x00_isp_reg_stat(ha)) { |
|---|
| 7072 | + ql_log(ql_log_info, vha, 0x803f, |
|---|
| 7073 | + "ISP Abort - ISP reg disconnect pre nvram config, exiting.\n"); |
|---|
| 7074 | + return status; |
|---|
| 7075 | + } |
|---|
| 7055 | 7076 | ha->isp_ops->nvram_config(vha); |
|---|
| 7056 | 7077 | |
|---|
| 7078 | + if (qla2x00_isp_reg_stat(ha)) { |
|---|
| 7079 | + ql_log(ql_log_info, vha, 0x803f, |
|---|
| 7080 | + "ISP Abort - ISP reg disconnect post nvmram config, exiting.\n"); |
|---|
| 7081 | + return status; |
|---|
| 7082 | + } |
|---|
| 7057 | 7083 | if (!qla2x00_restart_isp(vha)) { |
|---|
| 7058 | 7084 | clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); |
|---|
| 7059 | 7085 | |
|---|