From 6ab17f59060acb65390dd48d00e62662e0237cdf Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 16 Apr 2021 10:21:35 -0400 Subject: [PATCH] Fixes for 5.4 Signed-off-by: Sasha Levin --- ...xxx-fix-stuck-login-session-using-pr.patch | 128 +++++ ...xxx-retry-plogi-on-fc-nvme-prli-fail.patch | 100 ++++ ...-a-shadow-variable-to-hold-disc_stat.patch | 364 ++++++++++++++ ...xx-dual-fcp-nvme-target-port-support.patch | 475 ++++++++++++++++++ ...-device-connect-issues-in-p2p-config.patch | 72 +++ ...-stuck-login-session-using-prli_pend.patch | 141 ++++++ ...-retry-plogi-on-fc-nvme-prli-failure.patch | 128 +++++ queue-5.4/series | 7 + 8 files changed, 1415 insertions(+) create mode 100644 queue-5.4/revert-scsi-qla2xxx-fix-stuck-login-session-using-pr.patch create mode 100644 queue-5.4/revert-scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-fail.patch create mode 100644 queue-5.4/scsi-qla2xxx-add-a-shadow-variable-to-hold-disc_stat.patch create mode 100644 queue-5.4/scsi-qla2xxx-dual-fcp-nvme-target-port-support.patch create mode 100644 queue-5.4/scsi-qla2xxx-fix-device-connect-issues-in-p2p-config.patch create mode 100644 queue-5.4/scsi-qla2xxx-fix-stuck-login-session-using-prli_pend.patch create mode 100644 queue-5.4/scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-failure.patch create mode 100644 queue-5.4/series diff --git a/queue-5.4/revert-scsi-qla2xxx-fix-stuck-login-session-using-pr.patch b/queue-5.4/revert-scsi-qla2xxx-fix-stuck-login-session-using-pr.patch new file mode 100644 index 00000000000..96c745f63b6 --- /dev/null +++ b/queue-5.4/revert-scsi-qla2xxx-fix-stuck-login-session-using-pr.patch @@ -0,0 +1,128 @@ +From 3417d93c2d4e6577d79b85599f7af98a03b8f562 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Apr 2021 09:48:48 -0400 +Subject: Revert "scsi: qla2xxx: Fix stuck login session using prli_pend_timer" + +This reverts commit 0b84591fdd5ea3ca0d93aaea489353f0381832c0. + +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla2xxx/qla_def.h | 5 ----- + drivers/scsi/qla2xxx/qla_init.c | 34 ++++++++----------------------- + drivers/scsi/qla2xxx/qla_target.c | 1 - + 3 files changed, 8 insertions(+), 32 deletions(-) + +diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h +index c57b95a20688..1eb3fe281cc3 100644 +--- a/drivers/scsi/qla2xxx/qla_def.h ++++ b/drivers/scsi/qla2xxx/qla_def.h +@@ -2402,7 +2402,6 @@ typedef struct fc_port { + unsigned int scan_needed:1; + unsigned int n2n_flag:1; + unsigned int explicit_logout:1; +- unsigned int prli_pend_timer:1; + + struct completion nvme_del_done; + uint32_t nvme_prli_service_param; +@@ -2429,7 +2428,6 @@ typedef struct fc_port { + struct work_struct free_work; + struct work_struct reg_work; + uint64_t jiffies_at_registration; +- unsigned long prli_expired; + struct qlt_plogi_ack_t *plogi_link[QLT_PLOGI_LINK_MAX]; + + uint16_t tgt_id; +@@ -4823,9 +4821,6 @@ struct sff_8247_a0 { + ha->current_topology == ISP_CFG_N || \ + !ha->current_topology) + +-#define PRLI_PHASE(_cls) \ +- ((_cls == DSC_LS_PRLI_PEND) || (_cls == DSC_LS_PRLI_COMP)) +- + #include "qla_target.h" + #include "qla_gbl.h" + #include "qla_dbg.h" +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c +index 05a22fb17e52..5305c914b0a4 100644 +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -696,7 +696,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, + port_id_t id; + u64 wwn; + u16 data[2]; +- u8 current_login_state, nvme_cls; ++ u8 current_login_state; + + fcport = ea->fcport; + ql_dbg(ql_dbg_disc, vha, 0xffff, +@@ -755,17 +755,10 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, + + loop_id = le16_to_cpu(e->nport_handle); + loop_id = (loop_id & 0x7fff); +- nvme_cls = e->current_login_state >> 4; +- current_login_state = e->current_login_state & 0xf; +- +- if (PRLI_PHASE(nvme_cls)) { +- current_login_state = nvme_cls; +- fcport->fc4_type &= ~FS_FC4TYPE_FCP; +- fcport->fc4_type |= FS_FC4TYPE_NVME; +- } else if (PRLI_PHASE(current_login_state)) { +- fcport->fc4_type |= FS_FC4TYPE_FCP; +- fcport->fc4_type &= ~FS_FC4TYPE_NVME; +- } ++ if (fcport->fc4f_nvme) ++ current_login_state = e->current_login_state >> 4; ++ else ++ current_login_state = e->current_login_state & 0xf; + + + ql_dbg(ql_dbg_disc, vha, 0x20e2, +@@ -1246,19 +1239,12 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) + struct srb_iocb *lio; + int rval = QLA_FUNCTION_FAILED; + +- if (!vha->flags.online) { +- ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC exit\n", +- __func__, __LINE__, fcport->port_name); ++ if (!vha->flags.online) + return rval; +- } + +- if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND || +- fcport->fw_login_state == DSC_LS_PRLI_PEND) && +- qla_dual_mode_enabled(vha)) { +- ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC exit\n", +- __func__, __LINE__, fcport->port_name); ++ if (fcport->fw_login_state == DSC_LS_PLOGI_PEND || ++ fcport->fw_login_state == DSC_LS_PRLI_PEND) + return rval; +- } + + sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); + if (!sp) +@@ -1636,10 +1622,6 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) + break; + default: + if (fcport->login_pause) { +- ql_dbg(ql_dbg_disc, vha, 0x20d8, +- "%s %d %8phC exit\n", +- __func__, __LINE__, +- fcport->port_name); + fcport->last_rscn_gen = fcport->rscn_gen; + fcport->last_login_gen = fcport->login_gen; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); +diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c +index 8fd0a568303b..5dbdae1f65af 100644 +--- a/drivers/scsi/qla2xxx/qla_target.c ++++ b/drivers/scsi/qla2xxx/qla_target.c +@@ -1267,7 +1267,6 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) + sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; + spin_unlock_irqrestore(&sess->vha->work_lock, flags); + +- sess->prli_pend_timer = 0; + sess->disc_state = DSC_DELETE_PEND; + + qla24xx_chk_fcp_state(sess); +-- +2.30.2 + diff --git a/queue-5.4/revert-scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-fail.patch b/queue-5.4/revert-scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-fail.patch new file mode 100644 index 00000000000..7b4bc19730f --- /dev/null +++ b/queue-5.4/revert-scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-fail.patch @@ -0,0 +1,100 @@ +From 66c4563cb42ec0815ddc2f97d1f26f38ce9e0d90 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Apr 2021 09:48:38 -0400 +Subject: Revert "scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure" + +This reverts commit 74924e407bf74667b07430f785a104371be097af. + +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla2xxx/qla_init.c | 28 ++++++++++++++++++++++++---- + drivers/scsi/qla2xxx/qla_iocb.c | 6 +----- + 2 files changed, 25 insertions(+), 9 deletions(-) + +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c +index b300e1109582..05a22fb17e52 100644 +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -1921,13 +1921,33 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) + "%s %d %8phC post fc4 prli\n", + __func__, __LINE__, ea->fcport->port_name); + ea->fcport->fc4f_nvme = 0; ++ qla24xx_post_prli_work(vha, ea->fcport); + return; + } + +- ea->fcport->flags &= ~FCF_ASYNC_SENT; +- ea->fcport->keep_nport_handle = 0; +- ea->fcport->logout_on_delete = 1; +- qlt_schedule_sess_for_deletion(ea->fcport); ++ /* at this point both PRLI NVME & PRLI FCP failed */ ++ if (N2N_TOPO(vha->hw)) { ++ if (ea->fcport->n2n_link_reset_cnt < 3) { ++ ea->fcport->n2n_link_reset_cnt++; ++ /* ++ * remote port is not sending Plogi. Reset ++ * link to kick start his state machine ++ */ ++ set_bit(N2N_LINK_RESET, &vha->dpc_flags); ++ } else { ++ ql_log(ql_log_warn, vha, 0x2119, ++ "%s %d %8phC Unable to reconnect\n", ++ __func__, __LINE__, ea->fcport->port_name); ++ } ++ } else { ++ /* ++ * switch connect. login failed. Take connection ++ * down and allow relogin to retrigger ++ */ ++ ea->fcport->flags &= ~FCF_ASYNC_SENT; ++ ea->fcport->keep_nport_handle = 0; ++ qlt_schedule_sess_for_deletion(ea->fcport); ++ } + break; + } + } +diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c +index aed4ce66e6cf..2e272fc858ed 100644 +--- a/drivers/scsi/qla2xxx/qla_iocb.c ++++ b/drivers/scsi/qla2xxx/qla_iocb.c +@@ -2773,7 +2773,6 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) + ea.sp = sp; + qla24xx_handle_plogi_done_event(vha, &ea); + break; +- + case CS_IOCB_ERROR: + switch (fw_status[1]) { + case LSC_SCODE_PORTID_USED: +@@ -2844,7 +2843,6 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) + fw_status[0], fw_status[1], fw_status[2]); + + fcport->flags &= ~FCF_ASYNC_SENT; +- fcport->disc_state = DSC_LOGIN_FAILED; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + break; + } +@@ -2857,7 +2855,6 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) + fw_status[0], fw_status[1], fw_status[2]); + + sp->fcport->flags &= ~FCF_ASYNC_SENT; +- sp->fcport->disc_state = DSC_LOGIN_FAILED; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + break; + } +@@ -2893,12 +2890,11 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, + return -ENOMEM; + } + +- fcport->flags |= FCF_ASYNC_SENT; +- fcport->disc_state = DSC_LOGIN_PEND; + elsio = &sp->u.iocb_cmd; + ql_dbg(ql_dbg_io, vha, 0x3073, + "Enter: PLOGI portid=%06x\n", fcport->d_id.b24); + ++ fcport->flags |= FCF_ASYNC_SENT; + sp->type = SRB_ELS_DCMD; + sp->name = "ELS_DCMD"; + sp->fcport = fcport; +-- +2.30.2 + diff --git a/queue-5.4/scsi-qla2xxx-add-a-shadow-variable-to-hold-disc_stat.patch b/queue-5.4/scsi-qla2xxx-add-a-shadow-variable-to-hold-disc_stat.patch new file mode 100644 index 00000000000..473d8ce1a18 --- /dev/null +++ b/queue-5.4/scsi-qla2xxx-add-a-shadow-variable-to-hold-disc_stat.patch @@ -0,0 +1,364 @@ +From 2a2346e9fb9df53fb793af8ded6e727f0677601d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Dec 2019 14:06:06 -0800 +Subject: scsi: qla2xxx: Add a shadow variable to hold disc_state history of + fcport + +From: Shyam Sundar + +[ Upstream commit 27258a5771446f9c7edc929ecb76fe2c12c29d97 ] + +This patch adds a shadow variable to hold disc_state history for the fcport +and prints state transition when the logging is enabled. + +Link: https://lore.kernel.org/r/20191217220617.28084-4-hmadhani@marvell.com +Signed-off-by: Shyam Sundar +Signed-off-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla2xxx/qla_dbg.c | 2 +- + drivers/scsi/qla2xxx/qla_def.h | 14 ++++++++++++++ + drivers/scsi/qla2xxx/qla_gbl.h | 1 + + drivers/scsi/qla2xxx/qla_gs.c | 2 +- + drivers/scsi/qla2xxx/qla_init.c | 29 +++++++++++++++-------------- + drivers/scsi/qla2xxx/qla_inline.h | 24 ++++++++++++++++++++++++ + drivers/scsi/qla2xxx/qla_iocb.c | 7 ++++--- + drivers/scsi/qla2xxx/qla_os.c | 2 +- + drivers/scsi/qla2xxx/qla_target.c | 11 ++++++----- + 9 files changed, 67 insertions(+), 25 deletions(-) + +diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c +index 7bbff91f8883..88a56e8480f7 100644 +--- a/drivers/scsi/qla2xxx/qla_dbg.c ++++ b/drivers/scsi/qla2xxx/qla_dbg.c +@@ -18,7 +18,7 @@ + * | Device Discovery | 0x2134 | 0x210e-0x2116 | + * | | | 0x211a | + * | | | 0x211c-0x2128 | +- * | | | 0x212a-0x2130 | ++ * | | | 0x212a-0x2134 | + * | Queue Command and IO tracing | 0x3074 | 0x300b | + * | | | 0x3027-0x3028 | + * | | | 0x303d-0x3041 | +diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h +index 894c2716b7ce..5e940543eaa1 100644 +--- a/drivers/scsi/qla2xxx/qla_def.h ++++ b/drivers/scsi/qla2xxx/qla_def.h +@@ -2464,6 +2464,7 @@ typedef struct fc_port { + struct qla_tgt_sess *tgt_session; + struct ct_sns_desc ct_desc; + enum discovery_state disc_state; ++ atomic_t shadow_disc_state; + enum discovery_state next_disc_state; + enum login_state fw_login_state; + unsigned long dm_login_expire; +@@ -2508,6 +2509,19 @@ struct event_arg { + + extern const char *const port_state_str[5]; + ++static const char * const port_dstate_str[] = { ++ "DELETED", ++ "GNN_ID", ++ "GNL", ++ "LOGIN_PEND", ++ "LOGIN_FAILED", ++ "GPDB", ++ "UPD_FCPORT", ++ "LOGIN_COMPLETE", ++ "ADISC", ++ "DELETE_PEND" ++}; ++ + /* + * FC port flags. + */ +diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h +index 5b163ad85c34..5a3c47eed645 100644 +--- a/drivers/scsi/qla2xxx/qla_gbl.h ++++ b/drivers/scsi/qla2xxx/qla_gbl.h +@@ -80,6 +80,7 @@ extern int qla24xx_async_gnl(struct scsi_qla_host *, fc_port_t *); + int qla2x00_post_work(struct scsi_qla_host *vha, struct qla_work_evt *e); + extern void *qla2x00_alloc_iocbs_ready(struct qla_qpair *, srb_t *); + extern int qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *, fc_port_t *); ++extern int qla24xx_async_abort_cmd(srb_t *, bool); + + extern void qla2x00_set_fcport_state(fc_port_t *fcport, int state); + extern fc_port_t * +diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c +index ae13aabf280b..d9b5ea77fde9 100644 +--- a/drivers/scsi/qla2xxx/qla_gs.c ++++ b/drivers/scsi/qla2xxx/qla_gs.c +@@ -4290,7 +4290,7 @@ int qla24xx_async_gnnid(scsi_qla_host_t *vha, fc_port_t *fcport) + if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) + return rval; + +- fcport->disc_state = DSC_GNN_ID; ++ qla2x00_set_fcport_disc_state(fcport, DSC_GNN_ID); + sp = qla2x00_get_sp(vha, fcport, GFP_ATOMIC); + if (!sp) + goto done; +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c +index 5d2d0c287469..0aac1eb1e013 100644 +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -337,10 +337,10 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, + if (!sp) + goto done; + ++ qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_PEND); + fcport->flags |= FCF_ASYNC_SENT; + fcport->logout_completed = 0; + +- fcport->disc_state = DSC_LOGIN_PEND; + sp->type = SRB_LOGIN_CMD; + sp->name = "login"; + sp->gen1 = fcport->rscn_gen; +@@ -544,7 +544,7 @@ static int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport) + + e->u.fcport.fcport = fcport; + fcport->flags |= FCF_ASYNC_ACTIVE; +- fcport->disc_state = DSC_LOGIN_PEND; ++ qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_PEND); + return qla2x00_post_work(vha, e); + } + +@@ -847,7 +847,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, + * with GNL. Push disc_state back to DELETED + * so GNL can go out again + */ +- fcport->disc_state = DSC_DELETED; ++ qla2x00_set_fcport_disc_state(fcport, ++ DSC_DELETED); + break; + case DSC_LS_PRLI_COMP: + if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) +@@ -923,7 +924,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, + qla24xx_fcport_handle_login(vha, fcport); + break; + case ISP_CFG_N: +- fcport->disc_state = DSC_DELETED; ++ qla2x00_set_fcport_disc_state(fcport, DSC_DELETED); + if (time_after_eq(jiffies, fcport->dm_login_expire)) { + if (fcport->n2n_link_reset_cnt < 2) { + fcport->n2n_link_reset_cnt++; +@@ -1093,7 +1094,7 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) + + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); + fcport->flags |= FCF_ASYNC_SENT; +- fcport->disc_state = DSC_GNL; ++ qla2x00_set_fcport_disc_state(fcport, DSC_GNL); + fcport->last_rscn_gen = fcport->rscn_gen; + fcport->last_login_gen = fcport->login_gen; + +@@ -1316,12 +1317,12 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) + return rval; + } + +- fcport->disc_state = DSC_GPDB; +- + sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); + if (!sp) + goto done; + ++ qla2x00_set_fcport_disc_state(fcport, DSC_GPDB); ++ + fcport->flags |= FCF_ASYNC_SENT; + sp->type = SRB_MB_IOCB; + sp->name = "gpdb"; +@@ -1400,7 +1401,7 @@ void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) + ql_dbg(ql_dbg_disc, vha, 0x20d6, + "%s %d %8phC session revalidate success\n", + __func__, __LINE__, ea->fcport->port_name); +- ea->fcport->disc_state = DSC_LOGIN_COMPLETE; ++ qla2x00_set_fcport_disc_state(ea->fcport, DSC_LOGIN_COMPLETE); + } + spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); + } +@@ -1454,7 +1455,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) + /* Set discovery state back to GNL to Relogin attempt */ + if (qla_dual_mode_enabled(vha) || + qla_ini_mode_enabled(vha)) { +- fcport->disc_state = DSC_GNL; ++ qla2x00_set_fcport_disc_state(fcport, DSC_GNL); + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + } + return; +@@ -2013,7 +2014,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) + __func__, __LINE__, ea->fcport->port_name, ea->data[1]); + + ea->fcport->flags &= ~FCF_ASYNC_SENT; +- ea->fcport->disc_state = DSC_LOGIN_FAILED; ++ qla2x00_set_fcport_disc_state(ea->fcport, DSC_LOGIN_FAILED); + if (ea->data[1] & QLA_LOGIO_LOGIN_RETRIED) + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + else +@@ -5393,7 +5394,7 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) + ql_dbg(ql_dbg_disc, vha, 0x20ef, "%s %8phC\n", + __func__, fcport->port_name); + +- fcport->disc_state = DSC_UPD_FCPORT; ++ qla2x00_set_fcport_disc_state(fcport, DSC_UPD_FCPORT); + fcport->login_retry = vha->hw->login_retry_count; + fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); + fcport->deleted = 0; +@@ -5413,7 +5414,7 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) + + if (NVME_TARGET(vha->hw, fcport)) { + qla_nvme_register_remote(vha, fcport); +- fcport->disc_state = DSC_LOGIN_COMPLETE; ++ qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_COMPLETE); + qla2x00_set_fcport_state(fcport, FCS_ONLINE); + return; + } +@@ -5458,7 +5459,7 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) + } + } + +- fcport->disc_state = DSC_LOGIN_COMPLETE; ++ qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_COMPLETE); + } + + void qla_register_fcport_fn(struct work_struct *work) +@@ -5867,7 +5868,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) + + if (NVME_TARGET(vha->hw, fcport)) { + if (fcport->disc_state == DSC_DELETE_PEND) { +- fcport->disc_state = DSC_GNL; ++ qla2x00_set_fcport_disc_state(fcport, DSC_GNL); + vha->fcport_count--; + fcport->login_succ = 0; + } +diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h +index af91e567a38d..477b0b8a5f4b 100644 +--- a/drivers/scsi/qla2xxx/qla_inline.h ++++ b/drivers/scsi/qla2xxx/qla_inline.h +@@ -105,6 +105,30 @@ qla2x00_clean_dsd_pool(struct qla_hw_data *ha, struct crc_context *ctx) + INIT_LIST_HEAD(&ctx->dsd_list); + } + ++static inline void ++qla2x00_set_fcport_disc_state(fc_port_t *fcport, int state) ++{ ++ int old_val; ++ uint8_t shiftbits, mask; ++ ++ /* This will have to change when the max no. of states > 16 */ ++ shiftbits = 4; ++ mask = (1 << shiftbits) - 1; ++ ++ fcport->disc_state = state; ++ while (1) { ++ old_val = atomic_read(&fcport->shadow_disc_state); ++ if (old_val == atomic_cmpxchg(&fcport->shadow_disc_state, ++ old_val, (old_val << shiftbits) | state)) { ++ ql_dbg(ql_dbg_disc, fcport->vha, 0x2134, ++ "FCPort %8phC disc_state transition: %s to %s - portid=%06x.\n", ++ fcport->port_name, port_dstate_str[old_val & mask], ++ port_dstate_str[state], fcport->d_id.b24); ++ return; ++ } ++ } ++} ++ + static inline int + qla2x00_hba_err_chk_enabled(srb_t *sp) + { +diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c +index 53ccbd6b71ed..3f43410fab9d 100644 +--- a/drivers/scsi/qla2xxx/qla_iocb.c ++++ b/drivers/scsi/qla2xxx/qla_iocb.c +@@ -2843,7 +2843,8 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) + fw_status[0], fw_status[1], fw_status[2]); + + fcport->flags &= ~FCF_ASYNC_SENT; +- fcport->disc_state = DSC_LOGIN_FAILED; ++ qla2x00_set_fcport_disc_state(fcport, ++ DSC_LOGIN_FAILED); + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + break; + } +@@ -2856,7 +2857,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) + fw_status[0], fw_status[1], fw_status[2]); + + sp->fcport->flags &= ~FCF_ASYNC_SENT; +- sp->fcport->disc_state = DSC_LOGIN_FAILED; ++ qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_FAILED); + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + break; + } +@@ -2893,7 +2894,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, + } + + fcport->flags |= FCF_ASYNC_SENT; +- fcport->disc_state = DSC_LOGIN_PEND; ++ qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_PEND); + elsio = &sp->u.iocb_cmd; + ql_dbg(ql_dbg_io, vha, 0x3073, + "Enter: PLOGI portid=%06x\n", fcport->d_id.b24); +diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c +index 899dfb445710..af8306a9777f 100644 +--- a/drivers/scsi/qla2xxx/qla_os.c ++++ b/drivers/scsi/qla2xxx/qla_os.c +@@ -5014,7 +5014,7 @@ void qla24xx_sched_upd_fcport(fc_port_t *fcport) + fcport->jiffies_at_registration = jiffies; + fcport->sec_since_registration = 0; + fcport->next_disc_state = DSC_DELETED; +- fcport->disc_state = DSC_UPD_FCPORT; ++ qla2x00_set_fcport_disc_state(fcport, DSC_UPD_FCPORT); + spin_unlock_irqrestore(&fcport->vha->work_lock, flags); + + queue_work(system_unbound_wq, &fcport->reg_work); +diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c +index 5dbdae1f65af..594dfbeee376 100644 +--- a/drivers/scsi/qla2xxx/qla_target.c ++++ b/drivers/scsi/qla2xxx/qla_target.c +@@ -596,7 +596,8 @@ static void qla2x00_async_nack_sp_done(srb_t *sp, int res) + spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); + } else { + sp->fcport->login_retry = 0; +- sp->fcport->disc_state = DSC_LOGIN_COMPLETE; ++ qla2x00_set_fcport_disc_state(sp->fcport, ++ DSC_LOGIN_COMPLETE); + sp->fcport->deleted = 0; + sp->fcport->logout_on_delete = 1; + } +@@ -1056,7 +1057,7 @@ void qlt_free_session_done(struct work_struct *work) + tgt->sess_count--; + } + +- sess->disc_state = DSC_DELETED; ++ qla2x00_set_fcport_disc_state(sess, DSC_DELETED); + sess->fw_login_state = DSC_LS_PORT_UNAVAIL; + sess->deleted = QLA_SESS_DELETED; + +@@ -1166,7 +1167,7 @@ void qlt_unreg_sess(struct fc_port *sess) + vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess); + + sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; +- sess->disc_state = DSC_DELETE_PEND; ++ qla2x00_set_fcport_disc_state(sess, DSC_DELETE_PEND); + sess->last_rscn_gen = sess->rscn_gen; + sess->last_login_gen = sess->login_gen; + +@@ -1267,7 +1268,7 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) + sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; + spin_unlock_irqrestore(&sess->vha->work_lock, flags); + +- sess->disc_state = DSC_DELETE_PEND; ++ qla2x00_set_fcport_disc_state(sess, DSC_DELETE_PEND); + + qla24xx_chk_fcp_state(sess); + +@@ -6060,7 +6061,7 @@ static fc_port_t *qlt_get_port_database(struct scsi_qla_host *vha, + if (!IS_SW_RESV_ADDR(fcport->d_id)) + vha->fcport_count++; + fcport->login_gen++; +- fcport->disc_state = DSC_LOGIN_COMPLETE; ++ qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_COMPLETE); + fcport->login_succ = 1; + newfcport = 1; + } +-- +2.30.2 + diff --git a/queue-5.4/scsi-qla2xxx-dual-fcp-nvme-target-port-support.patch b/queue-5.4/scsi-qla2xxx-dual-fcp-nvme-target-port-support.patch new file mode 100644 index 00000000000..7e1e6bcf73f --- /dev/null +++ b/queue-5.4/scsi-qla2xxx-dual-fcp-nvme-target-port-support.patch @@ -0,0 +1,475 @@ +From 155939a929b639b6fce9899ccdb38ad08c57e112 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 12 Sep 2019 11:09:12 -0700 +Subject: scsi: qla2xxx: Dual FCP-NVMe target port support + +From: Michael Hernandez + +[ Upstream commit 84ed362ac40ca44dbbbebf767301463aa72bc797 ] + +Some storage arrays advertise FCP LUNs and NVMe namespaces behind the same +WWN. The driver now offers a user option by way of NVRAM parameter to +allow users to choose, on a per port basis, the kind of FC-4 type they +would like to prioritize for login. + +Link: https://lore.kernel.org/r/20190912180918.6436-9-hmadhani@marvell.com +Signed-off-by: Michael Hernandez +Signed-off-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla2xxx/qla_def.h | 26 ++++++++++++- + drivers/scsi/qla2xxx/qla_fw.h | 2 + + drivers/scsi/qla2xxx/qla_gs.c | 42 ++++++++++++-------- + drivers/scsi/qla2xxx/qla_init.c | 64 ++++++++++++++++++------------- + drivers/scsi/qla2xxx/qla_inline.h | 12 ++++++ + drivers/scsi/qla2xxx/qla_mbx.c | 11 +++--- + drivers/scsi/qla2xxx/qla_os.c | 17 ++++---- + 7 files changed, 114 insertions(+), 60 deletions(-) + +diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h +index 1eb3fe281cc3..894c2716b7ce 100644 +--- a/drivers/scsi/qla2xxx/qla_def.h ++++ b/drivers/scsi/qla2xxx/qla_def.h +@@ -2281,7 +2281,7 @@ typedef struct { + uint8_t fabric_port_name[WWN_SIZE]; + uint16_t fp_speed; + uint8_t fc4_type; +- uint8_t fc4f_nvme; /* nvme fc4 feature bits */ ++ uint8_t fc4_features; + } sw_info_t; + + /* FCP-4 types */ +@@ -2450,7 +2450,7 @@ typedef struct fc_port { + u32 supported_classes; + + uint8_t fc4_type; +- uint8_t fc4f_nvme; ++ uint8_t fc4_features; + uint8_t scan_state; + + unsigned long last_queue_full; +@@ -2481,6 +2481,9 @@ typedef struct fc_port { + u16 n2n_chip_reset; + } fc_port_t; + ++#define FC4_PRIORITY_NVME 0 ++#define FC4_PRIORITY_FCP 1 ++ + #define QLA_FCPORT_SCAN 1 + #define QLA_FCPORT_FOUND 2 + +@@ -4296,6 +4299,8 @@ struct qla_hw_data { + atomic_t nvme_active_aen_cnt; + uint16_t nvme_last_rptd_aen; /* Last recorded aen count */ + ++ uint8_t fc4_type_priority; ++ + atomic_t zio_threshold; + uint16_t last_zio_threshold; + +@@ -4821,6 +4826,23 @@ struct sff_8247_a0 { + ha->current_topology == ISP_CFG_N || \ + !ha->current_topology) + ++#define NVME_TYPE(fcport) \ ++ (fcport->fc4_type & FS_FC4TYPE_NVME) \ ++ ++#define FCP_TYPE(fcport) \ ++ (fcport->fc4_type & FS_FC4TYPE_FCP) \ ++ ++#define NVME_ONLY_TARGET(fcport) \ ++ (NVME_TYPE(fcport) && !FCP_TYPE(fcport)) \ ++ ++#define NVME_FCP_TARGET(fcport) \ ++ (FCP_TYPE(fcport) && NVME_TYPE(fcport)) \ ++ ++#define NVME_TARGET(ha, fcport) \ ++ ((NVME_FCP_TARGET(fcport) && \ ++ (ha->fc4_type_priority == FC4_PRIORITY_NVME)) || \ ++ NVME_ONLY_TARGET(fcport)) \ ++ + #include "qla_target.h" + #include "qla_gbl.h" + #include "qla_dbg.h" +diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h +index dc2366a29665..9dc09c117416 100644 +--- a/drivers/scsi/qla2xxx/qla_fw.h ++++ b/drivers/scsi/qla2xxx/qla_fw.h +@@ -2105,4 +2105,6 @@ struct qla_fcp_prio_cfg { + #define FA_FLASH_LAYOUT_ADDR_83 (0x3F1000/4) + #define FA_FLASH_LAYOUT_ADDR_28 (0x11000/4) + ++#define NVRAM_DUAL_FCP_NVME_FLAG_OFFSET 0x196 ++ + #endif +diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c +index fc6e12fb7d77..ae13aabf280b 100644 +--- a/drivers/scsi/qla2xxx/qla_gs.c ++++ b/drivers/scsi/qla2xxx/qla_gs.c +@@ -248,7 +248,7 @@ qla2x00_ga_nxt(scsi_qla_host_t *vha, fc_port_t *fcport) + WWN_SIZE); + + fcport->fc4_type = (ct_rsp->rsp.ga_nxt.fc4_types[2] & BIT_0) ? +- FC4_TYPE_FCP_SCSI : FC4_TYPE_OTHER; ++ FS_FC4TYPE_FCP : FC4_TYPE_OTHER; + + if (ct_rsp->rsp.ga_nxt.port_type != NS_N_PORT_TYPE && + ct_rsp->rsp.ga_nxt.port_type != NS_NL_PORT_TYPE) +@@ -2887,7 +2887,7 @@ qla2x00_gff_id(scsi_qla_host_t *vha, sw_info_t *list) + struct ct_sns_req *ct_req; + struct ct_sns_rsp *ct_rsp; + struct qla_hw_data *ha = vha->hw; +- uint8_t fcp_scsi_features = 0; ++ uint8_t fcp_scsi_features = 0, nvme_features = 0; + struct ct_arg arg; + + for (i = 0; i < ha->max_fibre_devices; i++) { +@@ -2933,14 +2933,19 @@ qla2x00_gff_id(scsi_qla_host_t *vha, sw_info_t *list) + ct_rsp->rsp.gff_id.fc4_features[GFF_FCP_SCSI_OFFSET]; + fcp_scsi_features &= 0x0f; + +- if (fcp_scsi_features) +- list[i].fc4_type = FC4_TYPE_FCP_SCSI; +- else +- list[i].fc4_type = FC4_TYPE_OTHER; ++ if (fcp_scsi_features) { ++ list[i].fc4_type = FS_FC4TYPE_FCP; ++ list[i].fc4_features = fcp_scsi_features; ++ } + +- list[i].fc4f_nvme = ++ nvme_features = + ct_rsp->rsp.gff_id.fc4_features[GFF_NVME_OFFSET]; +- list[i].fc4f_nvme &= 0xf; ++ nvme_features &= 0xf; ++ ++ if (nvme_features) { ++ list[i].fc4_type |= FS_FC4TYPE_NVME; ++ list[i].fc4_features = nvme_features; ++ } + } + + /* Last device exit. */ +@@ -3435,6 +3440,8 @@ void qla24xx_async_gffid_sp_done(srb_t *sp, int res) + fc_port_t *fcport = sp->fcport; + struct ct_sns_rsp *ct_rsp; + struct event_arg ea; ++ uint8_t fc4_scsi_feat; ++ uint8_t fc4_nvme_feat; + + ql_dbg(ql_dbg_disc, vha, 0x2133, + "Async done-%s res %x ID %x. %8phC\n", +@@ -3442,24 +3449,25 @@ void qla24xx_async_gffid_sp_done(srb_t *sp, int res) + + fcport->flags &= ~FCF_ASYNC_SENT; + ct_rsp = &fcport->ct_desc.ct_sns->p.rsp; ++ fc4_scsi_feat = ct_rsp->rsp.gff_id.fc4_features[GFF_FCP_SCSI_OFFSET]; ++ fc4_nvme_feat = ct_rsp->rsp.gff_id.fc4_features[GFF_NVME_OFFSET]; ++ + /* + * FC-GS-7, 5.2.3.12 FC-4 Features - format + * The format of the FC-4 Features object, as defined by the FC-4, + * Shall be an array of 4-bit values, one for each type code value + */ + if (!res) { +- if (ct_rsp->rsp.gff_id.fc4_features[GFF_FCP_SCSI_OFFSET] & 0xf) { ++ if (fc4_scsi_feat & 0xf) { + /* w1 b00:03 */ +- fcport->fc4_type = +- ct_rsp->rsp.gff_id.fc4_features[GFF_FCP_SCSI_OFFSET]; +- fcport->fc4_type &= 0xf; +- } ++ fcport->fc4_type = FS_FC4TYPE_FCP; ++ fcport->fc4_features = fc4_scsi_feat & 0xf; ++ } + +- if (ct_rsp->rsp.gff_id.fc4_features[GFF_NVME_OFFSET] & 0xf) { ++ if (fc4_nvme_feat & 0xf) { + /* w5 [00:03]/28h */ +- fcport->fc4f_nvme = +- ct_rsp->rsp.gff_id.fc4_features[GFF_NVME_OFFSET]; +- fcport->fc4f_nvme &= 0xf; ++ fcport->fc4_type |= FS_FC4TYPE_NVME; ++ fcport->fc4_features = fc4_nvme_feat & 0xf; + } + } + +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c +index 5305c914b0a4..bc7460da394f 100644 +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -356,7 +356,7 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, + else + lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; + +- if (fcport->fc4f_nvme) ++ if (NVME_TARGET(vha->hw, fcport)) + lio->u.logio.flags |= SRB_LOGIN_SKIP_PRLI; + + ql_dbg(ql_dbg_disc, vha, 0x2072, +@@ -755,19 +755,17 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, + + loop_id = le16_to_cpu(e->nport_handle); + loop_id = (loop_id & 0x7fff); +- if (fcport->fc4f_nvme) ++ if (NVME_TARGET(vha->hw, fcport)) + current_login_state = e->current_login_state >> 4; + else + current_login_state = e->current_login_state & 0xf; + +- + ql_dbg(ql_dbg_disc, vha, 0x20e2, +- "%s found %8phC CLS [%x|%x] nvme %d ID[%02x%02x%02x|%02x%02x%02x] lid[%d|%d]\n", ++ "%s found %8phC CLS [%x|%x] fc4_type %d ID[%06x|%06x] lid[%d|%d]\n", + __func__, fcport->port_name, + e->current_login_state, fcport->fw_login_state, +- fcport->fc4f_nvme, id.b.domain, id.b.area, id.b.al_pa, +- fcport->d_id.b.domain, fcport->d_id.b.area, +- fcport->d_id.b.al_pa, loop_id, fcport->loop_id); ++ fcport->fc4_type, id.b24, fcport->d_id.b24, ++ loop_id, fcport->loop_id); + + switch (fcport->disc_state) { + case DSC_DELETE_PEND: +@@ -1263,13 +1261,13 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) + sp->done = qla2x00_async_prli_sp_done; + lio->u.logio.flags = 0; + +- if (fcport->fc4f_nvme) ++ if (NVME_TARGET(vha->hw, fcport)) + lio->u.logio.flags |= SRB_LOGIN_NVME_PRLI; + + ql_dbg(ql_dbg_disc, vha, 0x211b, + "Async-prli - %8phC hdl=%x, loopid=%x portid=%06x retries=%d %s.\n", + fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b24, +- fcport->login_retry, fcport->fc4f_nvme ? "nvme" : "fc"); ++ fcport->login_retry, NVME_TARGET(vha->hw, fcport) ? "nvme" : "fc"); + + rval = qla2x00_start_sp(sp); + if (rval != QLA_SUCCESS) { +@@ -1420,14 +1418,14 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) + fcport->flags &= ~FCF_ASYNC_SENT; + + ql_dbg(ql_dbg_disc, vha, 0x20d2, +- "%s %8phC DS %d LS %d nvme %x rc %d\n", __func__, fcport->port_name, +- fcport->disc_state, pd->current_login_state, fcport->fc4f_nvme, +- ea->rc); ++ "%s %8phC DS %d LS %d fc4_type %x rc %d\n", __func__, ++ fcport->port_name, fcport->disc_state, pd->current_login_state, ++ fcport->fc4_type, ea->rc); + + if (fcport->disc_state == DSC_DELETE_PEND) + return; + +- if (fcport->fc4f_nvme) ++ if (NVME_TARGET(vha->hw, fcport)) + ls = pd->current_login_state >> 4; + else + ls = pd->current_login_state & 0xf; +@@ -1616,7 +1614,8 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) + ql_dbg(ql_dbg_disc, vha, 0x2118, + "%s %d %8phC post %s PRLI\n", + __func__, __LINE__, fcport->port_name, +- fcport->fc4f_nvme ? "NVME" : "FC"); ++ NVME_TARGET(vha->hw, fcport) ? "NVME" : ++ "FC"); + qla24xx_post_prli_work(vha, fcport); + } + break; +@@ -1898,13 +1897,22 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) + break; + } + +- if (ea->fcport->fc4f_nvme) { ++ /* ++ * Retry PRLI with other FC-4 type if failure occurred on dual ++ * FCP/NVMe port ++ */ ++ if (NVME_FCP_TARGET(ea->fcport)) { ++ if (vha->hw->fc4_type_priority == FC4_PRIORITY_NVME) ++ ea->fcport->fc4_type &= ~FS_FC4TYPE_NVME; ++ else ++ ea->fcport->fc4_type &= ~FS_FC4TYPE_FCP; + ql_dbg(ql_dbg_disc, vha, 0x2118, +- "%s %d %8phC post fc4 prli\n", +- __func__, __LINE__, ea->fcport->port_name); +- ea->fcport->fc4f_nvme = 0; ++ "%s %d %8phC post %s prli\n", ++ __func__, __LINE__, ea->fcport->port_name, ++ (ea->fcport->fc4_type & FS_FC4TYPE_NVME) ? ++ "NVMe" : "FCP"); + qla24xx_post_prli_work(vha, ea->fcport); +- return; ++ break; + } + + /* at this point both PRLI NVME & PRLI FCP failed */ +@@ -1990,7 +1998,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) + * force a relogin attempt via implicit LOGO, PLOGI, and PRLI + * requests. + */ +- if (ea->fcport->fc4f_nvme) { ++ if (NVME_TARGET(vha->hw, ea->fcport)) { + ql_dbg(ql_dbg_disc, vha, 0x2117, + "%s %d %8phC post prli\n", + __func__, __LINE__, ea->fcport->port_name); +@@ -5415,7 +5423,7 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) + + qla2x00_iidma_fcport(vha, fcport); + +- if (fcport->fc4f_nvme) { ++ if (NVME_TARGET(vha->hw, fcport)) { + qla_nvme_register_remote(vha, fcport); + fcport->disc_state = DSC_LOGIN_COMPLETE; + qla2x00_set_fcport_state(fcport, FCS_ONLINE); +@@ -5743,11 +5751,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) + new_fcport->fc4_type = swl[swl_idx].fc4_type; + + new_fcport->nvme_flag = 0; +- new_fcport->fc4f_nvme = 0; + if (vha->flags.nvme_enabled && +- swl[swl_idx].fc4f_nvme) { +- new_fcport->fc4f_nvme = +- swl[swl_idx].fc4f_nvme; ++ swl[swl_idx].fc4_type & FS_FC4TYPE_NVME) { + ql_log(ql_log_info, vha, 0x2131, + "FOUND: NVME port %8phC as FC Type 28h\n", + new_fcport->port_name); +@@ -5803,7 +5808,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) + + /* Bypass ports whose FCP-4 type is not FCP_SCSI */ + if (ql2xgffidenable && +- (new_fcport->fc4_type != FC4_TYPE_FCP_SCSI && ++ (!(new_fcport->fc4_type & FS_FC4TYPE_FCP) && + new_fcport->fc4_type != FC4_TYPE_UNKNOWN)) + continue; + +@@ -5872,7 +5877,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) + break; + } + +- if (fcport->fc4f_nvme) { ++ if (NVME_TARGET(vha->hw, fcport)) { + if (fcport->disc_state == DSC_DELETE_PEND) { + fcport->disc_state = DSC_GNL; + vha->fcport_count--; +@@ -8547,6 +8552,11 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) + /* N2N: driver will initiate Login instead of FW */ + icb->firmware_options_3 |= BIT_8; + ++ /* Determine NVMe/FCP priority for target ports */ ++ ha->fc4_type_priority = qla2xxx_get_fc4_priority(vha); ++ ql_log(ql_log_info, vha, 0xffff, "FC4 priority set to %s\n", ++ ha->fc4_type_priority & BIT_0 ? "FCP" : "NVMe"); ++ + if (rval) { + ql_log(ql_log_warn, vha, 0x0076, + "NVRAM configuration failed.\n"); +diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h +index 6dfde42d799b..af91e567a38d 100644 +--- a/drivers/scsi/qla2xxx/qla_inline.h ++++ b/drivers/scsi/qla2xxx/qla_inline.h +@@ -312,3 +312,15 @@ qla_83xx_start_iocbs(struct qla_qpair *qpair) + + WRT_REG_DWORD(req->req_q_in, req->ring_index); + } ++ ++static inline int ++qla2xxx_get_fc4_priority(struct scsi_qla_host *vha) ++{ ++ uint32_t data; ++ ++ data = ++ ((uint8_t *)vha->hw->nvram)[NVRAM_DUAL_FCP_NVME_FLAG_OFFSET]; ++ ++ ++ return ((data >> 6) & BIT_0); ++} +diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c +index c1631e42d35d..098388a12feb 100644 +--- a/drivers/scsi/qla2xxx/qla_mbx.c ++++ b/drivers/scsi/qla2xxx/qla_mbx.c +@@ -1924,7 +1924,7 @@ qla2x00_get_port_database(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t opt) + pd24 = (struct port_database_24xx *) pd; + + /* Check for logged in state. */ +- if (fcport->fc4f_nvme) { ++ if (NVME_TARGET(ha, fcport)) { + current_login_state = pd24->current_login_state >> 4; + last_login_state = pd24->last_login_state >> 4; + } else { +@@ -3891,8 +3891,9 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, + fcport->scan_state = QLA_FCPORT_FOUND; + fcport->n2n_flag = 1; + fcport->keep_nport_handle = 1; ++ fcport->fc4_type = FS_FC4TYPE_FCP; + if (vha->flags.nvme_enabled) +- fcport->fc4f_nvme = 1; ++ fcport->fc4_type |= FS_FC4TYPE_NVME; + + switch (fcport->disc_state) { + case DSC_DELETED: +@@ -6350,7 +6351,7 @@ int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, + uint64_t zero = 0; + u8 current_login_state, last_login_state; + +- if (fcport->fc4f_nvme) { ++ if (NVME_TARGET(vha->hw, fcport)) { + current_login_state = pd->current_login_state >> 4; + last_login_state = pd->last_login_state >> 4; + } else { +@@ -6385,8 +6386,8 @@ int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, + fcport->d_id.b.al_pa = pd->port_id[2]; + fcport->d_id.b.rsvd_1 = 0; + +- if (fcport->fc4f_nvme) { +- fcport->port_type = 0; ++ if (NVME_TARGET(vha->hw, fcport)) { ++ fcport->port_type = FCT_NVME; + if ((pd->prli_svc_param_word_3[0] & BIT_5) == 0) + fcport->port_type |= FCT_NVME_INITIATOR; + if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0) +diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c +index 67b1e74fcd1e..899dfb445710 100644 +--- a/drivers/scsi/qla2xxx/qla_os.c ++++ b/drivers/scsi/qla2xxx/qla_os.c +@@ -5055,19 +5055,17 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) + fcport->d_id = e->u.new_sess.id; + fcport->flags |= FCF_FABRIC_DEVICE; + fcport->fw_login_state = DSC_LS_PLOGI_PEND; +- if (e->u.new_sess.fc4_type == FS_FC4TYPE_FCP) +- fcport->fc4_type = FC4_TYPE_FCP_SCSI; +- +- if (e->u.new_sess.fc4_type == FS_FC4TYPE_NVME) { +- fcport->fc4_type = FC4_TYPE_OTHER; +- fcport->fc4f_nvme = FC4_TYPE_NVME; +- } + + memcpy(fcport->port_name, e->u.new_sess.port_name, + WWN_SIZE); + +- if (e->u.new_sess.fc4_type & FS_FCP_IS_N2N) ++ fcport->fc4_type = e->u.new_sess.fc4_type; ++ if (e->u.new_sess.fc4_type & FS_FCP_IS_N2N) { ++ fcport->fc4_type = FS_FC4TYPE_FCP; + fcport->n2n_flag = 1; ++ if (vha->flags.nvme_enabled) ++ fcport->fc4_type |= FS_FC4TYPE_NVME; ++ } + + } else { + ql_dbg(ql_dbg_disc, vha, 0xffff, +@@ -5171,7 +5169,8 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) + fcport->flags &= ~FCF_FABRIC_DEVICE; + fcport->keep_nport_handle = 1; + if (vha->flags.nvme_enabled) { +- fcport->fc4f_nvme = 1; ++ fcport->fc4_type = ++ (FS_FC4TYPE_NVME | FS_FC4TYPE_FCP); + fcport->n2n_flag = 1; + } + fcport->fw_login_state = 0; +-- +2.30.2 + diff --git a/queue-5.4/scsi-qla2xxx-fix-device-connect-issues-in-p2p-config.patch b/queue-5.4/scsi-qla2xxx-fix-device-connect-issues-in-p2p-config.patch new file mode 100644 index 00000000000..2380f865d0f --- /dev/null +++ b/queue-5.4/scsi-qla2xxx-fix-device-connect-issues-in-p2p-config.patch @@ -0,0 +1,72 @@ +From 4f268cd9512bc5272afbdeda1a1b26d46e7b8e78 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Nov 2019 07:06:56 -0800 +Subject: scsi: qla2xxx: Fix device connect issues in P2P configuration + +From: Arun Easi + +[ Upstream commit 65e9200938052ce90f24421bb057e1be1d6147c7 ] + +P2P needs to take the alternate plogi route. + +Link: https://lore.kernel.org/r/20191105150657.8092-8-hmadhani@marvell.com +Reviewed-by: Ewan D. Milne +Signed-off-by: Arun Easi +Signed-off-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla2xxx/qla_gbl.h | 1 + + drivers/scsi/qla2xxx/qla_init.c | 9 +++++++++ + drivers/scsi/qla2xxx/qla_iocb.c | 5 ++--- + 3 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h +index d11416dcee4e..5b163ad85c34 100644 +--- a/drivers/scsi/qla2xxx/qla_gbl.h ++++ b/drivers/scsi/qla2xxx/qla_gbl.h +@@ -917,4 +917,5 @@ int qla2x00_set_data_rate(scsi_qla_host_t *vha, uint16_t mode); + + /* nvme.c */ + void qla_nvme_unregister_remote_port(struct fc_port *fcport); ++void qla_handle_els_plogi_done(scsi_qla_host_t *vha, struct event_arg *ea); + #endif /* _QLA_GBL_H */ +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c +index bc7460da394f..633317651138 100644 +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -1738,6 +1738,15 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, + qla24xx_fcport_handle_login(vha, fcport); + } + ++void qla_handle_els_plogi_done(scsi_qla_host_t *vha, ++ struct event_arg *ea) ++{ ++ ql_dbg(ql_dbg_disc, vha, 0x2118, ++ "%s %d %8phC post PRLI\n", ++ __func__, __LINE__, ea->fcport->port_name); ++ qla24xx_post_prli_work(vha, ea->fcport); ++} ++ + /* + * RSCN(s) came in for this fcport, but the RSCN(s) was not able + * to be consumed by the fcport +diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c +index 2e272fc858ed..c0720c8e2f6d 100644 +--- a/drivers/scsi/qla2xxx/qla_iocb.c ++++ b/drivers/scsi/qla2xxx/qla_iocb.c +@@ -2769,9 +2769,8 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) + case CS_COMPLETE: + memset(&ea, 0, sizeof(ea)); + ea.fcport = fcport; +- ea.data[0] = MBS_COMMAND_COMPLETE; +- ea.sp = sp; +- qla24xx_handle_plogi_done_event(vha, &ea); ++ ea.rc = res; ++ qla_handle_els_plogi_done(vha, &ea); + break; + case CS_IOCB_ERROR: + switch (fw_status[1]) { +-- +2.30.2 + diff --git a/queue-5.4/scsi-qla2xxx-fix-stuck-login-session-using-prli_pend.patch b/queue-5.4/scsi-qla2xxx-fix-stuck-login-session-using-prli_pend.patch new file mode 100644 index 00000000000..5a3fb5d1557 --- /dev/null +++ b/queue-5.4/scsi-qla2xxx-fix-stuck-login-session-using-prli_pend.patch @@ -0,0 +1,141 @@ +From e53f5c1fde5c006e28ef2ee0ac0afa3a940b51be Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Dec 2019 14:06:11 -0800 +Subject: scsi: qla2xxx: Fix stuck login session using prli_pend_timer + +From: Quinn Tran + +[ Upstream commit 8aaac2d7da873aebeba92c666f82c00bbd74aaf9 ] + +Session is stuck if driver sees FW has received a PRLI. Driver allows FW to +finish with processing of PRLI by checking back with FW at a later time to +see if the PRLI has finished. Instead, driver failed to push forward after +re-checking PRLI completion. + +Fixes: ce0ba496dccf ("scsi: qla2xxx: Fix stuck login session") +Cc: stable@vger.kernel.org # 5.3 +Link: https://lore.kernel.org/r/20191217220617.28084-9-hmadhani@marvell.com +Signed-off-by: Quinn Tran +Signed-off-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla2xxx/qla_def.h | 5 +++++ + drivers/scsi/qla2xxx/qla_init.c | 34 +++++++++++++++++++++++-------- + drivers/scsi/qla2xxx/qla_target.c | 1 + + 3 files changed, 32 insertions(+), 8 deletions(-) + +diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h +index 5e940543eaa1..7c22f8eea3ea 100644 +--- a/drivers/scsi/qla2xxx/qla_def.h ++++ b/drivers/scsi/qla2xxx/qla_def.h +@@ -2402,6 +2402,7 @@ typedef struct fc_port { + unsigned int scan_needed:1; + unsigned int n2n_flag:1; + unsigned int explicit_logout:1; ++ unsigned int prli_pend_timer:1; + + struct completion nvme_del_done; + uint32_t nvme_prli_service_param; +@@ -2428,6 +2429,7 @@ typedef struct fc_port { + struct work_struct free_work; + struct work_struct reg_work; + uint64_t jiffies_at_registration; ++ unsigned long prli_expired; + struct qlt_plogi_ack_t *plogi_link[QLT_PLOGI_LINK_MAX]; + + uint16_t tgt_id; +@@ -4857,6 +4859,9 @@ struct sff_8247_a0 { + (ha->fc4_type_priority == FC4_PRIORITY_NVME)) || \ + NVME_ONLY_TARGET(fcport)) \ + ++#define PRLI_PHASE(_cls) \ ++ ((_cls == DSC_LS_PRLI_PEND) || (_cls == DSC_LS_PRLI_COMP)) ++ + #include "qla_target.h" + #include "qla_gbl.h" + #include "qla_dbg.h" +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c +index 0aac1eb1e013..b4f0c2c8414e 100644 +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -696,7 +696,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, + port_id_t id; + u64 wwn; + u16 data[2]; +- u8 current_login_state; ++ u8 current_login_state, nvme_cls; + + fcport = ea->fcport; + ql_dbg(ql_dbg_disc, vha, 0xffff, +@@ -755,10 +755,17 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, + + loop_id = le16_to_cpu(e->nport_handle); + loop_id = (loop_id & 0x7fff); +- if (NVME_TARGET(vha->hw, fcport)) +- current_login_state = e->current_login_state >> 4; +- else +- current_login_state = e->current_login_state & 0xf; ++ nvme_cls = e->current_login_state >> 4; ++ current_login_state = e->current_login_state & 0xf; ++ ++ if (PRLI_PHASE(nvme_cls)) { ++ current_login_state = nvme_cls; ++ fcport->fc4_type &= ~FS_FC4TYPE_FCP; ++ fcport->fc4_type |= FS_FC4TYPE_NVME; ++ } else if (PRLI_PHASE(current_login_state)) { ++ fcport->fc4_type |= FS_FC4TYPE_FCP; ++ fcport->fc4_type &= ~FS_FC4TYPE_NVME; ++ } + + ql_dbg(ql_dbg_disc, vha, 0x20e2, + "%s found %8phC CLS [%x|%x] fc4_type %d ID[%06x|%06x] lid[%d|%d]\n", +@@ -1238,12 +1245,19 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) + struct srb_iocb *lio; + int rval = QLA_FUNCTION_FAILED; + +- if (!vha->flags.online) ++ if (!vha->flags.online) { ++ ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC exit\n", ++ __func__, __LINE__, fcport->port_name); + return rval; ++ } + +- if (fcport->fw_login_state == DSC_LS_PLOGI_PEND || +- fcport->fw_login_state == DSC_LS_PRLI_PEND) ++ if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND || ++ fcport->fw_login_state == DSC_LS_PRLI_PEND) && ++ qla_dual_mode_enabled(vha)) { ++ ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d %8phC exit\n", ++ __func__, __LINE__, fcport->port_name); + return rval; ++ } + + sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); + if (!sp) +@@ -1622,6 +1636,10 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) + break; + default: + if (fcport->login_pause) { ++ ql_dbg(ql_dbg_disc, vha, 0x20d8, ++ "%s %d %8phC exit\n", ++ __func__, __LINE__, ++ fcport->port_name); + fcport->last_rscn_gen = fcport->rscn_gen; + fcport->last_login_gen = fcport->login_gen; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); +diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c +index 594dfbeee376..509539ec58e9 100644 +--- a/drivers/scsi/qla2xxx/qla_target.c ++++ b/drivers/scsi/qla2xxx/qla_target.c +@@ -1268,6 +1268,7 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) + sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; + spin_unlock_irqrestore(&sess->vha->work_lock, flags); + ++ sess->prli_pend_timer = 0; + qla2x00_set_fcport_disc_state(sess, DSC_DELETE_PEND); + + qla24xx_chk_fcp_state(sess); +-- +2.30.2 + diff --git a/queue-5.4/scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-failure.patch b/queue-5.4/scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-failure.patch new file mode 100644 index 00000000000..ee795828248 --- /dev/null +++ b/queue-5.4/scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-failure.patch @@ -0,0 +1,128 @@ +From 1880c7f2ddfc435777b4b2a0e0cee609d3daa9f2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Nov 2019 07:06:50 -0800 +Subject: scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure + +From: Quinn Tran + +[ Upstream commit 983f127603fac650fa34ee69db363e4615eaf9e7 ] + +Current code will send PRLI with FC-NVMe bit set for the targets which +support only FCP. This may result into issue with targets which do not +understand NVMe and will go into a strange state. This patch would restart +the login process by going back to PLOGI state. The PLOGI state will force +the target to respond to correct PRLI request. + +Fixes: c76ae845ea836 ("scsi: qla2xxx: Add error handling for PLOGI ELS passthrough") +Cc: stable@vger.kernel.org # 5.4 +Link: https://lore.kernel.org/r/20191105150657.8092-2-hmadhani@marvell.com +Reviewed-by: Ewan D. Milne +Signed-off-by: Quinn Tran +Signed-off-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla2xxx/qla_init.c | 37 +++++++-------------------------- + drivers/scsi/qla2xxx/qla_iocb.c | 6 +++++- + 2 files changed, 13 insertions(+), 30 deletions(-) + +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c +index 633317651138..5d2d0c287469 100644 +--- a/drivers/scsi/qla2xxx/qla_init.c ++++ b/drivers/scsi/qla2xxx/qla_init.c +@@ -1911,42 +1911,21 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) + * FCP/NVMe port + */ + if (NVME_FCP_TARGET(ea->fcport)) { +- if (vha->hw->fc4_type_priority == FC4_PRIORITY_NVME) +- ea->fcport->fc4_type &= ~FS_FC4TYPE_NVME; +- else +- ea->fcport->fc4_type &= ~FS_FC4TYPE_FCP; + ql_dbg(ql_dbg_disc, vha, 0x2118, + "%s %d %8phC post %s prli\n", + __func__, __LINE__, ea->fcport->port_name, + (ea->fcport->fc4_type & FS_FC4TYPE_NVME) ? + "NVMe" : "FCP"); +- qla24xx_post_prli_work(vha, ea->fcport); +- break; ++ if (vha->hw->fc4_type_priority == FC4_PRIORITY_NVME) ++ ea->fcport->fc4_type &= ~FS_FC4TYPE_NVME; ++ else ++ ea->fcport->fc4_type &= ~FS_FC4TYPE_FCP; + } + +- /* at this point both PRLI NVME & PRLI FCP failed */ +- if (N2N_TOPO(vha->hw)) { +- if (ea->fcport->n2n_link_reset_cnt < 3) { +- ea->fcport->n2n_link_reset_cnt++; +- /* +- * remote port is not sending Plogi. Reset +- * link to kick start his state machine +- */ +- set_bit(N2N_LINK_RESET, &vha->dpc_flags); +- } else { +- ql_log(ql_log_warn, vha, 0x2119, +- "%s %d %8phC Unable to reconnect\n", +- __func__, __LINE__, ea->fcport->port_name); +- } +- } else { +- /* +- * switch connect. login failed. Take connection +- * down and allow relogin to retrigger +- */ +- ea->fcport->flags &= ~FCF_ASYNC_SENT; +- ea->fcport->keep_nport_handle = 0; +- qlt_schedule_sess_for_deletion(ea->fcport); +- } ++ ea->fcport->flags &= ~FCF_ASYNC_SENT; ++ ea->fcport->keep_nport_handle = 0; ++ ea->fcport->logout_on_delete = 1; ++ qlt_schedule_sess_for_deletion(ea->fcport); + break; + } + } +diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c +index c0720c8e2f6d..53ccbd6b71ed 100644 +--- a/drivers/scsi/qla2xxx/qla_iocb.c ++++ b/drivers/scsi/qla2xxx/qla_iocb.c +@@ -2772,6 +2772,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) + ea.rc = res; + qla_handle_els_plogi_done(vha, &ea); + break; ++ + case CS_IOCB_ERROR: + switch (fw_status[1]) { + case LSC_SCODE_PORTID_USED: +@@ -2842,6 +2843,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) + fw_status[0], fw_status[1], fw_status[2]); + + fcport->flags &= ~FCF_ASYNC_SENT; ++ fcport->disc_state = DSC_LOGIN_FAILED; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + break; + } +@@ -2854,6 +2856,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) + fw_status[0], fw_status[1], fw_status[2]); + + sp->fcport->flags &= ~FCF_ASYNC_SENT; ++ sp->fcport->disc_state = DSC_LOGIN_FAILED; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + break; + } +@@ -2889,11 +2892,12 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, + return -ENOMEM; + } + ++ fcport->flags |= FCF_ASYNC_SENT; ++ fcport->disc_state = DSC_LOGIN_PEND; + elsio = &sp->u.iocb_cmd; + ql_dbg(ql_dbg_io, vha, 0x3073, + "Enter: PLOGI portid=%06x\n", fcport->d_id.b24); + +- fcport->flags |= FCF_ASYNC_SENT; + sp->type = SRB_ELS_DCMD; + sp->name = "ELS_DCMD"; + sp->fcport = fcport; +-- +2.30.2 + diff --git a/queue-5.4/series b/queue-5.4/series new file mode 100644 index 00000000000..4449311b012 --- /dev/null +++ b/queue-5.4/series @@ -0,0 +1,7 @@ +revert-scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-fail.patch +revert-scsi-qla2xxx-fix-stuck-login-session-using-pr.patch +scsi-qla2xxx-dual-fcp-nvme-target-port-support.patch +scsi-qla2xxx-fix-device-connect-issues-in-p2p-config.patch +scsi-qla2xxx-retry-plogi-on-fc-nvme-prli-failure.patch +scsi-qla2xxx-add-a-shadow-variable-to-hold-disc_stat.patch +scsi-qla2xxx-fix-stuck-login-session-using-prli_pend.patch -- 2.47.3