Commit 3c75ad1d authored by Himanshu Madhani's avatar Himanshu Madhani Committed by Martin K. Petersen

scsi: qla2xxx: Remove defer flag to indicate immeadiate port loss

During cable pull test case, if the port is disconnected for time larger
than devloss timeout, driver does not mark path offline.  In such case,
instead of notifying SCSI-ML of loop down, driver goes into endless loop of
device relogin because defer flag is set.

With newer handling of device relogin in driver discovery, defer flag is
now redundant. This patch removes defer flag and cleans up code handling
port lost indication to SCSI-ML.

Link: https://lore.kernel.org/r/20191217220617.28084-2-hmadhani@marvell.comSigned-off-by: default avatarQuinn Tran <qtran@marvell.com>
Signed-off-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d8dd7d76
...@@ -253,8 +253,8 @@ extern scsi_qla_host_t *qla24xx_create_vhost(struct fc_vport *); ...@@ -253,8 +253,8 @@ extern scsi_qla_host_t *qla24xx_create_vhost(struct fc_vport *);
extern void qla2x00_sp_free_dma(srb_t *sp); extern void qla2x00_sp_free_dma(srb_t *sp);
extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *); extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int); extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int);
extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *, int); extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *);
extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *); extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *);
......
...@@ -425,7 +425,7 @@ qla2x00_async_prlo_done(struct scsi_qla_host *vha, fc_port_t *fcport, ...@@ -425,7 +425,7 @@ qla2x00_async_prlo_done(struct scsi_qla_host *vha, fc_port_t *fcport,
fcport->flags &= ~FCF_ASYNC_ACTIVE; fcport->flags &= ~FCF_ASYNC_ACTIVE;
/* Don't re-login in target mode */ /* Don't re-login in target mode */
if (!fcport->tgt_session) if (!fcport->tgt_session)
qla2x00_mark_device_lost(vha, fcport, 1, 0); qla2x00_mark_device_lost(vha, fcport, 1);
qlt_logo_completion_handler(fcport, data[0]); qlt_logo_completion_handler(fcport, data[0]);
} }
...@@ -2000,7 +2000,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) ...@@ -2000,7 +2000,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
if (ea->data[1] & QLA_LOGIO_LOGIN_RETRIED) if (ea->data[1] & QLA_LOGIO_LOGIN_RETRIED)
set_bit(RELOGIN_NEEDED, &vha->dpc_flags); set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
else else
qla2x00_mark_device_lost(vha, ea->fcport, 1, 0); qla2x00_mark_device_lost(vha, ea->fcport, 1);
break; break;
case MBS_LOOP_ID_USED: case MBS_LOOP_ID_USED:
/* data[1] = IO PARAM 1 = nport ID */ /* data[1] = IO PARAM 1 = nport ID */
...@@ -5230,7 +5230,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) ...@@ -5230,7 +5230,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha)
qla_ini_mode_enabled(vha)) && qla_ini_mode_enabled(vha)) &&
atomic_read(&fcport->state) == FCS_ONLINE) { atomic_read(&fcport->state) == FCS_ONLINE) {
qla2x00_mark_device_lost(vha, fcport, qla2x00_mark_device_lost(vha, fcport,
ql2xplogiabsentdevice, 0); ql2xplogiabsentdevice);
if (fcport->loop_id != FC_NO_LOOP_ID && if (fcport->loop_id != FC_NO_LOOP_ID &&
(fcport->flags & FCF_FCP2_DEVICE) == 0 && (fcport->flags & FCF_FCP2_DEVICE) == 0 &&
fcport->port_type != FCT_INITIATOR && fcport->port_type != FCT_INITIATOR &&
...@@ -5905,7 +5905,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) ...@@ -5905,7 +5905,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
qla_ini_mode_enabled(vha)) && qla_ini_mode_enabled(vha)) &&
atomic_read(&fcport->state) == FCS_ONLINE) { atomic_read(&fcport->state) == FCS_ONLINE) {
qla2x00_mark_device_lost(vha, fcport, qla2x00_mark_device_lost(vha, fcport,
ql2xplogiabsentdevice, 0); ql2xplogiabsentdevice);
if (fcport->loop_id != FC_NO_LOOP_ID && if (fcport->loop_id != FC_NO_LOOP_ID &&
(fcport->flags & FCF_FCP2_DEVICE) == 0 && (fcport->flags & FCF_FCP2_DEVICE) == 0 &&
fcport->port_type != FCT_INITIATOR && fcport->port_type != FCT_INITIATOR &&
...@@ -6071,7 +6071,7 @@ qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport, ...@@ -6071,7 +6071,7 @@ qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport,
ha->isp_ops->fabric_logout(vha, fcport->loop_id, ha->isp_ops->fabric_logout(vha, fcport->loop_id,
fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.domain, fcport->d_id.b.area,
fcport->d_id.b.al_pa); fcport->d_id.b.al_pa);
qla2x00_mark_device_lost(vha, fcport, 1, 0); qla2x00_mark_device_lost(vha, fcport, 1);
rval = 1; rval = 1;
break; break;
...@@ -6585,9 +6585,9 @@ qla2x00_quiesce_io(scsi_qla_host_t *vha) ...@@ -6585,9 +6585,9 @@ qla2x00_quiesce_io(scsi_qla_host_t *vha)
atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
if (atomic_read(&vha->loop_state) != LOOP_DOWN) { if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_state, LOOP_DOWN);
qla2x00_mark_all_devices_lost(vha, 0); qla2x00_mark_all_devices_lost(vha);
list_for_each_entry(vp, &ha->vp_list, list) list_for_each_entry(vp, &ha->vp_list, list)
qla2x00_mark_all_devices_lost(vp, 0); qla2x00_mark_all_devices_lost(vp);
} else { } else {
if (!atomic_read(&vha->loop_down_timer)) if (!atomic_read(&vha->loop_down_timer))
atomic_set(&vha->loop_down_timer, atomic_set(&vha->loop_down_timer,
...@@ -6663,14 +6663,14 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) ...@@ -6663,14 +6663,14 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha)
atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
if (atomic_read(&vha->loop_state) != LOOP_DOWN) { if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_state, LOOP_DOWN);
qla2x00_mark_all_devices_lost(vha, 0); qla2x00_mark_all_devices_lost(vha);
spin_lock_irqsave(&ha->vport_slock, flags); spin_lock_irqsave(&ha->vport_slock, flags);
list_for_each_entry(vp, &ha->vp_list, list) { list_for_each_entry(vp, &ha->vp_list, list) {
atomic_inc(&vp->vref_count); atomic_inc(&vp->vref_count);
spin_unlock_irqrestore(&ha->vport_slock, flags); spin_unlock_irqrestore(&ha->vport_slock, flags);
qla2x00_mark_all_devices_lost(vp, 0); qla2x00_mark_all_devices_lost(vp);
spin_lock_irqsave(&ha->vport_slock, flags); spin_lock_irqsave(&ha->vport_slock, flags);
atomic_dec(&vp->vref_count); atomic_dec(&vp->vref_count);
......
...@@ -788,7 +788,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -788,7 +788,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
if (atomic_read(&vha->loop_state) != LOOP_DOWN) { if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_state, LOOP_DOWN);
atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
qla2x00_mark_all_devices_lost(vha, 1); qla2x00_mark_all_devices_lost(vha);
} }
if (vha->vp_idx) { if (vha->vp_idx) {
...@@ -861,7 +861,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -861,7 +861,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
} }
vha->device_flags |= DFLG_NO_CABLE; vha->device_flags |= DFLG_NO_CABLE;
qla2x00_mark_all_devices_lost(vha, 1); qla2x00_mark_all_devices_lost(vha);
} }
if (vha->vp_idx) { if (vha->vp_idx) {
...@@ -881,7 +881,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -881,7 +881,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
if (atomic_read(&vha->loop_state) != LOOP_DOWN) { if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_state, LOOP_DOWN);
atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
qla2x00_mark_all_devices_lost(vha, 1); qla2x00_mark_all_devices_lost(vha);
} }
if (vha->vp_idx) { if (vha->vp_idx) {
...@@ -924,7 +924,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -924,7 +924,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
atomic_set(&vha->loop_down_timer, atomic_set(&vha->loop_down_timer,
LOOP_DOWN_TIME); LOOP_DOWN_TIME);
if (!N2N_TOPO(ha)) if (!N2N_TOPO(ha))
qla2x00_mark_all_devices_lost(vha, 1); qla2x00_mark_all_devices_lost(vha);
} }
if (vha->vp_idx) { if (vha->vp_idx) {
...@@ -953,7 +953,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -953,7 +953,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
if (!atomic_read(&vha->loop_down_timer)) if (!atomic_read(&vha->loop_down_timer))
atomic_set(&vha->loop_down_timer, atomic_set(&vha->loop_down_timer,
LOOP_DOWN_TIME); LOOP_DOWN_TIME);
qla2x00_mark_all_devices_lost(vha, 1); qla2x00_mark_all_devices_lost(vha);
} }
if (vha->vp_idx) { if (vha->vp_idx) {
...@@ -1022,7 +1022,6 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -1022,7 +1022,6 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
"Marking port lost loopid=%04x portid=%06x.\n", "Marking port lost loopid=%04x portid=%06x.\n",
fcport->loop_id, fcport->d_id.b24); fcport->loop_id, fcport->d_id.b24);
if (qla_ini_mode_enabled(vha)) { if (qla_ini_mode_enabled(vha)) {
qla2x00_mark_device_lost(fcport->vha, fcport, 1, 1);
fcport->logout_on_delete = 0; fcport->logout_on_delete = 0;
qlt_schedule_sess_for_deletion(fcport); qlt_schedule_sess_for_deletion(fcport);
} }
...@@ -1034,14 +1033,14 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -1034,14 +1033,14 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
atomic_set(&vha->loop_down_timer, atomic_set(&vha->loop_down_timer,
LOOP_DOWN_TIME); LOOP_DOWN_TIME);
vha->device_flags |= DFLG_NO_CABLE; vha->device_flags |= DFLG_NO_CABLE;
qla2x00_mark_all_devices_lost(vha, 1); qla2x00_mark_all_devices_lost(vha);
} }
if (vha->vp_idx) { if (vha->vp_idx) {
atomic_set(&vha->vp_state, VP_FAILED); atomic_set(&vha->vp_state, VP_FAILED);
fc_vport_set_state(vha->fc_vport, fc_vport_set_state(vha->fc_vport,
FC_VPORT_FAILED); FC_VPORT_FAILED);
qla2x00_mark_all_devices_lost(vha, 1); qla2x00_mark_all_devices_lost(vha);
} }
vha->flags.management_server_logged_in = 0; vha->flags.management_server_logged_in = 0;
...@@ -2745,7 +2744,6 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) ...@@ -2745,7 +2744,6 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
port_state_str[FCS_ONLINE], port_state_str[FCS_ONLINE],
comp_status); comp_status);
qla2x00_mark_device_lost(fcport->vha, fcport, 1, 1);
qlt_schedule_sess_for_deletion(fcport); qlt_schedule_sess_for_deletion(fcport);
} }
......
...@@ -147,7 +147,7 @@ qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha) ...@@ -147,7 +147,7 @@ qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha)
"Marking port dead, loop_id=0x%04x : %x.\n", "Marking port dead, loop_id=0x%04x : %x.\n",
fcport->loop_id, fcport->vha->vp_idx); fcport->loop_id, fcport->vha->vp_idx);
qla2x00_mark_device_lost(vha, fcport, 0, 0); qla2x00_mark_device_lost(vha, fcport, 0);
qla2x00_set_fcport_state(fcport, FCS_UNCONFIGURED); qla2x00_set_fcport_state(fcport, FCS_UNCONFIGURED);
} }
} }
...@@ -167,7 +167,7 @@ qla24xx_disable_vp(scsi_qla_host_t *vha) ...@@ -167,7 +167,7 @@ qla24xx_disable_vp(scsi_qla_host_t *vha)
list_for_each_entry(fcport, &vha->vp_fcports, list) list_for_each_entry(fcport, &vha->vp_fcports, list)
fcport->logout_on_delete = 0; fcport->logout_on_delete = 0;
qla2x00_mark_all_devices_lost(vha, 0); qla2x00_mark_all_devices_lost(vha);
/* Remove port id from vp target map */ /* Remove port id from vp target map */
spin_lock_irqsave(&vha->hw->hardware_lock, flags); spin_lock_irqsave(&vha->hw->hardware_lock, flags);
...@@ -327,7 +327,7 @@ qla2x00_vp_abort_isp(scsi_qla_host_t *vha) ...@@ -327,7 +327,7 @@ qla2x00_vp_abort_isp(scsi_qla_host_t *vha)
*/ */
if (atomic_read(&vha->loop_state) != LOOP_DOWN) { if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_state, LOOP_DOWN);
qla2x00_mark_all_devices_lost(vha, 0); qla2x00_mark_all_devices_lost(vha);
} else { } else {
if (!atomic_read(&vha->loop_down_timer)) if (!atomic_read(&vha->loop_down_timer))
atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
......
...@@ -1210,7 +1210,7 @@ qlafx00_find_all_targets(scsi_qla_host_t *vha, ...@@ -1210,7 +1210,7 @@ qlafx00_find_all_targets(scsi_qla_host_t *vha,
" Existing TGT-ID %x did not get " " Existing TGT-ID %x did not get "
" offline event from firmware.\n", " offline event from firmware.\n",
fcport->old_tgt_id); fcport->old_tgt_id);
qla2x00_mark_device_lost(vha, fcport, 0, 0); qla2x00_mark_device_lost(vha, fcport, 0);
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
kfree(new_fcport); kfree(new_fcport);
return rval; return rval;
...@@ -1274,7 +1274,7 @@ qlafx00_configure_all_targets(scsi_qla_host_t *vha) ...@@ -1274,7 +1274,7 @@ qlafx00_configure_all_targets(scsi_qla_host_t *vha)
if (atomic_read(&fcport->state) == FCS_DEVICE_LOST) { if (atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
if (fcport->port_type != FCT_INITIATOR) if (fcport->port_type != FCT_INITIATOR)
qla2x00_mark_device_lost(vha, fcport, 0, 0); qla2x00_mark_device_lost(vha, fcport, 0);
} }
} }
...@@ -1706,7 +1706,7 @@ qlafx00_tgt_detach(struct scsi_qla_host *vha, int tgt_id) ...@@ -1706,7 +1706,7 @@ qlafx00_tgt_detach(struct scsi_qla_host *vha, int tgt_id)
if (!fcport) if (!fcport)
return; return;
qla2x00_mark_device_lost(vha, fcport, 0, 0); qla2x00_mark_device_lost(vha, fcport, 0);
return; return;
} }
...@@ -1740,7 +1740,7 @@ qlafx00_process_aen(struct scsi_qla_host *vha, struct qla_work_evt *evt) ...@@ -1740,7 +1740,7 @@ qlafx00_process_aen(struct scsi_qla_host *vha, struct qla_work_evt *evt)
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
} else if (evt->u.aenfx.mbx[2] == 2) { } else if (evt->u.aenfx.mbx[2] == 2) {
vha->device_flags |= DFLG_NO_CABLE; vha->device_flags |= DFLG_NO_CABLE;
qla2x00_mark_all_devices_lost(vha, 1); qla2x00_mark_all_devices_lost(vha);
} }
} }
break; break;
...@@ -2513,7 +2513,7 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) ...@@ -2513,7 +2513,7 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
atomic_read(&fcport->state)); atomic_read(&fcport->state));
if (atomic_read(&fcport->state) == FCS_ONLINE) if (atomic_read(&fcport->state) == FCS_ONLINE)
qla2x00_mark_device_lost(fcport->vha, fcport, 1, 1); qla2x00_mark_device_lost(fcport->vha, fcport, 1);
break; break;
case CS_ABORTED: case CS_ABORTED:
......
...@@ -3030,7 +3030,7 @@ qla8xxx_dev_failed_handler(scsi_qla_host_t *vha) ...@@ -3030,7 +3030,7 @@ qla8xxx_dev_failed_handler(scsi_qla_host_t *vha)
/* Set DEV_FAILED flag to disable timer */ /* Set DEV_FAILED flag to disable timer */
vha->device_flags |= DFLG_DEV_FAILED; vha->device_flags |= DFLG_DEV_FAILED;
qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16); qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16);
qla2x00_mark_all_devices_lost(vha, 0); qla2x00_mark_all_devices_lost(vha);
vha->flags.online = 0; vha->flags.online = 0;
vha->flags.init_done = 0; vha->flags.init_done = 0;
} }
......
...@@ -1110,7 +1110,7 @@ qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha) ...@@ -1110,7 +1110,7 @@ qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha)
{ {
u8 i; u8 i;
qla2x00_mark_all_devices_lost(vha, 0); qla2x00_mark_all_devices_lost(vha);
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
if (wait_event_timeout(vha->fcport_waitQ, if (wait_event_timeout(vha->fcport_waitQ,
...@@ -1667,7 +1667,7 @@ qla2x00_loop_reset(scsi_qla_host_t *vha) ...@@ -1667,7 +1667,7 @@ qla2x00_loop_reset(scsi_qla_host_t *vha)
if (ha->flags.enable_lip_full_login && !IS_CNA_CAPABLE(ha)) { if (ha->flags.enable_lip_full_login && !IS_CNA_CAPABLE(ha)) {
atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_state, LOOP_DOWN);
atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
qla2x00_mark_all_devices_lost(vha, 0); qla2x00_mark_all_devices_lost(vha);
ret = qla2x00_full_login_lip(vha); ret = qla2x00_full_login_lip(vha);
if (ret != QLA_SUCCESS) { if (ret != QLA_SUCCESS) {
ql_dbg(ql_dbg_taskm, vha, 0x802d, ql_dbg(ql_dbg_taskm, vha, 0x802d,
...@@ -3854,37 +3854,21 @@ void qla2x00_free_fcports(struct scsi_qla_host *vha) ...@@ -3854,37 +3854,21 @@ void qla2x00_free_fcports(struct scsi_qla_host *vha)
} }
static inline void static inline void
qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport, qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport)
int defer)
{ {
struct fc_rport *rport; int now;
scsi_qla_host_t *base_vha;
unsigned long flags;
if (!fcport->rport) if (!fcport->rport)
return; return;
rport = fcport->rport; if (fcport->rport) {
if (defer) { ql_dbg(ql_dbg_disc, fcport->vha, 0x2109,
base_vha = pci_get_drvdata(vha->hw->pdev); "%s %8phN. rport %p roles %x\n",
spin_lock_irqsave(vha->host->host_lock, flags); __func__, fcport->port_name, fcport->rport,
fcport->drport = rport; fcport->rport->roles);
spin_unlock_irqrestore(vha->host->host_lock, flags); fc_remote_port_delete(fcport->rport);
qlt_do_generation_tick(vha, &base_vha->total_fcport_update_gen);
set_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags);
qla2xxx_wake_dpc(base_vha);
} else {
int now;
if (rport) {
ql_dbg(ql_dbg_disc, fcport->vha, 0x2109,
"%s %8phN. rport %p roles %x\n",
__func__, fcport->port_name, rport,
rport->roles);
fc_remote_port_delete(rport);
}
qlt_do_generation_tick(vha, &now);
} }
qlt_do_generation_tick(vha, &now);
} }
/* /*
...@@ -3897,18 +3881,18 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport, ...@@ -3897,18 +3881,18 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport,
* Context: * Context:
*/ */
void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport, void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport,
int do_login, int defer) int do_login)
{ {
if (IS_QLAFX00(vha->hw)) { if (IS_QLAFX00(vha->hw)) {
qla2x00_set_fcport_state(fcport, FCS_DEVICE_LOST); qla2x00_set_fcport_state(fcport, FCS_DEVICE_LOST);
qla2x00_schedule_rport_del(vha, fcport, defer); qla2x00_schedule_rport_del(vha, fcport);
return; return;
} }
if (atomic_read(&fcport->state) == FCS_ONLINE && if (atomic_read(&fcport->state) == FCS_ONLINE &&
vha->vp_idx == fcport->vha->vp_idx) { vha->vp_idx == fcport->vha->vp_idx) {
qla2x00_set_fcport_state(fcport, FCS_DEVICE_LOST); qla2x00_set_fcport_state(fcport, FCS_DEVICE_LOST);
qla2x00_schedule_rport_del(vha, fcport, defer); qla2x00_schedule_rport_del(vha, fcport);
} }
/* /*
* We may need to retry the login, so don't change the state of the * We may need to retry the login, so don't change the state of the
...@@ -3937,7 +3921,7 @@ void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport, ...@@ -3937,7 +3921,7 @@ void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport,
* Context: * Context:
*/ */
void void
qla2x00_mark_all_devices_lost(scsi_qla_host_t *vha, int defer) qla2x00_mark_all_devices_lost(scsi_qla_host_t *vha)
{ {
fc_port_t *fcport; fc_port_t *fcport;
...@@ -3957,13 +3941,6 @@ qla2x00_mark_all_devices_lost(scsi_qla_host_t *vha, int defer) ...@@ -3957,13 +3941,6 @@ qla2x00_mark_all_devices_lost(scsi_qla_host_t *vha, int defer)
*/ */
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD) if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD)
continue; continue;
if (atomic_read(&fcport->state) == FCS_ONLINE) {
qla2x00_set_fcport_state(fcport, FCS_DEVICE_LOST);
if (defer)
qla2x00_schedule_rport_del(vha, fcport, defer);
else if (vha->vp_idx == fcport->vha->vp_idx)
qla2x00_schedule_rport_del(vha, fcport, defer);
}
} }
} }
...@@ -6899,13 +6876,13 @@ static void qla_pci_error_cleanup(scsi_qla_host_t *vha) ...@@ -6899,13 +6876,13 @@ static void qla_pci_error_cleanup(scsi_qla_host_t *vha)
qpair->online = 0; qpair->online = 0;
mutex_unlock(&ha->mq_lock); mutex_unlock(&ha->mq_lock);
qla2x00_mark_all_devices_lost(vha, 0); qla2x00_mark_all_devices_lost(vha);
spin_lock_irqsave(&ha->vport_slock, flags); spin_lock_irqsave(&ha->vport_slock, flags);
list_for_each_entry(vp, &ha->vp_list, list) { list_for_each_entry(vp, &ha->vp_list, list) {
atomic_inc(&vp->vref_count); atomic_inc(&vp->vref_count);
spin_unlock_irqrestore(&ha->vport_slock, flags); spin_unlock_irqrestore(&ha->vport_slock, flags);
qla2x00_mark_all_devices_lost(vp, 0); qla2x00_mark_all_devices_lost(vp);
spin_lock_irqsave(&ha->vport_slock, flags); spin_lock_irqsave(&ha->vport_slock, flags);
atomic_dec(&vp->vref_count); atomic_dec(&vp->vref_count);
} }
......
...@@ -966,7 +966,7 @@ void qlt_free_session_done(struct work_struct *work) ...@@ -966,7 +966,7 @@ void qlt_free_session_done(struct work_struct *work)
sess->send_els_logo); sess->send_els_logo);
if (!IS_SW_RESV_ADDR(sess->d_id)) { if (!IS_SW_RESV_ADDR(sess->d_id)) {
qla2x00_mark_device_lost(vha, sess, 0, 0); qla2x00_mark_device_lost(vha, sess, 0);
if (sess->send_els_logo) { if (sess->send_els_logo) {
qlt_port_logo_t logo; qlt_port_logo_t logo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment