Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1145169pxv; Fri, 9 Jul 2021 19:26:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMxPjdnjguFbq6aDSaj+KXuQsSUt2nb50BdERLBBxe0jj7/TczGQ3I0t896InFVzelSf9x X-Received: by 2002:a05:6402:498:: with SMTP id k24mr52055796edv.25.1625884013598; Fri, 09 Jul 2021 19:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884013; cv=none; d=google.com; s=arc-20160816; b=yABm6InwlnuZz23/V3o2WwSk3dHyPiqOeuZxyhPdCznLGYFpN1oU0M5eoC/W9MbH09 rJp93djGBckGxZtInE/rDtd9zWIUKU3XPCX+H1p2m4+UZZj2DZ8mS2rbEF7auxVoUWVY 5SeoonFFVdbjaRT9vX9VKzQf694Yn5wbNphls0fF5CzX7LgOYetKEfNXxVzXjvAo/2V2 G5DJrWWC/A4aqoiezZFeiQwQnRGU3D4RcgrlvLOmV0xHNA4tdKnFMPaN1O11G5oTD/VI 0x0lB5bEExnjqeT9J11DmUUUXEnf6cSr54DH7IPj2RAX+seheS9ccZBzPLDqANGxqRpz eI8g== 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=MNFvqvPqENrqk1xfJWdrLYrsUhxoLwRKUmiU3NEJWLY=; b=K41ca3KCndBWUiasTPgdamdi1wusVdfiSeUJH4i5klxWYS/FImKprnq1NLHACXAHPe 1TqC8ubpLctGFoPeijMZls0hM2ESNy7dEwb+pC419vgS26/jDwM10+p5Ki4UxKdWjx+Q 9a7+27Gv9farqgGvTM+NRJvxvdYn4O3YjdxDONYSI+fIBM1nRQYssfODjzUJtpEA2Epi QPAo1BOASGuhUeh7HnXmezEXbjBVSAgsXNph30FRJt0sw3RrdTQr2IjmeHKT+9iJwvSb JBl8lWamJbtO/kSmM9/8SSF+sH8weaEmnueZ4dUqNMLS5DOa4O5JM+g0voDNamiAIsFZ ROAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uBhkxarH; 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 r11si5709662eja.61.2021.07.09.19.26.30; Fri, 09 Jul 2021 19:26:53 -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=uBhkxarH; 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 S233306AbhGJCZo (ORCPT + 99 others); Fri, 9 Jul 2021 22:25:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:41746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232987AbhGJCZP (ORCPT ); Fri, 9 Jul 2021 22:25:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF4C1613FE; Sat, 10 Jul 2021 02:22:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883751; bh=Nlwo7l5fAtkr8Blh7jSTTLgkcu54BETD8yERfY0WbY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uBhkxarHM0RahufUobumhqKrpExd/wt0dd98vvpnyKk4Pg5nMxDDVC8HzI8nmPj8t B11w3vFikoFDvsoPiGPzmWTeN4MHAhvaHeHe18GgRgHheOtJp6n4axkFf+OeoN1E2C gidqxkmjphEPf6c4wjnwPFeZC7btKM3bjn0ot496m6VXT92ldPJYzcMLISbdm915Di S0Y0JXhp99i4WPtaUEzHhH8yD3xlGo8nepRF1s804xLRcPJ9WOpWff/VPrzGoe3Mgh cyXJWhv3kspYl3mkscjG73OrO12nHlqE6efO+5iIjV48a/nqc07SIq0jaOdzKGmrCH HZ272LU1vv4BA== 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 5.12 027/104] scsi: lpfc: Fix "Unexpected timeout" error in direct attach topology Date: Fri, 9 Jul 2021 22:20:39 -0400 Message-Id: <20210710022156.3168825-27-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-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 3dd22da3153f..3e101c9272b4 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1175,6 +1175,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