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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 41AABC433E0 for ; Thu, 4 Jun 2020 11:56:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12DDD20738 for ; Thu, 4 Jun 2020 11:56:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MtryPEP3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12DDD20738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hnNR/25aFqqGSu+0nwsBNE1RoLeIn4Xl7itXa7m8j1o=; b=MtryPEP3/L2qf0hkjkSzE+JfWB KbWYM2RZVonrPlvKujdqCdPWupDUIO9vQakAqSvQx4f6fZQjjyqj7tAC6Up0hdvnJFTzwnH9gWabO FnbZ0WTHD3JHQZZItWScj6rN8DHXYPO5XUhRYxHYNM9V3F6ZyEInOgaePKnoo3gzrpoBNFx7ujJ38 SP0PU/cSsTu+f5ADbrmOCQfBaKPVvUBPf9UOOvgH2WOW3vKxeJoyXQkGRGTEXKCR5I8F0HcibjX6e XoZL5j3V0W9ABMsmfabObOcJ7BUi2EPq3J/PbpDsGGR7fD0UN6/t0M5IpVRZOVPsmYZL0wpnHi/B6 VWC3zG1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgoTr-00076d-4d; Thu, 04 Jun 2020 11:56:19 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgoTo-00073k-8z for linux-nvme@lists.infradead.org; Thu, 04 Jun 2020 11:56:17 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D7BB1AC52; Thu, 4 Jun 2020 11:56:13 +0000 (UTC) From: Hannes Reinecke To: Christoph Hellwig Subject: [PATCH 1/2] nvme: check for NVME_CTRL_LIVE in nvme_report_ns_ids() Date: Thu, 4 Jun 2020 13:56:01 +0200 Message-Id: <20200604115602.78446-2-hare@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200604115602.78446-1-hare@suse.de> References: <20200604115602.78446-1-hare@suse.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_045616_460886_0B3E9EA4 X-CRM114-Status: GOOD ( 14.34 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-nvme@lists.infradead.org, Daniel Wagner , Sagi Grimberg , Keith Busch , Hannes Reinecke MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org When a controller reset happens during scanning nvme_identify_ns() will be aborted, but the subsequent call to nvme_identify_ns_descs() will stall as it will only be completed once the controller reconnect is finished. But as the reconnect waits for scanning to complete the particular namespace will deadlock and never reconnected again. Reported-by: Martin George Signed-off-by: Hannes Reinecke --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 569671e264b5..b811787505f7 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1792,7 +1792,7 @@ static int nvme_report_ns_ids(struct nvme_ctrl *ctrl, unsigned int nsid, memcpy(ids->eui64, id->eui64, sizeof(id->eui64)); if (ctrl->vs >= NVME_VS(1, 2, 0)) memcpy(ids->nguid, id->nguid, sizeof(id->nguid)); - if (ctrl->vs >= NVME_VS(1, 3, 0)) + if (ctrl->vs >= NVME_VS(1, 3, 0) && ctrl->state == NVME_CTRL_LIVE) return nvme_identify_ns_descs(ctrl, nsid, ids); return 0; } -- 2.16.4 _______________________________________________ linux-nvme mailing list linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme