Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1859807rwb; Fri, 19 Aug 2022 10:34:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR6X33+bhypqN6ocowoQ3n+pGfcVjHQwOLw2G0exx4ec2lOUvGKW3OZXFEakBF0EX0wVB0w3 X-Received: by 2002:a17:90a:f88:b0:1fa:da0f:5e6 with SMTP id 8-20020a17090a0f8800b001fada0f05e6mr6140824pjz.102.1660930474163; Fri, 19 Aug 2022 10:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930474; cv=none; d=google.com; s=arc-20160816; b=irINr9IhlyQAkZRsZaf0DPUonVqkyA0EWocuoCUJYYVNxPNu1hr0dbFLanzTzQGkFB 0CKDpDWsaT9rek/Kv1hTkP6Gjf2ktr7RNvcywZ5gfF569l1M5pcwbpA9sXUGf9jv4b0o 2BoFHZYu+yeP/knLixNTbzvta+Up5tM8GqLltlhOAKwhnWSX3WH2cM34Covc7bdxJT+6 z/L2bMq2T/Ch/jQAJ8NYyNRxeiF+iNjOP8mlar5AkKFRZT/nKb9Zm95QST9jqPqdA2ou 9CSorvuWoZMtYNPPwuE1p+dXPXsUrr94eQB4w5QVu1eitLE98vyUp/ZDjcQyHq7Qt0pD U2Og== 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=76EcrLqmQaiel40H44Znkm1mdD6RgvP+fa8Qpm8rqKs=; b=Ik+xusBslP50lsqWt3KoEEPQlIdSjvorAR6Xt4TELrHiGBcMLODNa4A91+PuS5t4se aptjUao6B8nPtnG9WHDtCJhhC+7A2pnBkDLATJe0ElUkGoN8+uuPAZDXl/hUTjrpWWSZ Qbw07CvLuu7OUwMNsuAs0b1isukGaQr4v/S2+E5sgFZ9VTfBRqZHkPKwWUPkvJd8XvVs fhnln4v9F0yaUnNpCGpjV/tqiWrwcX9xtjXJYpwldlYnn+BB6zlER4BXXzwTc+q5ksCk 38jE3oIdqOIzOYgeoA98xtBt9K/FXE4ZKhag+4scSgyoPVjaYWOYnrnDUTfeQbC0yQhE yECg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DF/PDYCn"; 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 k1-20020a170902ce0100b00170d34b95cdsi4458725plg.185.2022.08.19.10.34.22; Fri, 19 Aug 2022 10:34:34 -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="DF/PDYCn"; 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 S1353916AbiHSQp2 (ORCPT + 99 others); Fri, 19 Aug 2022 12:45:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353625AbiHSQme (ORCPT ); Fri, 19 Aug 2022 12:42:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CFB31296FC; Fri, 19 Aug 2022 09:10:57 -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 ams.source.kernel.org (Postfix) with ESMTPS id AC7B7B825D3; Fri, 19 Aug 2022 16:09:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02A3EC433C1; Fri, 19 Aug 2022 16:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925377; bh=6n9zMhMjibMnoxJAvUJgUwuv1vcKVmaFXEhQLCNELsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DF/PDYCnBflffzhreUAq9/W1adzn//rhs65SSiqE6EaUzfQgBuzjaluXMHWDqp3rz fZ0F4VVQ2dEs88tPGcgi22jAVUup6owTeWEMW3LRG2Q8O2FudcRc9IvNDJ8hlBRjrW HfpwQRUpsi1YUUStxIkw9UaeEgHV/9durJIIw9FE= 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.10 443/545] scsi: qla2xxx: Fix losing FCP-2 targets on long port disable with I/Os Date: Fri, 19 Aug 2022 17:43:33 +0200 Message-Id: <20220819153849.261964005@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 @@ -1734,7 +1734,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); @@ -1746,7 +1747,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)) { @@ -1757,7 +1759,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)) { @@ -1769,7 +1772,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;