diff mbox series

[5/6] qla2xxx: Fix stale session

Message ID 20190830222402.23688-6-hmadhani@marvell.com (mailing list archive)
State Superseded
Headers show
Series qla2xxx: Bug fixes for the driver | expand

Commit Message

Himanshu Madhani Aug. 30, 2019, 10:24 p.m. UTC
From: Quinn Tran <qutran@marvell.com>

On fast cable pull, where driver is unable to detect device
has disappeared and came back based on switch info, qla2xxx
would not re-login while remote port has already invalidate
the session.  This cause IO timeout.  This patch would relogin
to remote device for RSCN affected port.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
---
 drivers/scsi/qla2xxx/qla_gs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Ewan Milne Sept. 3, 2019, 2:52 p.m. UTC | #1
On Fri, 2019-08-30 at 15:24 -0700, Himanshu Madhani wrote:
> From: Quinn Tran <qutran@marvell.com>
> 
> On fast cable pull, where driver is unable to detect device
> has disappeared and came back based on switch info, qla2xxx
> would not re-login while remote port has already invalidate
> the session.  This cause IO timeout.  This patch would relogin
> to remote device for RSCN affected port.
> 
> Signed-off-by: Quinn Tran <qutran@marvell.com>
> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
> ---
>  drivers/scsi/qla2xxx/qla_gs.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
> index 03f94eb372b6..dc0e36676313 100644
> --- a/drivers/scsi/qla2xxx/qla_gs.c
> +++ b/drivers/scsi/qla2xxx/qla_gs.c
> @@ -3628,7 +3628,6 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
>  		list_for_each_entry(fcport, &vha->vp_fcports, list) {
>  			if (memcmp(rp->port_name, fcport->port_name, WWN_SIZE))
>  				continue;
> -			fcport->scan_needed = 0;
>  			fcport->scan_state = QLA_FCPORT_FOUND;
>  			found = true;
>  			/*
> @@ -3637,10 +3636,12 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
>  			if ((fcport->flags & FCF_FABRIC_DEVICE) == 0) {
>  				qla2x00_clear_loop_id(fcport);
>  				fcport->flags |= FCF_FABRIC_DEVICE;
> -			} else if (fcport->d_id.b24 != rp->id.b24) {
> +			} else if (fcport->d_id.b24 != rp->id.b24 ||
> +				fcport->scan_needed) {
>  				qlt_schedule_sess_for_deletion(fcport);
>  			}
>  			fcport->d_id.b24 = rp->id.b24;
> +			fcport->scan_needed = 0;
>  			break;
>  		}
>  

Reviewed-by: Ewan D. Milne <emilne@redhat.com>
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 03f94eb372b6..dc0e36676313 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -3628,7 +3628,6 @@  void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
 		list_for_each_entry(fcport, &vha->vp_fcports, list) {
 			if (memcmp(rp->port_name, fcport->port_name, WWN_SIZE))
 				continue;
-			fcport->scan_needed = 0;
 			fcport->scan_state = QLA_FCPORT_FOUND;
 			found = true;
 			/*
@@ -3637,10 +3636,12 @@  void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
 			if ((fcport->flags & FCF_FABRIC_DEVICE) == 0) {
 				qla2x00_clear_loop_id(fcport);
 				fcport->flags |= FCF_FABRIC_DEVICE;
-			} else if (fcport->d_id.b24 != rp->id.b24) {
+			} else if (fcport->d_id.b24 != rp->id.b24 ||
+				fcport->scan_needed) {
 				qlt_schedule_sess_for_deletion(fcport);
 			}
 			fcport->d_id.b24 = rp->id.b24;
+			fcport->scan_needed = 0;
 			break;
 		}