Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2881721rwb; Mon, 15 Aug 2022 13:13:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Z9POCdqwQp9qy3s1eU0rcAAXFvcnxzl+/kp96nUId0Efvd1dHQMfCQiXU5535eUI97Ap+ X-Received: by 2002:a05:6402:5106:b0:440:3693:e67b with SMTP id m6-20020a056402510600b004403693e67bmr16166580edd.226.1660594413997; Mon, 15 Aug 2022 13:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594413; cv=none; d=google.com; s=arc-20160816; b=FS3PC6NpUNPLNhPC9JfTmPn6hz3F8dP46lsZw+f7yC+MJEgu0QAgqo3vIhJQoyXmEZ +RxJ4puk9EUEgOKfZOihq2k6oYyE9mKU8jhwXL34AqwuJ06Mt4fVVM02NRmnzbPZCGeN x88MfJZo3qAMXqeGi3myDPemhmmK1WeoGxe6pxiMf4gHoaR3ttQR+AQHIa5f9gA+lQ0M pYtDQZfsDRWlsc4eNZ6Fw8tFI1l1Q/QvODmU0H7fCwGkebs8i6stNMcW1YT7FbXa5Sa9 hRoGqDcskwZkLnYluowRSrjG2VZ0pyq/XjPQFS7yDUyPAC4dzvgJ+cwCWiTsEfGe0kB8 V3nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oSRzfd8QqbbfAnHdcG5UQ22WC3vfFeKwohoSY9PL+2k=; b=tSuLVNPZC7KeDVU5mHaUSamB40G5uosCZEdV6DUIRSOuA49fyO6zsiywc/6oGDy7Tk JdqM8CGGZ06kLnGZPGi4a7RHPh8jioaTLLwv91lc2FU9lJWKpRoVF6Ble5srYhpMgckp xjVvl3QIW1ZGFKz2zxQrsQWPO7uILmwhmZvFfNHladn8bYIcUh8qudjm/vNeBFdYRi5m j5xgXxqm0mRbNpDn2VuBfmZiSX4IfD+aEP5Dl3RAfJQaYg1SsqgA2ezg58TbWT2Aznop bh5auaNYJRNRQmDlIrJE/sIeO5IWUlx8yWygEguGwxZMOnAHjVkyKschm0Kew/VD1VRC LXJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wktWy4cG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lz5-20020a170906fb0500b00730c1b3d753si6725234ejb.424.2022.08.15.13.13.07; Mon, 15 Aug 2022 13:13:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wktWy4cG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345219AbiHOTqO (ORCPT + 99 others); Mon, 15 Aug 2022 15:46:14 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = 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) == FCS_ONLINE) { ql_dbg(ql_dbg_disc, vha, 0x2115, "Delaying session delete for FCP2 portid=%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) == FCS_ONLINE) continue; if ((ea->id.b24 & 0xffff00) == (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) == FCS_ONLINE) continue; if ((ea->id.b24 & 0xff0000) == (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) == FCS_ONLINE) continue; fcport->scan_needed = 1;