Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2484747pxj; Mon, 10 May 2021 04:13:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1+bc3plQicEguZ26greHutl3su4Z0IPtoZ2Scod+/C9/6BG64gvx0fIvn8OTU+VrbQc6Z X-Received: by 2002:a17:906:7c45:: with SMTP id g5mr24583254ejp.368.1620645196214; Mon, 10 May 2021 04:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645196; cv=none; d=google.com; s=arc-20160816; b=Qdz0NjZ052wKauaGICfoZ0vIXSZun/SGyW2VBsVsy7oGzYwuVu3Voge51CJJ/RlnEl xKMqXu5HP8bfnMiO+F2IHJ9ydNUYOBJVr109quZlKl77s2jP/0hdSVI5RzCwnMuKKysf VpMQ2A7vKOOgX/i3KdHdezMJ4aintPJomJ28q5eQxtT+H4uUKwabHFQu7lpy+oFfwqCh jMWeR2OwSglVKiENlPD+WJLuqcPMFg9t1gpIfCQzjEkkV1/lBphqvmUlASs65COq37vU jU4oTA5hHIsnUfuswSesop+LGCMaDtPryRddc4VXiRrdZHhLf/ANvdgehFCeIeeyFer3 PI2Q== 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=RlxOvhoqH3zouDYwXvIUTHcTvxy5ffyILRyGboHLCnY=; b=psLk/GiiLo+5/ReBBQcga8A4c9zFpsFgLb11z1d9dWUMbBVEloYqPH1AS67EJwsdMX TGWEyIg+Z+wJYE4L8gZfHIiIrwPZogUX1ELjHPUwCubdhREt/6UjhBq4gYhCeuby5PAS SDdoRAK7prd3icfB5xTVcb2iOtfuQpwBzQwpzNODUMKqT3YGhW+PXjWS65c4YCLjrAE7 NwGXuMO35Sih7XBaqHzOpvaWSrOtM72uVDNidPxFNe5s6RKmEUE1sLcc3OCGSINjy3CI QzXo4RWmZJP6R9IQYu910uIqSSTD7yMklNuqQxwY/B4B/tXhIsIEosqO+k+wrHPX7sNF A9gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KVCnoiB0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si12868081ejd.49.2021.05.10.04.12.52; Mon, 10 May 2021 04:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KVCnoiB0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S236410AbhEJLID (ORCPT + 99 others); Mon, 10 May 2021 07:08:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:59672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbhEJKrq (ORCPT ); Mon, 10 May 2021 06:47:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BBFA56193E; Mon, 10 May 2021 10:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643055; bh=lKWxNTOWjPG44IWEhdFXKE9eCDYo0NONZEZVahLVNNQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KVCnoiB0LmSLFDVom3nJJI6tmMKEMoeYKb1mPxp7+b9544ngUyuwgoK95uH48FA7I F2LP/0P0dqKXpblVV9lTeSemj5zuZWWinxGKTsxDwy2vHP1BQCLNFckKvtpi4j/ZvT Fg/ow/NPHotsOOVi2u/SEe2eTYsgNRT5KVIn+wnc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 124/299] scsi: lpfc: Fix pt2pt connection does not recover after LOGO Date: Mon, 10 May 2021 12:18:41 +0200 Message-Id: <20210510102009.075255492@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ Upstream commit bd4f5100424d17d4e560d6653902ef8e49b2fc1f ] On a pt2pt setup, between 2 initiators, if one side issues a a LOGO, there is no relogin attempt. The FC specs are grey in this area on which port (higher wwn or not) is to re-login. As there is no spec guidance, unconditionally re-PLOGI after the logout to ensure a login is re-established. Link: https://lore.kernel.org/r/20210301171821.3427-8-jsmart2021@gmail.com Co-developed-by: Dick Kennedy Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_nportdisc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 92d6e7b98770..17be94496110 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -903,9 +903,14 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, } } else if ((!(ndlp->nlp_type & NLP_FABRIC) && ((ndlp->nlp_type & NLP_FCP_TARGET) || - !(ndlp->nlp_type & NLP_FCP_INITIATOR))) || + (ndlp->nlp_type & NLP_NVME_TARGET) || + (vport->fc_flag & FC_PT2PT))) || (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { - /* Only try to re-login if this is NOT a Fabric Node */ + /* Only try to re-login if this is NOT a Fabric Node + * AND the remote NPORT is a FCP/NVME Target or we + * are in pt2pt mode. NLP_STE_ADISC_ISSUE is a special + * case for LOGO as a response to ADISC behavior. + */ mod_timer(&ndlp->nlp_delayfunc, jiffies + msecs_to_jiffies(1000 * 1)); spin_lock_irq(shost->host_lock); -- 2.30.2