Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2018-07-12 08:35:26 +0200
committerHannes Reinecke <hare@suse.de>2018-07-12 08:35:26 +0200
commit2640b14832029a23360adf1f8397e83f39b6db87 (patch)
treebc47459bf62479c21904696a08dbe8fa23d7856d
parentc9565044466c3df2b9bd4400e83efc32af2031de (diff)
nvme: move init of keep_alive work item to controller
initialization (bsc#1098706).
-rw-r--r--patches.drivers/nvme-move-init-of-keep_alive-work-item-to-controller.patch55
-rw-r--r--series.conf3
2 files changed, 58 insertions, 0 deletions
diff --git a/patches.drivers/nvme-move-init-of-keep_alive-work-item-to-controller.patch b/patches.drivers/nvme-move-init-of-keep_alive-work-item-to-controller.patch
new file mode 100644
index 0000000000..b66d9a03b8
--- /dev/null
+++ b/patches.drivers/nvme-move-init-of-keep_alive-work-item-to-controller.patch
@@ -0,0 +1,55 @@
+From: James Smart <jsmart2021@gmail.com>
+Date: Tue, 12 Jun 2018 16:28:24 -0700
+Subject: [PATCH] nvme: move init of keep_alive work item to controller
+ initialization
+Git-commit: e13222bf0721f16cba390bc0163143564a680b47
+Git-repo: git://git.infradead.org/nvme.git
+Patch-Mainline: queued
+References: bsc#1098706
+
+
+Currently, the code initializes the keep alive work item whenever
+nvme_start_keep_alive() is called. However, this routine is called
+several times while reconnecting, etc. Although it's hoped that keep
+alive is always disabled and not scheduled when start is called,
+re-initing if it were scheduled or completing can have very bad
+side effects. There's no need for re-initialization.
+
+Move the keep_alive work item and cmd struct initialization to
+controller init.
+
+Signed-off-by: James Smart <james.smart@broadcom.com>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Acked-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/nvme/host/core.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
+index 46df030b2c3f..e541fe268bcf 100644
+--- a/drivers/nvme/host/core.c
++++ b/drivers/nvme/host/core.c
+@@ -848,9 +848,6 @@ static void nvme_start_keep_alive(struct nvme_ctrl *ctrl)
+ if (unlikely(ctrl->kato == 0))
+ return;
+
+- INIT_DELAYED_WORK(&ctrl->ka_work, nvme_keep_alive_work);
+- memset(&ctrl->ka_cmd, 0, sizeof(ctrl->ka_cmd));
+- ctrl->ka_cmd.common.opcode = nvme_admin_keep_alive;
+ schedule_delayed_work(&ctrl->ka_work, ctrl->kato * HZ);
+ }
+ EXPORT_SYMBOL_GPL(nvme_start_keep_alive);
+@@ -3484,6 +3481,10 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
+ INIT_WORK(&ctrl->fw_act_work, nvme_fw_act_work);
+ INIT_WORK(&ctrl->delete_work, nvme_delete_ctrl_work);
+
++ INIT_DELAYED_WORK(&ctrl->ka_work, nvme_keep_alive_work);
++ memset(&ctrl->ka_cmd, 0, sizeof(ctrl->ka_cmd));
++ ctrl->ka_cmd.common.opcode = nvme_admin_keep_alive;
++
+ ret = ida_simple_get(&nvme_instance_ida, 0, 0, GFP_KERNEL);
+ if (ret < 0)
+ goto out;
+--
+2.12.3
+
diff --git a/series.conf b/series.conf
index 2b86a5715c..d49eaa2f0e 100644
--- a/series.conf
+++ b/series.conf
@@ -13890,6 +13890,9 @@
patches.suse/0005-MODSIGN-Allow-the-db-UEFI-variable-to-be-suppressed.patch
patches.suse/0006-modsign-Use-secondary-trust-keyring-for-module-signi.patch
+ # git://git.infradead.org/nvme.git nvme-4.19
+ patches.drivers/nvme-move-init-of-keep_alive-work-item-to-controller.patch
+
# out-of-tree patches
patches.suse/0001-kvm-Introduce-nopvspin-kernel-parameter.patch