From: Hannes Reinecke <hare@suse.de>
Date: Wed, 21 Feb 2018 13:11:29 +0100
Subject: [PATCH] qla2xxx: do not check login_state if no loop id is assigned
References: bsc#1081681
Git-commit: 07ea4b6026ee8b8dfaf9bbe83a09b3ba905d20fd
Patch-Mainline: v4.16-rc5
When no loop id is assigned in qla24xx_fcport_handle_login()
the login state needs to be ignored; it will get set later on
in qla_chk_n2n_b4_login().
Fixes: 040036bb0b ("scsi: qla2xxx: Delay loop id allocation at login")
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/qla2xxx/qla_init.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index c9f902127ba3..f4f581e106cd 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1175,8 +1175,9 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
if (fcport->scan_state != QLA_FCPORT_FOUND)
return 0;
- if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
- (fcport->fw_login_state == DSC_LS_PRLI_PEND))
+ if ((fcport->loop_id != FC_NO_LOOP_ID) &&
+ ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
+ (fcport->fw_login_state == DSC_LS_PRLI_PEND)))
return 0;
if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) {
--
2.12.3