Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-19 14:12:50 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-19 14:12:50 +0100
commitaf79ae70d277ba984abef395aedcd0cc1486475d (patch)
treeee29b781656dae1eb7d98e547c7a9f40b9498456
parent880f651b2311e8d7fa4457926bff43e4fbe9948b (diff)
parentf4e8b61ab8b3e857cd7e4addd77d845e1068802c (diff)
Merge branch 'users/hare/SLE15/for-next' into SLE15
Pull nvme fixes from Hannes Reinecke
-rw-r--r--patches.fixes/nvme-lock-NS-list-changes-while-handling-command-eff.patch96
-rw-r--r--patches.kabi/nvme-kABI-fix-for-scan_lock.patch34
-rw-r--r--series.conf2
3 files changed, 132 insertions, 0 deletions
diff --git a/patches.fixes/nvme-lock-NS-list-changes-while-handling-command-eff.patch b/patches.fixes/nvme-lock-NS-list-changes-while-handling-command-eff.patch
new file mode 100644
index 0000000000..cef94e9e1a
--- /dev/null
+++ b/patches.fixes/nvme-lock-NS-list-changes-while-handling-command-eff.patch
@@ -0,0 +1,96 @@
+From: Keith Busch <keith.busch@intel.com>
+Date: Mon, 28 Jan 2019 09:46:07 -0700
+Subject: [PATCH] nvme: lock NS list changes while handling command effects
+Git-commit: e7ad43c3eda6a1690c4c3c341f95dc1c6898da83
+Patch-Mainline: v5.0-rc6
+References: bsc#1123882
+
+If a controller supports the NS Change Notification, the namespace
+scan_work is automatically triggered after attaching a new namespace.
+
+Occasionally the namespace scan_work may append the new namespace to the
+list before the admin command effects handling is completed. The effects
+handling unfreezes namespaces, but if it unfreezes the newly attached
+namespace, its request_queue freeze depth will be off and we'll hit the
+warning in blk_mq_unfreeze_queue().
+
+On the next namespace add, we will fail to freeze that queue due to the
+previous bad accounting and deadlock waiting for frozen.
+
+Fix that by preventing scan work from altering the namespace list while
+command effects handling needs to pair freeze with unfreeze.
+
+Reported-by: Wen Xiong <wenxiong@us.ibm.com>
+Tested-by: Wen Xiong <wenxiong@us.ibm.com>
+Signed-off-by: Keith Busch <keith.busch@intel.com>
+Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/nvme/host/core.c | 8 +++++++-
+ drivers/nvme/host/nvme.h | 1 +
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
+index 4d5e81c80cc6..e9bc23326cc1 100644
+--- a/drivers/nvme/host/core.c
++++ b/drivers/nvme/host/core.c
+@@ -1169,6 +1169,7 @@ static u32 nvme_passthru_start(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
+ * effects say only one namespace is affected.
+ */
+ if (effects & (NVME_CMD_EFFECTS_LBCC | NVME_CMD_EFFECTS_CSE_MASK)) {
++ mutex_lock(&ctrl->scan_lock);
+ nvme_start_freeze(ctrl);
+ nvme_wait_freeze(ctrl);
+ }
+@@ -1197,8 +1198,10 @@ static void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects)
+ */
+ if (effects & NVME_CMD_EFFECTS_LBCC)
+ nvme_update_formats(ctrl);
+- if (effects & (NVME_CMD_EFFECTS_LBCC | NVME_CMD_EFFECTS_CSE_MASK))
++ if (effects & (NVME_CMD_EFFECTS_LBCC | NVME_CMD_EFFECTS_CSE_MASK)) {
+ nvme_unfreeze(ctrl);
++ mutex_unlock(&ctrl->scan_lock);
++ }
+ if (effects & NVME_CMD_EFFECTS_CCC)
+ nvme_init_identify(ctrl);
+ if (effects & (NVME_CMD_EFFECTS_NIC | NVME_CMD_EFFECTS_NCC))
+@@ -3270,6 +3273,7 @@ static void nvme_scan_work(struct work_struct *work)
+ if (nvme_identify_ctrl(ctrl, &id))
+ return;
+
++ mutex_lock(&ctrl->scan_lock);
+ nn = le32_to_cpu(id->nn);
+ if (ctrl->vs >= NVME_VS(1, 1, 0) &&
+ !(ctrl->quirks & NVME_QUIRK_IDENTIFY_CNS)) {
+@@ -3278,6 +3282,7 @@ static void nvme_scan_work(struct work_struct *work)
+ }
+ nvme_scan_ns_sequential(ctrl, nn);
+ out_free_id:
++ mutex_unlock(&ctrl->scan_lock);
+ kfree(id);
+ mutex_lock(&ctrl->namespaces_mutex);
+ list_sort(NULL, &ctrl->namespaces, ns_cmp);
+@@ -3504,6 +3509,7 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
+
+ ctrl->state = NVME_CTRL_NEW;
+ spin_lock_init(&ctrl->lock);
++ mutex_init(&ctrl->scan_lock);
+ INIT_LIST_HEAD(&ctrl->namespaces);
+ mutex_init(&ctrl->namespaces_mutex);
+ ctrl->dev = dev;
+diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
+index ce5d75b11cc7..cf12f579ea2e 100644
+--- a/drivers/nvme/host/nvme.h
++++ b/drivers/nvme/host/nvme.h
+@@ -146,6 +146,7 @@ struct nvme_ctrl {
+ enum nvme_ctrl_state state;
+ bool identified;
+ spinlock_t lock;
++ struct mutex scan_lock;
+ const struct nvme_ctrl_ops *ops;
+ struct request_queue *admin_q;
+ struct request_queue *connect_q;
+--
+2.16.4
+
diff --git a/patches.kabi/nvme-kABI-fix-for-scan_lock.patch b/patches.kabi/nvme-kABI-fix-for-scan_lock.patch
new file mode 100644
index 0000000000..f2334adc83
--- /dev/null
+++ b/patches.kabi/nvme-kABI-fix-for-scan_lock.patch
@@ -0,0 +1,34 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Tue, 19 Feb 2019 13:43:50 +0100
+Subject: [PATCH] nvme: kABI fix for scan_lock
+Patch-Mainline: never, SLE15 specific kABI fix
+References: bsc#1123882
+
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/nvme/host/nvme.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
+index cf12f579ea2e..c30e2146324c 100644
+--- a/drivers/nvme/host/nvme.h
++++ b/drivers/nvme/host/nvme.h
+@@ -146,7 +146,6 @@ struct nvme_ctrl {
+ enum nvme_ctrl_state state;
+ bool identified;
+ spinlock_t lock;
+- struct mutex scan_lock;
+ const struct nvme_ctrl_ops *ops;
+ struct request_queue *admin_q;
+ struct request_queue *connect_q;
+@@ -236,6 +235,7 @@ struct nvme_ctrl {
+ struct timer_list anatt_timer;
+ struct work_struct ana_work;
+ #endif
++ struct mutex scan_lock;
+ #endif
+ };
+
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index a915677067..9501388702 100644
--- a/series.conf
+++ b/series.conf
@@ -20344,6 +20344,7 @@
patches.fixes/scsi-target-make-the-pi_prot_format-ConfigFS-path-re.patch
patches.fixes/ARM-iop32x-n2100-fix-PCI-IRQ-mapping.patch
patches.fixes/ARM-tango-Improve-ARCH_MULTIPLATFORM-compatibility.patch
+ patches.fixes/nvme-lock-NS-list-changes-while-handling-command-eff.patch
patches.fixes/irqchip-gic-v3-its-Fix-ITT_entry_size-accessor.patch
patches.arch/x86-mce-initialize-mce-bank-in-the-case-of-a-fatal-error-in-mce_no_way_out.patch
patches.drivers/dmaengine-at_xdmac-Fix-wrongfull-report-of-a-channel.patch
@@ -21036,6 +21037,7 @@
patches.kabi/nvme-kABI-fix-for-ANA-support-in-nvme_ctrl.patch
patches.kabi/nvme-guard-additional-fields-in-nvme-command-structu.patch
patches.kabi/nvmet-kABI-fixes-for-ANA-support.patch
+ patches.kabi/nvme-kABI-fix-for-scan_lock.patch
patches.kabi/kabi-fixup-bdev_dax_supported.patch
patches.kabi/rtlwifi-deferred-work-kabi-fix.patch
patches.kabi/of-device-kabi-fix.patch