From nobody Sun Dec 14 08:05:26 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE850C2BB47 for ; Mon, 15 Aug 2022 19:47:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345240AbiHOTqR (ORCPT ); Mon, 15 Aug 2022 15:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344447AbiHOTnL (ORCPT ); Mon, 15 Aug 2022 15:43:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E62BA41D14; Mon, 15 Aug 2022 11:48:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0B412611C1; Mon, 15 Aug 2022 18:48:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC325C433C1; Mon, 15 Aug 2022 18:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589307; bh=PxBqGK2Kj8p0vATicmcfzDVyrDcCLlfhoWha3BM427I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wktWy4cG7ng/MCglyZqGKEpWW2aLcvyndnStQOPEPjQkCgnveLjbfO9k0leRziCAy fAIJXa8Cw5WbGRbQm+uotIq1zYAWwRx7b2ZSdMnlSSaod2qub/n7Bsmnm5D24fW+ia PTr/KtsWt1wUGJT5sBxIXmlnlqN1v6MZnd2JKjwk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arun Easi , Nilesh Javali , "Martin K. Petersen" Subject: [PATCH 5.15 678/779] scsi: qla2xxx: Fix losing FCP-2 targets on long port disable with I/Os Date: Mon, 15 Aug 2022 20:05:22 +0200 Message-Id: <20220815180406.331391461@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Arun Easi commit 2416ccd3815ba1613e10a6da0a24ef21acfe5633 upstream. FCP-2 devices were not coming back online once they were lost, login retries exhausted, and then came back up. Fix this by accepting RSCN when the device is not online. Link: https://lore.kernel.org/r/20220616053508.27186-10-njavali@marvell.com Fixes: 44c57f205876 ("scsi: qla2xxx: Changes to support FCP2 Target") Cc: stable@vger.kernel.org Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_init.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1836,7 +1836,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t case RSCN_PORT_ADDR: fcport =3D qla2x00_find_fcport_by_nportid(vha, &ea->id, 1); if (fcport) { - if (fcport->flags & FCF_FCP2_DEVICE) { + if (fcport->flags & FCF_FCP2_DEVICE && + atomic_read(&fcport->state) =3D=3D FCS_ONLINE) { ql_dbg(ql_dbg_disc, vha, 0x2115, "Delaying session delete for FCP2 portid=3D%06x %8phC ", fcport->d_id.b24, fcport->port_name); @@ -1868,7 +1869,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t break; case RSCN_AREA_ADDR: list_for_each_entry(fcport, &vha->vp_fcports, list) { - if (fcport->flags & FCF_FCP2_DEVICE) + if (fcport->flags & FCF_FCP2_DEVICE && + atomic_read(&fcport->state) =3D=3D FCS_ONLINE) continue; =20 if ((ea->id.b24 & 0xffff00) =3D=3D (fcport->d_id.b24 & 0xffff00)) { @@ -1879,7 +1881,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t break; case RSCN_DOM_ADDR: list_for_each_entry(fcport, &vha->vp_fcports, list) { - if (fcport->flags & FCF_FCP2_DEVICE) + if (fcport->flags & FCF_FCP2_DEVICE && + atomic_read(&fcport->state) =3D=3D FCS_ONLINE) continue; =20 if ((ea->id.b24 & 0xff0000) =3D=3D (fcport->d_id.b24 & 0xff0000)) { @@ -1891,7 +1894,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t case RSCN_FAB_ADDR: default: list_for_each_entry(fcport, &vha->vp_fcports, list) { - if (fcport->flags & FCF_FCP2_DEVICE) + if (fcport->flags & FCF_FCP2_DEVICE && + atomic_read(&fcport->state) =3D=3D FCS_ONLINE) continue; =20 fcport->scan_needed =3D 1;