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 X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99051C11F76 for ; Sat, 10 Jul 2021 02:38:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7CA42613C5 for ; Sat, 10 Jul 2021 02:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234621AbhGJClO (ORCPT ); Fri, 9 Jul 2021 22:41:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:58438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235605AbhGJCji (ORCPT ); Fri, 9 Jul 2021 22:39:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E986161407; Sat, 10 Jul 2021 02:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884523; bh=61jupdmQGE4DaqZyoqeliw9Kz+c4O+YUOWY+gabZ3hI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PZXop379VChv6MUkaRPk7tDT0y3T0HLbJLneX2j3WXWjn5fcsXSgQY8qd1bCkWOOS EMuP/DvHG6G9ueQ2y9Apv+5oKBwT/zZeio6Zb+MPKAmN2uCAX9nU0f32PC1kEYkxeN 58FACFOxWgH2YMkJKejAhab8O2wp7qbm0Yxm2oWO96rwoG3PsaNSvqL/JTYQBLWWAI z5AnJ8F3zab4WcWVuxTQLDEOrGkGunf9N7GsE/2tzuuZi+VTpKNEtUvvaXsRfwx672 NLVy/yTDWbMkueIfrJKoISxXfE+fHgBgpYGg/tmA3PGad78F//++UZrBt+8RVVTvvt NOGL8uy/C5PsQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: James Smart , Justin Tee , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 06/33] scsi: lpfc: Fix "Unexpected timeout" error in direct attach topology Date: Fri, 9 Jul 2021 22:34:48 -0400 Message-Id: <20210710023516.3172075-6-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023516.3172075-1-sashal@kernel.org> References: <20210710023516.3172075-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: stable@vger.kernel.org From: James Smart [ Upstream commit e30d55137edef47434c40d7570276a0846fe922c ] An 'unexpected timeout' message may be seen in a point-2-point topology. The message occurs when a PLOGI is received before the driver is notified of FLOGI completion. The FLOGI completion failure causes discovery to be triggered for a second time. The discovery timer is restarted but no new discovery activity is initiated, thus the timeout message eventually appears. In point-2-point, when discovery has progressed before the FLOGI completion is processed, it is not a failure. Add code to FLOGI completion to detect that discovery has progressed and exit the FLOGI handling (noop'ing it). Link: https://lore.kernel.org/r/20210514195559.119853-4-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_els.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 566e8d07cb05..8dc60961e47e 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1170,6 +1170,15 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, phba->fcf.fcf_redisc_attempted = 0; /* reset */ goto out; } + } else if (vport->port_state > LPFC_FLOGI && + vport->fc_flag & FC_PT2PT) { + /* + * In a p2p topology, it is possible that discovery has + * already progressed, and this completion can be ignored. + * Recheck the indicated topology. + */ + if (!sp->cmn.fPort) + goto out; } flogifail: -- 2.30.2