scsi: qla2xxx: Fix stuck session
authorQuinn Tran <qutran@marvell.com>
Mon, 29 Mar 2021 08:52:20 +0000 (01:52 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 30 Mar 2021 02:38:58 +0000 (22:38 -0400)
Session was stuck due to explicit logout to target timing out.  The target
was in an unresponsive state. This timeout induced an error to the GNL
command from moving forward.

Link: https://lore.kernel.org/r/20210329085229.4367-4-njavali@marvell.com
Tested-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_target.c

index af237c485389a297174362ddc3fb45585a8eff5e..f6dc8166e7ba7f23c5615d7ad892708c3826b913 100644 (file)
@@ -718,6 +718,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,
                ql_dbg(ql_dbg_disc, vha, 0x20e0,
                    "%s %8phC login gen changed\n",
                    __func__, fcport->port_name);
+               set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
                return;
        }
 
index 67c6a2710360aef3420b6b62a9d48a5fd8d3a44a..7a2826149364ef98f163fbf9dc75bcfdc19e6f30 100644 (file)
@@ -1029,7 +1029,12 @@ void qlt_free_session_done(struct work_struct *work)
                        }
                        msleep(100);
                        cnt++;
-                       if (cnt > 200)
+                       /*
+                        * Driver timeout is set to 22 Sec, update count value to loop
+                        * long enough for log-out to complete before advancing. Otherwise,
+                        * straddling logout can interfere with re-login attempt.
+                        */
+                       if (cnt > 230)
                                break;
                }