Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp945482pxb; Wed, 6 Apr 2022 05:02:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaMBQ1714aFPQdGYUMggS/flJlD9iSaNz36GQ+2pyxATaECbvWgN8ODH6KRx4tuDVc46Kf X-Received: by 2002:a6b:ce07:0:b0:611:5754:c109 with SMTP id p7-20020a6bce07000000b006115754c109mr3969756iob.58.1649246542801; Wed, 06 Apr 2022 05:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246542; cv=none; d=google.com; s=arc-20160816; b=JuWdgYhPJvWMkMnzHQMc9skLTnn0ukQi1spiZPW4sFP7T9Ohj8IVi7YVLeefEzZc6e ikJgEhaJ+XJ7903JR0p6DH7FdhKczYIoosqPsgr9lsnRb+T/TzdGPXMkdve+c4KBDWNl 1uIdrLbnGIicRrLkPNUuIKR5AYJrbzg6zy5a8vgSqzAMXkyPGLWwwKvomN48s61HmIDQ rPDZMU6jDJUE3GFet6rlFkPXgBJGVB+3pWMJV74oib6El7SV4LE2nKa/7Ib/bC8MDm9p m5hzwI2jJ0Mh5uSMiCZnfklI7hjglJ57c5mlKFZofulMiwX+zB4aDjwzY6rbxSBoREWW YAmQ== 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=SEEtxjzRCvTpN9ZcPnk0cjpNyC/jqJzAm4HraJBS+Xo=; b=JkUqk8ieDOxWFh+KRcPVi5AEN4KYef2GVaIqhXY7eg/hxoD6NS4dN0Evv6K9SzCgc3 +hOn+W0KX6EWJXqiTkB5vD6Ia2eXMyPxnwyW7DGyBC1Br+dyUM98eadbvMOooYNuCTdk 1uQWMIYvs8MeR2ExqwUglr2pmnl5jDOayguFYH6rkG/DkStFo81j3/RhrHn9qJOCyG6/ ivplkHOfSImwHAPS00L3qH+21vT7pf5Su8FiU3AZ9q015EjV4oog4s8Do9OSxJJmatc7 x0iRYmdJuPh4xjFxwPON3YcT9EuvosL9hz9VznMlC/8NAoiY6OCmFEZpx96VXpSP7UzH cuXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iqTozbOu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k19-20020a056638141300b0031a2a42162esi9821897jad.80.2022.04.06.05.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:02:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iqTozbOu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7CD475ABD93; Wed, 6 Apr 2022 03:29:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1835507AbiDFAb4 (ORCPT + 99 others); Tue, 5 Apr 2022 20:31:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353360AbiDEKGC (ORCPT ); Tue, 5 Apr 2022 06:06:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4E14BF523; Tue, 5 Apr 2022 02:54:49 -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 701EEB818F3; Tue, 5 Apr 2022 09:54:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D315CC385A1; Tue, 5 Apr 2022 09:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152487; bh=BAenPI3zniYQ1aDVr0sckXD6pqxgQvsfzeAhizKzmqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iqTozbOuTRE0Cfa8183oCmOO+g5th4prOSniKTHBl4vFugZ+MEoe9U50f0znPU0Ll 30tu7Dxq4Cs/l6/XndMuVqpwWHN/jaIGx4Ju+YltKatvQHIIZS54yt4kbxkzb/UIaF KWYJiNqsqEBAsrAMwLHfUCyTVzPH/MsrPpcxiug8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Himanshu Madhani , Arun Easi , Nilesh Javali , "Martin K. Petersen" Subject: [PATCH 5.15 795/913] scsi: qla2xxx: Fix device reconnect in loop topology Date: Tue, 5 Apr 2022 09:30:57 +0200 Message-Id: <20220405070403.663121467@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 8ad4be3d15cf144b5834bdb00d5bbe4050938dc7 upstream. A device logout in loop topology initiates a device connection teardown which loses the FW device handle. In loop topo, the device handle is not regrabbed leading to device login failures and eventually to loss of the device. Fix this by taking the main login path that does it. Link: https://lore.kernel.org/r/20220110050218.3958-11-njavali@marvell.com Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani 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 | 15 +++++++++++++++ drivers/scsi/qla2xxx/qla_os.c | 5 +++++ 2 files changed, 20 insertions(+) --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -975,6 +975,9 @@ static void qla24xx_handle_gnl_done_even set_bit(RELOGIN_NEEDED, &vha->dpc_flags); } break; + case ISP_CFG_NL: + qla24xx_fcport_handle_login(vha, fcport); + break; default: break; } @@ -1564,6 +1567,11 @@ static void qla_chk_n2n_b4_login(struct u8 login = 0; int rc; + ql_dbg(ql_dbg_disc, vha, 0x307b, + "%s %8phC DS %d LS %d lid %d retries=%d\n", + __func__, fcport->port_name, fcport->disc_state, + fcport->fw_login_state, fcport->loop_id, fcport->login_retry); + if (qla_tgt_mode_enabled(vha)) return; @@ -5586,6 +5594,13 @@ qla2x00_configure_local_loop(scsi_qla_ho memcpy(fcport->node_name, new_fcport->node_name, WWN_SIZE); fcport->scan_state = QLA_FCPORT_FOUND; + if (fcport->login_retry == 0) { + fcport->login_retry = vha->hw->login_retry_count; + ql_dbg(ql_dbg_disc, vha, 0x2135, + "Port login retry %8phN, lid 0x%04x retry cnt=%d.\n", + fcport->port_name, fcport->loop_id, + fcport->login_retry); + } found++; break; } --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -5518,6 +5518,11 @@ void qla2x00_relogin(struct scsi_qla_hos ea.fcport = fcport; qla24xx_handle_relogin_event(vha, &ea); } else if (vha->hw->current_topology == + ISP_CFG_NL && + IS_QLA2XXX_MIDTYPE(vha->hw)) { + (void)qla24xx_fcport_handle_login(vha, + fcport); + } else if (vha->hw->current_topology == ISP_CFG_NL) { fcport->login_retry--; status =