Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3796662pxv; Mon, 19 Jul 2021 08:58:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYta/w4rBszCAwKEkZDCEfecK+QtIoOnDfPMB9GoiKCngWS/dCKEMwpgVrvLPVEnomvlFR X-Received: by 2002:a02:94af:: with SMTP id x44mr22636485jah.79.1626710334923; Mon, 19 Jul 2021 08:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626710334; cv=none; d=google.com; s=arc-20160816; b=bCQW83fuI22Br0Y2TQn1aU7EXbVMIbyN45CCTKGTV2NwC2wW31YXkFnnSYdY3EKtlk i65Lh9ziPQxP+7VpS9EnBgXnRTS7iYbzGuyNqujOTYACgnTt7ohorsKN38eyMpXrnGEU +DsuQj1OY13APf66KYXk3zYGqmW9T/lKMRqB85avpgZexHx1QJiIbdYppGqFTfJa3q/D 4HJYQjft9YVcDKjvtvupx4R8wksKDB9wCavUHQufuRD31gFXVy7mwIC+3zsFCyrOTqTW 17H3+pkUK77W6Qug3zkBKfGVMyE7hFMUNoB+0PYcd8XUV1YgFjmq6a2YXWEZ/Q0N/L0L fBCg== 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=wqGKLQCvAgEc4qx32KAr3pw2LfPsKxLIITSdC8hWypI=; b=oq9B+rnbrk3JmBhWsLSOrS+0w9va2MxhOEEPnxhQACdPZAd6fF6Exnjb2zmChWkjBW 266xiklYl1kTd7q5WEhwi0clxd7IZ9JqLMgh1ei4mgS8naqLdxzGWVjVK9kViN8L79b9 7S7SM4YAUwUE/qdNAlDXO5FMjYRouN6rsEQEt/jMl/I+swO+KvlqZUYSu6pbxC8I+Oro 3Xg0ytbmNix37wVwdGmtZHhl+noJzOos77vVp+GzfXymApLsP1SjodirJspiElDff4sK f5WnVtW4jkr8yNeZUHL9lFZjraxdb3NJgy1fy59Rf619Tsx55w7L6f+jzcxcTPIMhWb6 3FmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CpvAgplZ; 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 f11si22301788ils.120.2021.07.19.08.58.43; Mon, 19 Jul 2021 08:58:54 -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=CpvAgplZ; 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 S1347087AbhGSPPe (ORCPT + 99 others); Mon, 19 Jul 2021 11:15:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:40460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343700AbhGSOsc (ORCPT ); Mon, 19 Jul 2021 10:48:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 838FD613AA; Mon, 19 Jul 2021 15:24:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626708254; bh=Q0caqXVsDhVPbVYfCzSZO5SvM9JmE8nGHJKeeRifSuI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CpvAgplZyfdxgcwEk2cdqzb6dS2GRHoPiJ7q2mIoH81HNSz4qTSxv7BYeY3wjIg0O LpCIOWdT9tUdAonK5pTC/L3DcpJKuENInSv+OoIhgy9/W3PD0ljMUt1lsxi0GasP6b +C7Imwhhquor02yMWc5NJn7vEVorSBLcEkC5MSD8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Justin Tee , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 240/315] scsi: lpfc: Fix "Unexpected timeout" error in direct attach topology Date: Mon, 19 Jul 2021 16:52:09 +0200 Message-Id: <20210719144951.313606526@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.861561397@linuxfoundation.org> References: <20210719144942.861561397@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 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 @@ stop_rr_fcf_flogi: 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