|
|
3c6e85 |
From fb71549041f959dd080132f4d38be15bcacb891e Mon Sep 17 00:00:00 2001
|
|
|
3c6e85 |
From: Himanshu Madhani <hmadhani@redhat.com>
|
|
|
3c6e85 |
Date: Thu, 1 Aug 2019 15:56:16 -0400
|
|
|
3c6e85 |
Subject: [PATCH 116/124] [scsi] scsi: qla2xxx: Fix Relogin to prevent
|
|
|
3c6e85 |
modifying scan_state flag
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Message-id: <20190801155618.12650-117-hmadhani@redhat.com>
|
|
|
3c6e85 |
Patchwork-id: 267879
|
|
|
3c6e85 |
O-Subject: [RHEL 7.8 e-stor PATCH 116/118] scsi: qla2xxx: Fix Relogin to prevent modifying scan_state flag
|
|
|
3c6e85 |
Bugzilla: 1729270
|
|
|
3c6e85 |
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
|
|
|
3c6e85 |
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
|
|
|
3c6e85 |
|
|
|
3c6e85 |
From: Quinn Tran <qutran@marvell.com>
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Bugzilla 1729270
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Relogin fails to move forward due to scan_state flag indicating device is
|
|
|
3c6e85 |
not there. Before relogin process, Session delete process accidently
|
|
|
3c6e85 |
modified the scan_state flag.
|
|
|
3c6e85 |
|
|
|
3c6e85 |
[mkp: typos]
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Fixes: 79140e2f4fa7 ("scsi: qla2xxx: Fix login state machine freeze")
|
|
|
3c6e85 |
Cc: stable@vger.kernel.org
|
|
|
3c6e85 |
Signed-off-by: Quinn Tran <qutran@marvell.com>
|
|
|
3c6e85 |
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
|
|
|
3c6e85 |
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
|
|
|
3c6e85 |
(cherry picked from commit d31ca849b04a6d0434e0835bee1f43bd162e4344)
|
|
|
3c6e85 |
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
|
|
|
3c6e85 |
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
|
3c6e85 |
---
|
|
|
3c6e85 |
drivers/scsi/qla2xxx/qla_init.c | 25 ++++++++++++++++++++-----
|
|
|
3c6e85 |
drivers/scsi/qla2xxx/qla_os.c | 1 +
|
|
|
3c6e85 |
drivers/scsi/qla2xxx/qla_target.c | 1 -
|
|
|
3c6e85 |
3 files changed, 21 insertions(+), 6 deletions(-)
|
|
|
3c6e85 |
|
|
|
3c6e85 |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
|
|
|
3c6e85 |
index 65d8b8faadba..d04dec910dc3 100644
|
|
|
3c6e85 |
--- a/drivers/scsi/qla2xxx/qla_init.c
|
|
|
3c6e85 |
+++ b/drivers/scsi/qla2xxx/qla_init.c
|
|
|
3c6e85 |
@@ -216,8 +216,13 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport,
|
|
|
3c6e85 |
struct srb_iocb *lio;
|
|
|
3c6e85 |
int rval = QLA_FUNCTION_FAILED;
|
|
|
3c6e85 |
|
|
|
3c6e85 |
- if (!vha->flags.online)
|
|
|
3c6e85 |
- goto done;
|
|
|
3c6e85 |
+ if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT) ||
|
|
|
3c6e85 |
+ fcport->loop_id == FC_NO_LOOP_ID) {
|
|
|
3c6e85 |
+ ql_log(ql_log_warn, vha, 0xffff,
|
|
|
3c6e85 |
+ "%s: %8phC - not sending command.\n",
|
|
|
3c6e85 |
+ __func__, fcport->port_name);
|
|
|
3c6e85 |
+ return rval;
|
|
|
3c6e85 |
+ }
|
|
|
3c6e85 |
|
|
|
3c6e85 |
sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
|
|
|
3c6e85 |
if (!sp)
|
|
|
3c6e85 |
@@ -1186,8 +1191,13 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)
|
|
|
3c6e85 |
struct port_database_24xx *pd;
|
|
|
3c6e85 |
struct qla_hw_data *ha = vha->hw;
|
|
|
3c6e85 |
|
|
|
3c6e85 |
- if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
|
|
|
3c6e85 |
+ if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT) ||
|
|
|
3c6e85 |
+ fcport->loop_id == FC_NO_LOOP_ID) {
|
|
|
3c6e85 |
+ ql_log(ql_log_warn, vha, 0xffff,
|
|
|
3c6e85 |
+ "%s: %8phC - not sending command.\n",
|
|
|
3c6e85 |
+ __func__, fcport->port_name);
|
|
|
3c6e85 |
return rval;
|
|
|
3c6e85 |
+ }
|
|
|
3c6e85 |
|
|
|
3c6e85 |
fcport->disc_state = DSC_GPDB;
|
|
|
3c6e85 |
|
|
|
3c6e85 |
@@ -1967,8 +1977,11 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
|
|
|
3c6e85 |
return;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
- if (fcport->disc_state == DSC_DELETE_PEND)
|
|
|
3c6e85 |
+ if ((fcport->disc_state == DSC_DELETE_PEND) ||
|
|
|
3c6e85 |
+ (fcport->disc_state == DSC_DELETED)) {
|
|
|
3c6e85 |
+ set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
|
|
|
3c6e85 |
return;
|
|
|
3c6e85 |
+ }
|
|
|
3c6e85 |
|
|
|
3c6e85 |
if (ea->sp->gen2 != fcport->login_gen) {
|
|
|
3c6e85 |
/* target side must have changed it. */
|
|
|
3c6e85 |
@@ -6728,8 +6741,10 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha)
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
/* Clear all async request states across all VPs. */
|
|
|
3c6e85 |
- list_for_each_entry(fcport, &vha->vp_fcports, list)
|
|
|
3c6e85 |
+ list_for_each_entry(fcport, &vha->vp_fcports, list) {
|
|
|
3c6e85 |
fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT);
|
|
|
3c6e85 |
+ fcport->scan_state = 0;
|
|
|
3c6e85 |
+ }
|
|
|
3c6e85 |
spin_lock_irqsave(&ha->vport_slock, flags);
|
|
|
3c6e85 |
list_for_each_entry(vp, &ha->vp_list, list) {
|
|
|
3c6e85 |
atomic_inc(&vp->vref_count);
|
|
|
3c6e85 |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
|
|
|
3c6e85 |
index 2e96a41839e0..fee4975787ec 100644
|
|
|
3c6e85 |
--- a/drivers/scsi/qla2xxx/qla_os.c
|
|
|
3c6e85 |
+++ b/drivers/scsi/qla2xxx/qla_os.c
|
|
|
3c6e85 |
@@ -5218,6 +5218,7 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e)
|
|
|
3c6e85 |
if (fcport) {
|
|
|
3c6e85 |
fcport->id_changed = 1;
|
|
|
3c6e85 |
fcport->scan_state = QLA_FCPORT_FOUND;
|
|
|
3c6e85 |
+ fcport->chip_reset = vha->hw->base_qpair->chip_reset;
|
|
|
3c6e85 |
memcpy(fcport->node_name, e->u.new_sess.node_name, WWN_SIZE);
|
|
|
3c6e85 |
|
|
|
3c6e85 |
if (pla) {
|
|
|
3c6e85 |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
|
|
|
3c6e85 |
index 9e16a97f8fcb..cb205c7a3a62 100644
|
|
|
3c6e85 |
--- a/drivers/scsi/qla2xxx/qla_target.c
|
|
|
3c6e85 |
+++ b/drivers/scsi/qla2xxx/qla_target.c
|
|
|
3c6e85 |
@@ -1217,7 +1217,6 @@ static void qla24xx_chk_fcp_state(struct fc_port *sess)
|
|
|
3c6e85 |
sess->logout_on_delete = 0;
|
|
|
3c6e85 |
sess->logo_ack_needed = 0;
|
|
|
3c6e85 |
sess->fw_login_state = DSC_LS_PORT_UNAVAIL;
|
|
|
3c6e85 |
- sess->scan_state = 0;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
--
|
|
|
3c6e85 |
2.13.6
|
|
|
3c6e85 |
|