Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp685769pxb; Tue, 5 Apr 2022 18:45:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5guCoAldHJlaTVhUPCFjjinEg6ELEF9+/TAa6fKkUzIyVr4dSAdofvtRJgWJQHGUFP76t X-Received: by 2002:a17:906:5006:b0:6ce:3762:c72e with SMTP id s6-20020a170906500600b006ce3762c72emr5986986ejj.30.1649209384207; Tue, 05 Apr 2022 18:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649209384; cv=none; d=google.com; s=arc-20160816; b=uhClcTrGyIg2BtdRlhzSS3H+PVCmT6QklvcX8DZ6RR5vgqOnG2GbQVk7f33e6/Wa6w 7ifxYKAWl8lLR1gB4QHezord2AY3Zh3TrWNZrRaMl3h4cnGTI5+RQRXu89qxkfQCxTVv nr7cp+9NbqLmi5ykU2kFRwd/3O3GZZXVml9vXddhVHUNPzDVzsK3TR0o0h40JNG7FZ8T fUrwGpcwbsSWNxVBMeYlWLfJZ2AYSrYMl1f5FTLawqdV22XmLqlUE1XX1Tkb5GWDSfjx pK0ImZANE4oSQdTS7bOuLAxtjq+meDOcw8tZWPLDRxpbAFMZc26BAfsG0ENoa1EWm/WG HrMg== 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=cmqH4EO4q8nDGfxrhy39yqUQ1toDnw1uq/8W8Yt3hIA=; b=NwRHrK73bf3szpQQNSP+nCQ9j78hStXic5wAoXV+qjd7lvsdmOPiEnS3kFRsgQr0zG bDETsWemiEBWRY7bf9iMEPnAPAyfzlAVaUe0gfO6stIFoEA994qKRupqSAiUO72eBa12 Q3WP0bjzIqSUmeqcp1WiQ5IB2foEA/hArrazb4+9o7AXSeGvKULYc+4fEtIkjt/GVDuW EJGFOqUoe3O5dMGcXdrvg1okSgp7wG6fkA6x2a5YnTYk2Jyb1BXcQzS3JzdPG9Gr7XnQ lT7DNJxj7SEjpckwI96uuzj2TmvflppW7Q6WpJKdhOADI/p4wq1C3oaacug8aDyZRi0V xqFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JbmDxpel; 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 g14-20020a170906c18e00b006df76385c4dsi7061853ejz.237.2022.04.05.18.42.34; Tue, 05 Apr 2022 18:43:04 -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=JbmDxpel; 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 S1384523AbiDENcW (ORCPT + 99 others); Tue, 5 Apr 2022 09:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345872AbiDEJXH (ORCPT ); Tue, 5 Apr 2022 05:23:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34744A5E8D; Tue, 5 Apr 2022 02:12:24 -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 C647561527; Tue, 5 Apr 2022 09:12:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBF47C385A2; Tue, 5 Apr 2022 09:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149943; bh=m7G20AubjvcX73uuvdxB1UoNXmtJuvwEgYN+98yPEXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JbmDxpelTCX1Ok1gIedzMdHZM6VIHrP1gnNEGXyysLQmouGs1RS4wqgxewtKRedio 3oWm9jxuou6r+jCdEKKjLwl6VkPpgSM8ZRPInLunhBel28XMLXCBu/U5HdAyqbhUBt KXRTmPYyU9uDe5K5L48Tuk6p0TGK0Pc1suxRaKpk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Himanshu Madhani , Quinn Tran , Nilesh Javali , "Martin K. Petersen" Subject: [PATCH 5.16 0897/1017] scsi: qla2xxx: Reduce false trigger to login Date: Tue, 5 Apr 2022 09:30:10 +0200 Message-Id: <20220405070420.852885310@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 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: Quinn Tran commit d2646eed7b19a206912f49101178cbbaa507256c upstream. While a session is in the middle of a relogin, a late RSCN can be delivered from switch. RSCN trigger fabric scan where the scan logic can trigger another session login while a login is in progress. Reduce the extra trigger to prevent multiple logins to the same session. Link: https://lore.kernel.org/r/20220310092604.22950-10-njavali@marvell.com Fixes: bee8b84686c4 ("scsi: qla2xxx: Reduce redundant ADISC command for RSCNs") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1644,7 +1644,8 @@ int qla24xx_fcport_handle_login(struct s fcport->login_gen, fcport->loop_id, fcport->scan_state, fcport->fc4_type); - if (fcport->scan_state != QLA_FCPORT_FOUND) + if (fcport->scan_state != QLA_FCPORT_FOUND || + fcport->disc_state == DSC_DELETE_PEND) return 0; if ((fcport->loop_id != FC_NO_LOOP_ID) && @@ -1665,7 +1666,7 @@ int qla24xx_fcport_handle_login(struct s if (vha->host->active_mode == MODE_TARGET && !N2N_TOPO(vha->hw)) return 0; - if (fcport->flags & FCF_ASYNC_SENT) { + if (fcport->flags & (FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE)) { set_bit(RELOGIN_NEEDED, &vha->dpc_flags); return 0; }