diff options
author | Quinn Tran <quinn.tran@cavium.com> | 2017-06-02 18:11:56 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-06-13 02:48:07 +0200 |
commit | 66ee0fece9a0b91f59a7eb8dd39808a0ef5db02b (patch) | |
tree | f14bd481fee7748119396f090182d6a45d8ae6de | |
parent | scsi: qla2xxx: Retain loop test for fwdump length exceeding buffer length (diff) | |
download | linux-66ee0fece9a0b91f59a7eb8dd39808a0ef5db02b.tar.xz linux-66ee0fece9a0b91f59a7eb8dd39808a0ef5db02b.zip |
scsi: qla2xxx: Fix path recovery
If the port is moved/changed, current code would trigger
a deletion. If the port is already deleted, then do relogin.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gs.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 9bc9aa9e164a..5acebaf57796 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3118,16 +3118,27 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) if (fcport) { /* cable moved. just plugged in */ - ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %d %8phC post del sess\n", - __func__, __LINE__, fcport->port_name); - fcport->rscn_gen++; fcport->d_id = ea->id; fcport->scan_state = QLA_FCPORT_FOUND; fcport->flags |= FCF_FABRIC_DEVICE; - qlt_schedule_sess_for_deletion_lock(fcport); + switch (fcport->disc_state) { + case DSC_DELETED: + ql_dbg(ql_dbg_disc, vha, 0x210d, + "%s %d %8phC login\n", __func__, __LINE__, + fcport->port_name); + qla24xx_fcport_handle_login(vha, fcport); + break; + case DSC_DELETE_PEND: + break; + default: + ql_dbg(ql_dbg_disc, vha, 0x2064, + "%s %d %8phC post del sess\n", + __func__, __LINE__, fcport->port_name); + qlt_schedule_sess_for_deletion_lock(fcport); + break; + } } else { /* create new fcport */ ql_dbg(ql_dbg_disc, vha, 0xffff, |