From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4C6FC43334 for ; Tue, 14 Jun 2022 02:22:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353979AbiFNCWl (ORCPT ); Mon, 13 Jun 2022 22:22:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352009AbiFNCP5 (ORCPT ); Mon, 13 Jun 2022 22:15:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A045D36156; Mon, 13 Jun 2022 19:09:26 -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 709FF61014; Tue, 14 Jun 2022 02:09:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EE39C3411B; Tue, 14 Jun 2022 02:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655172565; bh=f+gNgyrZfvIXtSqTYbU3pgS74xuHjz/V3tZOTKB6h9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KpZju569xxuPoMhaVoZ8Lv9gES/SdspGJY+4K/nt0d3Vy7N4OGmjLEX4XVXrtXiWV Bt2KyHWoWGsG81fg37ulueR0/9wI1y9z8clW9PVp6ztiTmeAsN0GGoE8/N1TJPoAsr sGAbA+JagQ0HTdI6ZWtTJeQvTDVzY5FtCKq2ypyps05nalPrAuLq8S/cKERfnIUliE iIRAKLRUpwxfqedOkFnKzuzTyFLYC1IFxCR4lxFZYJElCbD3eeAiJ37oy4obalCKny thcdY1Pvi93LnIsfuUrAVNbx2plIrJfk2Giqrmb2qxcm+b+huss+XoIBEuDCxnre1Y 4tsGwk7laWByg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: James Smart , Justin Tee , "Martin K . Petersen" , Sasha Levin , james.smart@avagotech.com, dick.kennedy@avagotech.com, jejb@linux.vnet.ibm.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 14/23] scsi: lpfc: Fix port stuck in bypassed state after LIP in PT2PT topology Date: Mon, 13 Jun 2022 22:08:50 -0400 Message-Id: <20220614020900.1100401-14-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220614020900.1100401-1-sashal@kernel.org> References: <20220614020900.1100401-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ Upstream commit 336d63615466b4c06b9401c987813fd19bdde39b ] After issuing a LIP, a specific target vendor does not ACC the FLOGI that lpfc sends. However, it does send its own FLOGI that lpfc ACCs. The target then establishes the port IDs by sending a PLOGI. lpfc PLOGI_ACCs and starts the RPI registration for DID 0x000001. The target then sends a LOGO to the fabric DID. lpfc is currently treating the LOGO from the fabric DID as a link down and cleans up all the ndlps. The ndlp for DID 0x000001 is put back into NPR and discovery stops, leaving the port in stuck in bypassed mode. Change lpfc behavior such that if a LOGO is received for the fabric DID in PT2PT topology skip the lpfc_linkdown_port() routine and just move the fabric DID back to NPR. Link: https://lore.kernel.org/r/20220603174329.63777-7-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_nportdisc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index df2f7c3d7f84..e6a94f550a57 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -842,7 +842,8 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, else lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); if (ndlp->nlp_DID == Fabric_DID) { - if (vport->port_state <= LPFC_FDISC) + if (vport->port_state <= LPFC_FDISC || + vport->fc_flag & FC_PT2PT) goto out; lpfc_linkdown_port(vport); spin_lock_irq(shost->host_lock); -- 2.35.1