From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0C08C3A5A2 for ; Tue, 3 Sep 2019 14:52:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C36C220828 for ; Tue, 3 Sep 2019 14:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728490AbfICOwG (ORCPT ); Tue, 3 Sep 2019 10:52:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36650 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727069AbfICOwG (ORCPT ); Tue, 3 Sep 2019 10:52:06 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18C3A106E289; Tue, 3 Sep 2019 14:52:06 +0000 (UTC) Received: from emilne (unknown [10.18.25.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D5045C22C; Tue, 3 Sep 2019 14:52:05 +0000 (UTC) Message-ID: <6d2e37919382da6ce94d250e8af91f75df42ed03.camel@redhat.com> Subject: Re: [PATCH 5/6] qla2xxx: Fix stale session From: "Ewan D. Milne" To: Himanshu Madhani , James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org Date: Tue, 03 Sep 2019 10:52:05 -0400 In-Reply-To: <20190830222402.23688-6-hmadhani@marvell.com> References: <20190830222402.23688-1-hmadhani@marvell.com> <20190830222402.23688-6-hmadhani@marvell.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Tue, 03 Sep 2019 14:52:06 +0000 (UTC) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org On Fri, 2019-08-30 at 15:24 -0700, Himanshu Madhani wrote: > From: Quinn Tran > > 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 > Signed-off-by: Himanshu Madhani > --- > 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