Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17936020ybl; Thu, 2 Jan 2020 15:08:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxwKnbbi2kVrLTjDrhz8ifwiucLqYDgWeD7AhvkdowcL1Ic1kVsCNeEx5Pe1X6aJG0jv920 X-Received: by 2002:a9d:66ca:: with SMTP id t10mr94024981otm.352.1578006500785; Thu, 02 Jan 2020 15:08:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578006500; cv=none; d=google.com; s=arc-20160816; b=ROEzKBNCBzadeo1IqwoHfiCBlYsZ4aLjpyiIB9DzDNy/kr9iWEASMLR0JlYcGdFpcs aGSkBUdN8XvrrCh4nBcdobRewYHbmiHxPXy2BdE99UjC9wE0dRy0El+RMm9flEH0jyWn RIevixpeUrg+L29xdomMWPvG1TUTX7lH5RzA8vP5UM5eHyHsNN3xs3n2MQN8GMNTkDot h1M9o4TlZF187SPEfu4sZ60hErCOdz6rFpaD7F6MwZtF52D5a5wTJg1dkJwGxKRr/FJK UfBcX449uZyx+PeYb0/GLY5WqLrgEwLClv1WnHiU/t1NJWgWpvVVH3xJwpns4t5JTHuL EWTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+nmokO7A+uMx9hvnVzUbGzyd+uxd8lF10t02q3vunF0=; b=RO3T/uM5eo6Imml/seYLReRZ9iq04yucA7n2xitMtOMiEnvzK/peDsWMsUMvjOhz7F zFCkw+9MjRa27nHpFAKksCFq/+waJvB6lb0oQhl04NZE0OD+b3I6JBem5OZNd1QjlRUJ f+8NpDXmraXRgNWvIV8KOUlY7mAaWfSb/HzwvJaQLgXLXiqWTJvCUeI+LwyqhD8ROMlJ 5jaknAWXNaitdT8eCID7oGIQ0JOEDb5P+doyfMp6fUZj7XuxVG8DrILuTng44MpL+S+r zpb6DQgxH1l1Tg2Hp8noA4jREzVfh61HVIBYe9Y/tEtzPn5mLmycbFIYBmt7c+sSH6yl Eq2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fT6lYxno; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t12si29098884otm.224.2020.01.02.15.08.08; Thu, 02 Jan 2020 15:08:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fT6lYxno; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728976AbgABWXg (ORCPT + 99 others); Thu, 2 Jan 2020 17:23:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:45748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728702AbgABWXa (ORCPT ); Thu, 2 Jan 2020 17:23:30 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7C19A20863; Thu, 2 Jan 2020 22:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003809; bh=jiSvaxBDjkCBemgJ5XeB3xgTB9iiVkXAPKRc9uT66Ms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fT6lYxno+X4Wdlj0q/5TvcPJ+ss3/lcxD0MXWgOZH5PImUOJlOfSp09B/NCl951KV 4xL+nn8qYAdWU2w+OFD3Vz47sO9bmBr5Wr6QiJvlO/uyH568GOeBverc+qdCngH83H mP+IPz9hQ/xAj2ZenH111IkwLXsykYSo69brJIYA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 01/91] scsi: lpfc: Fix discovery failures when target device connectivity bounces Date: Thu, 2 Jan 2020 23:06:43 +0100 Message-Id: <20200102220358.173292458@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220356.856162165@linuxfoundation.org> References: <20200102220356.856162165@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ Upstream commit 3f97aed6117c7677eb16756c4ec8b86000fd5822 ] An issue was seen discovering all SCSI Luns when a target device undergoes link bounce. The driver currently does not qualify the FC4 support on the target. Therefore it will send a SCSI PRLI and an NVMe PRLI. The expectation is that the target will reject the PRLI if it is not supported. If a PRLI times out, the driver will retry. The driver will not proceed with the device until both SCSI and NVMe PRLIs are resolved. In the failure case, the device is FCP only and does not respond to the NVMe PRLI, thus initiating the wait/retry loop in the driver. During that time, a RSCN is received (device bounced) causing the driver to issue a GID_FT. The GID_FT response comes back before the PRLI mess is resolved and it prematurely cancels the PRLI retry logic and leaves the device in a STE_PRLI_ISSUE state. Discovery with the target never completes or resets. Fix by resetting the node state back to STE_NPR_NODE when GID_FT completes, thereby restarting the discovery process for the node. Link: https://lore.kernel.org/r/20190922035906.10977-10-jsmart2021@gmail.com Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_hbadisc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 3f88f3d79622..4a0889dd4c1d 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -5220,9 +5220,14 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) /* If we've already received a PLOGI from this NPort * we don't need to try to discover it again. */ - if (ndlp->nlp_flag & NLP_RCV_PLOGI) + if (ndlp->nlp_flag & NLP_RCV_PLOGI && + !(ndlp->nlp_type & + (NLP_FCP_TARGET | NLP_NVME_TARGET))) return NULL; + ndlp->nlp_prev_state = ndlp->nlp_state; + lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); + spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NPR_2B_DISC; spin_unlock_irq(shost->host_lock); -- 2.20.1