[SRU,T,1/2] NVMe: Make I/O timeout a module parameter

Message ID 20171121090349.23732-2-daniel.axtens@canonical.com
State New
Headers show
Series
  • [SRU,T,1/2] NVMe: Make I/O timeout a module parameter
Related show

Commit Message

Daniel Axtens Nov. 21, 2017, 9:03 a.m.
From: Keith Busch <keith.busch@intel.com>

BugLink: https://bugs.launchpad.net/bugs/1729119

Increase the default timeout to 30 seconds to match SCSI.

Signed-off-by: Keith Busch <keith.busch@intel.com>
[use byte instead of ushort]
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
(cherry picked from commit b355084a891985d4cd0ca23b1a83366af2c4232d)
Signed-off-by: Daniel Axtens <daniel.axtens@canonical.com>
---
 drivers/block/nvme-core.c | 4 ++++
 include/linux/nvme.h      | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 95a87b8f14bf..05357358c62f 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -55,6 +55,10 @@  static unsigned char shutdown_timeout = 5;
 module_param(shutdown_timeout, byte, 0644);
 MODULE_PARM_DESC(shutdown_timeout, "timeout in seconds for controller shutdown");
 
+unsigned char io_timeout = 30;
+module_param(io_timeout, byte, 0644);
+MODULE_PARM_DESC(io_timeout, "timeout in seconds for I/O");
+
 static int nvme_major;
 module_param(nvme_major, int, 0);
 
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index f0f95c719685..cdccd015bdc3 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -66,7 +66,8 @@  enum {
 
 #define NVME_VS(major, minor)	(major << 16 | minor)
 
-#define NVME_IO_TIMEOUT	(5 * HZ)
+extern unsigned char io_timeout;
+#define NVME_IO_TIMEOUT	(io_timeout * HZ)
 
 /*
  * Represents an NVM Express device.  Each nvme_dev is a PCI function.