diff options
author | Keith Busch | 2018-02-13 10:19:37 -0600 |
---|---|---|
committer | Greg Kroah-Hartman | 2018-02-16 13:09:47 -0600 |
commit | 5571210221d07217776390c762aa1325a236b93f (patch) | |
tree | b24dfb7a34a2409c134208b7c6b767cc08ab2646 | |
parent | 2b107726836177838d5be167323cb18513c8d083 (diff) | |
download | kernel-omap-5571210221d07217776390c762aa1325a236b93f.tar.gz kernel-omap-5571210221d07217776390c762aa1325a236b93f.tar.xz kernel-omap-5571210221d07217776390c762aa1325a236b93f.zip |
nvme: Fix managing degraded controllers
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 <keith.busch@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/nvme/host/pci.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index d6ceb8b91cd6..1c8aedf21370 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -2976,10 +2976,16 @@ static void nvme_dev_shutdown(struct nvme_dev *dev) | |||
2976 | mutex_unlock(&dev->shutdown_lock); | 2976 | mutex_unlock(&dev->shutdown_lock); |
2977 | } | 2977 | } |
2978 | 2978 | ||
2979 | static void nvme_dev_remove(struct nvme_dev *dev) | 2979 | static void nvme_remove_namespaces(struct nvme_dev *dev) |
2980 | { | 2980 | { |
2981 | struct nvme_ns *ns, *next; | 2981 | struct nvme_ns *ns, *next; |
2982 | 2982 | ||
2983 | list_for_each_entry_safe(ns, next, &dev->namespaces, list) | ||
2984 | nvme_ns_remove(ns); | ||
2985 | } | ||
2986 | |||
2987 | static void nvme_dev_remove(struct nvme_dev *dev) | ||
2988 | { | ||
2983 | if (nvme_io_incapable(dev)) { | 2989 | if (nvme_io_incapable(dev)) { |
2984 | /* | 2990 | /* |
2985 | * If the device is not capable of IO (surprise hot-removal, | 2991 | * If the device is not capable of IO (surprise hot-removal, |
@@ -2989,8 +2995,7 @@ static void nvme_dev_remove(struct nvme_dev *dev) | |||
2989 | */ | 2995 | */ |
2990 | nvme_dev_shutdown(dev); | 2996 | nvme_dev_shutdown(dev); |
2991 | } | 2997 | } |
2992 | list_for_each_entry_safe(ns, next, &dev->namespaces, list) | 2998 | nvme_remove_namespaces(dev); |
2993 | nvme_ns_remove(ns); | ||
2994 | } | 2999 | } |
2995 | 3000 | ||
2996 | static int nvme_setup_prp_pools(struct nvme_dev *dev) | 3001 | static int nvme_setup_prp_pools(struct nvme_dev *dev) |
@@ -3174,7 +3179,7 @@ static void nvme_probe_work(struct work_struct *work) | |||
3174 | */ | 3179 | */ |
3175 | if (dev->online_queues < 2) { | 3180 | if (dev->online_queues < 2) { |
3176 | dev_warn(dev->dev, "IO queues not created\n"); | 3181 | dev_warn(dev->dev, "IO queues not created\n"); |
3177 | nvme_dev_remove(dev); | 3182 | nvme_remove_namespaces(dev); |
3178 | } else { | 3183 | } else { |
3179 | nvme_unfreeze_queues(dev); | 3184 | nvme_unfreeze_queues(dev); |
3180 | nvme_dev_add(dev); | 3185 | nvme_dev_add(dev); |