Received: by 10.223.185.116 with SMTP id b49csp2519638wrg; Thu, 15 Feb 2018 12:56:17 -0800 (PST) X-Google-Smtp-Source: AH8x225pncSbB7POcrKBlxaxaE7dcihCnq4vE7T2uw8JHLQLOjzwuukBQotim3OuwW0oIo4XTOYD X-Received: by 10.98.211.1 with SMTP id q1mr2754737pfg.199.1518728177209; Thu, 15 Feb 2018 12:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518728177; cv=none; d=google.com; s=arc-20160816; b=t2fWiEKt5HjvdDCKlXAq3rpvqv3jhUS3MrqAlMRpVRMI7TmrdxrpLHj9t4JJIOeE6h iVSiUQv7lBh0tTSvRzWaPsZZcM3S+zs6eYaHKO11+iZX8WymXTKBD+z21SPWjizZOeIc QlB0E55buzcSde8jREEqaXUZzw8rUFO0Yk/pJT+HQFfbuIbxgjaSL3R5/fQybmKtr2MB /AA+JiY6oMjnbQwLrl9fT8ieHQwoGr2XgMWYUDXL/52bTJ2ClXaZrR8EFD4HqcRZFogU 0Ri0bw6rzDNA4rM4bPddOKSeK0CfCYKCSv4yKI+QaGYkM0NMxiL6okaPWI1W7maHHW4O SBow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=S8zTDCY+MwesjenmKex3UdJbg9k+9LLuUvMMI2PVxZE=; b=UqAyOok7lgoHgbnoSVVLm3F8bhBTsW/aiKIXGfg30OoIxXUz4409eilI9Wsuzfg5Sm DJXxcljzQIDnYm50yK0PJZwcCPmI3/78WdpcazS3c08kqwK7+EFRrTNYayFbbSfSSh/N 9aIfLpjg3WrxjNIwyURJ4l8h2vgDgl2EchBZZiVkG98MXgi/tdtYbgeOfJxl9zt12zwW F4dZ9arP25IYHVIcQIMu7rBDor7sV/8PgNDuziQQ7ApoduIBkSjidMWwUqM55epGzcnk iUdFNR8/23LdornOBsihBQGTKOUgwrlnnxCvOZ6hxrQJwX1tOJljlhaiwnrR+adLA5zl AcRw== ARC-Authentication-Results: i=1; mx.google.com; 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 v6si1528998pgv.764.2018.02.15.12.56.01; Thu, 15 Feb 2018 12:56:17 -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; 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 S1163107AbeBOPZI (ORCPT + 99 others); Thu, 15 Feb 2018 10:25:08 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52088 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162134AbeBOPZE (ORCPT ); Thu, 15 Feb 2018 10:25:04 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BCDFA10D1; Thu, 15 Feb 2018 15:25:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keith Busch Subject: [PATCH 4.4 104/108] nvme: Fix managing degraded controllers Date: Thu, 15 Feb 2018 16:17:41 +0100 Message-Id: <20180215151236.792034374@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Keith Busch commit 5bae7f73d378a986 upstream Upstream is a near rewrite of the async nvme probe that ultimately didn't even cleanly merge in 4.5. This patch is a much smaller change targeted to the regression introduced in 4.4. If a controller is in a degraded mode that needs admin assistence to recover, we need to leave the controller running. We just want to disable namespace access without shuting the controller down. Fixes: 3cf519b5a8d4("nvme: merge nvme_dev_start, nvme_dev_resume and nvme_async_probe") Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/pci.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2976,10 +2976,16 @@ static void nvme_dev_shutdown(struct nvm mutex_unlock(&dev->shutdown_lock); } -static void nvme_dev_remove(struct nvme_dev *dev) +static void nvme_remove_namespaces(struct nvme_dev *dev) { struct nvme_ns *ns, *next; + list_for_each_entry_safe(ns, next, &dev->namespaces, list) + nvme_ns_remove(ns); +} + +static void nvme_dev_remove(struct nvme_dev *dev) +{ if (nvme_io_incapable(dev)) { /* * If the device is not capable of IO (surprise hot-removal, @@ -2989,8 +2995,7 @@ static void nvme_dev_remove(struct nvme_ */ nvme_dev_shutdown(dev); } - list_for_each_entry_safe(ns, next, &dev->namespaces, list) - nvme_ns_remove(ns); + nvme_remove_namespaces(dev); } static int nvme_setup_prp_pools(struct nvme_dev *dev) @@ -3174,7 +3179,7 @@ static void nvme_probe_work(struct work_ */ if (dev->online_queues < 2) { dev_warn(dev->dev, "IO queues not created\n"); - nvme_dev_remove(dev); + nvme_remove_namespaces(dev); } else { nvme_unfreeze_queues(dev); nvme_dev_add(dev);