Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1150072pxv; Fri, 9 Jul 2021 19:36:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCAWbWO5fgeeJLhxEZlSJnTws0KUHExGhBrVTwnwzkBx/GgRxpLH7c20DnN5Ayctbh6W2L X-Received: by 2002:a05:6402:84f:: with SMTP id b15mr51957645edz.356.1625884618730; Fri, 09 Jul 2021 19:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884618; cv=none; d=google.com; s=arc-20160816; b=j8Xjkky3iOmiOPywTdzmByQhAMygrsvLnVIFD+rlZoOcHmz7rTD1j/u1YorGYfsdIS jlrB14iURVVqWcakLN1DULX6KSrm2d4XZXlT7uHr0av1+rPmP/kVhzJIkYxbEMKJzTGN Pte7bIX+BhgV6/j4qIbpYAy0Uub24V1vqqbYjCmcY86CFpk+69s4B0gj4xFoh0rEGmvb wkgZC//odtu9aPQJjsMGU4GaW2a8zE5WMZzbF5U15g7iQfW+xYsr6d15TJAtvr3l6/J4 isPnhZGIAkh7/XmkspqYiHAhIVdRblsqRvSAcUcfqVHcCLdZtjXzqlaaGdmYwupM2fDJ DeNg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eseE83bKZM1Thc+PhdngDaIZ6gf5CbS+PMoQM8H9wYE=; b=G8O298GcwgSzADxrmbmDZNs4fzt9GisaMBpZEDGOxCPvWxD0g3xi0vLzUwt6yMA9Xk /zLNJDp1szhsbDW0PY45iXtXOmzmf9S/CKTzh8oiRAV39ezy00/I62RpkFPAX8thbDzw k43Lbm3q7BH22GQOlIRIJmIgSU7X/nwLNKcklXO1KH0pgeU/pOYNsFPRS3jW3TB4WGHj 2YAxovzphVRDy5dixN6CHWWeeRfaJMNEvBWMSDzN46dL8lHGuRuFJ1J8C7bK2ID0Rmcw eMOC1CKSFgNEToFeQE4wq9mD5fvI9Md7KR/zX9RcxEoHKKZTyIzeezy7Zc2if6ycVN1u XI+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FmQFM2Yx; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jy12si9080156ejc.519.2021.07.09.19.36.36; Fri, 09 Jul 2021 19:36:58 -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=@kernel.org header.s=k20201202 header.b=FmQFM2Yx; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233655AbhGJCi0 (ORCPT + 99 others); Fri, 9 Jul 2021 22:38:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:53350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235693AbhGJCe7 (ORCPT ); Fri, 9 Jul 2021 22:34:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6D080613E3; Sat, 10 Jul 2021 02:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884332; bh=QWK2Ioeu2C4QThL6c2rnElPDISTOuWMOdSlKK0L2tZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FmQFM2YxS2uQIj4D5KStpbW7UhG0mryyHOfRcgmt4shvAPmEDUESvFGLykm3+UQXV myCBzFCqGyWY+hHQGdkA86dJ/o4Km28VwaKgdrEeH0MFYN3JA3JYOFB1XOzrQwpiRH YimIXZRNxpT6nx90XQQjZS+Jpsxihs7CimZF7ZxS4RcU0u70dfYtUXopKH3Kk2Zn6Q VBNAKXyxy8fVMmolBwraJxU8ddwgvhpcNZsrRSM5bztv5iGy+wD/vf2R2TyQzjJiav W8gKai4QkP4MfgDC28DcGvNzvLjBXxfhp39xqjfVTXD/E0WOjExVO3VpY/7Qr2L5bh 43HzLtvByKKzQ== 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.19 06/39] scsi: lpfc: Fix "Unexpected timeout" error in direct attach topology Date: Fri, 9 Jul 2021 22:31:31 -0400 Message-Id: <20210710023204.3171428-6-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023204.3171428-1-sashal@kernel.org> References: <20210710023204.3171428-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 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 6a4b496081e4..c4428249d3d7 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1176,6 +1176,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