summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2013-05-09 16:01:38 -0400
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-05-09 16:03:50 -0400
commit94f370cab6e5ac514b658c6b2b3aa308cefc5c7a (patch)
tree3e1a2ea879a0087b6c5238e2f61770e66b5854dc /drivers/block
parentab3ea5bf37e7189e843e19e500e7af50e802b5f6 (diff)
NVMe: Use user defined admin ioctl timeout
Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nvme-core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 310d573b9e8d..8efdfaa44a59 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1392,6 +1392,7 @@ static int nvme_user_admin_cmd(struct nvme_dev *dev,
1392 struct nvme_command c; 1392 struct nvme_command c;
1393 int status, length; 1393 int status, length;
1394 struct nvme_iod *uninitialized_var(iod); 1394 struct nvme_iod *uninitialized_var(iod);
1395 unsigned timeout;
1395 1396
1396 if (!capable(CAP_SYS_ADMIN)) 1397 if (!capable(CAP_SYS_ADMIN))
1397 return -EACCES; 1398 return -EACCES;
@@ -1421,10 +1422,13 @@ static int nvme_user_admin_cmd(struct nvme_dev *dev,
1421 GFP_KERNEL); 1422 GFP_KERNEL);
1422 } 1423 }
1423 1424
1425 timeout = cmd.timeout_ms ? msecs_to_jiffies(cmd.timeout_ms) :
1426 ADMIN_TIMEOUT;
1424 if (length != cmd.data_len) 1427 if (length != cmd.data_len)
1425 status = -ENOMEM; 1428 status = -ENOMEM;
1426 else 1429 else
1427 status = nvme_submit_admin_cmd(dev, &c, &cmd.result); 1430 status = nvme_submit_sync_cmd(dev->queues[0], &c, &cmd.result,
1431 timeout);
1428 1432
1429 if (cmd.data_len) { 1433 if (cmd.data_len) {
1430 nvme_unmap_user_pages(dev, cmd.opcode & 1, iod); 1434 nvme_unmap_user_pages(dev, cmd.opcode & 1, iod);