Commit c02aada0 authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Fix hang due to session stuck

User experienced device lost. The log shows Get port data base command was
queued up, failed, and requeued again. Every time it is requeued, it set
the FCF_ASYNC_ACTIVE. This prevents any recovery code from occurring
because driver thinks a recovery is in progress for this session. In
essence, this session is hung.  The reason it gets into this place is the
session deletion got in front of this call due to link perturbation.

Break the requeue cycle and exit.  The session deletion code will trigger a
session relogin.

Link: https://lore.kernel.org/r/20220310092604.22950-8-njavali@marvell.com
Fixes: 726b8548 ("qla2xxx: Add framework for async fabric discovery")
Cc: stable@vger.kernel.org
Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarQuinn Tran <qutran@marvell.com>
Signed-off-by: default avatarNilesh Javali <njavali@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c13ce47c
...@@ -5438,4 +5438,8 @@ struct ql_vnd_tgt_stats_resp { ...@@ -5438,4 +5438,8 @@ struct ql_vnd_tgt_stats_resp {
#include "qla_gbl.h" #include "qla_gbl.h"
#include "qla_dbg.h" #include "qla_dbg.h"
#include "qla_inline.h" #include "qla_inline.h"
#define IS_SESSION_DELETED(_fcport) (_fcport->disc_state == DSC_DELETE_PEND || \
_fcport->disc_state == DSC_DELETED)
#endif #endif
...@@ -575,6 +575,14 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, ...@@ -575,6 +575,14 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport,
struct srb_iocb *lio; struct srb_iocb *lio;
int rval = QLA_FUNCTION_FAILED; int rval = QLA_FUNCTION_FAILED;
if (IS_SESSION_DELETED(fcport)) {
ql_log(ql_log_warn, vha, 0xffff,
"%s: %8phC is being delete - not sending command.\n",
__func__, fcport->port_name);
fcport->flags &= ~FCF_ASYNC_ACTIVE;
return rval;
}
if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
return rval; return rval;
...@@ -1338,8 +1346,15 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) ...@@ -1338,8 +1346,15 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)
struct port_database_24xx *pd; struct port_database_24xx *pd;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT) || if (IS_SESSION_DELETED(fcport)) {
fcport->loop_id == FC_NO_LOOP_ID) { ql_log(ql_log_warn, vha, 0xffff,
"%s: %8phC is being delete - not sending command.\n",
__func__, fcport->port_name);
fcport->flags &= ~FCF_ASYNC_ACTIVE;
return rval;
}
if (!vha->flags.online || fcport->flags & FCF_ASYNC_SENT) {
ql_log(ql_log_warn, vha, 0xffff, ql_log(ql_log_warn, vha, 0xffff,
"%s: %8phC online %d flags %x - not sending command.\n", "%s: %8phC online %d flags %x - not sending command.\n",
__func__, fcport->port_name, vha->flags.online, fcport->flags); __func__, fcport->port_name, vha->flags.online, fcport->flags);
......
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