diff options
author | Jens Axboe <axboe@fb.com> | 2016-12-22 13:54:46 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-12-22 13:54:46 -0500 |
commit | 8e5d31eb02c08d94262e1281adc8574134af65fd (patch) | |
tree | e4e0dce124a26a5618fa5a8e722f5744d02d72d2 | |
parent | 72c5296f9d64d8f5f27c2133e5f108a45a353d71 (diff) | |
parent | 7c3a23b85cac5f3caa531f369c1e3a5f1a8b555f (diff) |
Merge branch 'nvme-4.10' of git://git.infradead.org/nvme into for-linus
Christoph writes:
The most significant one is that we've agreed on shared maintaince and
a common repository for the PCIe NVMe driver and NVMe over Fabrics. The
target code still only has a subset of the maintainers but goes through
the same tree as well. Keith, Sagi and me will take turns at collecting
patches and sending you pull requests.
-rw-r--r-- | MAINTAINERS | 9 | ||||
-rw-r--r-- | drivers/nvme/host/core.c | 17 | ||||
-rw-r--r-- | drivers/nvme/host/fc.c | 19 | ||||
-rw-r--r-- | drivers/nvme/host/nvme.h | 1 | ||||
-rw-r--r-- | drivers/nvme/host/pci.c | 13 | ||||
-rw-r--r-- | drivers/nvme/host/scsi.c | 27 | ||||
-rw-r--r-- | drivers/nvme/target/admin-cmd.c | 4 | ||||
-rw-r--r-- | drivers/nvme/target/fcloop.c | 4 |
8 files changed, 25 insertions, 69 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index c7b8cf1240d9..afb85976b1eb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -8852,17 +8852,22 @@ F: drivers/video/fbdev/nvidia/ | |||
8852 | NVM EXPRESS DRIVER | 8852 | NVM EXPRESS DRIVER |
8853 | M: Keith Busch <keith.busch@intel.com> | 8853 | M: Keith Busch <keith.busch@intel.com> |
8854 | M: Jens Axboe <axboe@fb.com> | 8854 | M: Jens Axboe <axboe@fb.com> |
8855 | M: Christoph Hellwig <hch@lst.de> | ||
8856 | M: Sagi Grimberg <sagi@grimberg.me> | ||
8855 | L: linux-nvme@lists.infradead.org | 8857 | L: linux-nvme@lists.infradead.org |
8856 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git | 8858 | T: git://git.infradead.org/nvme.git |
8857 | W: https://kernel.googlesource.com/pub/scm/linux/kernel/git/axboe/linux-block/ | 8859 | W: http://git.infradead.org/nvme.git |
8858 | S: Supported | 8860 | S: Supported |
8859 | F: drivers/nvme/host/ | 8861 | F: drivers/nvme/host/ |
8860 | F: include/linux/nvme.h | 8862 | F: include/linux/nvme.h |
8863 | F: include/uapi/linux/nvme_ioctl.h | ||
8861 | 8864 | ||
8862 | NVM EXPRESS TARGET DRIVER | 8865 | NVM EXPRESS TARGET DRIVER |
8863 | M: Christoph Hellwig <hch@lst.de> | 8866 | M: Christoph Hellwig <hch@lst.de> |
8864 | M: Sagi Grimberg <sagi@grimberg.me> | 8867 | M: Sagi Grimberg <sagi@grimberg.me> |
8865 | L: linux-nvme@lists.infradead.org | 8868 | L: linux-nvme@lists.infradead.org |
8869 | T: git://git.infradead.org/nvme.git | ||
8870 | W: http://git.infradead.org/nvme.git | ||
8866 | S: Supported | 8871 | S: Supported |
8867 | F: drivers/nvme/target/ | 8872 | F: drivers/nvme/target/ |
8868 | 8873 | ||
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index b40cfb076f02..2fc86dc7a8df 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
@@ -1193,8 +1193,8 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, | |||
1193 | blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors); | 1193 | blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors); |
1194 | blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX)); | 1194 | blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX)); |
1195 | } | 1195 | } |
1196 | if (ctrl->stripe_size) | 1196 | if (ctrl->quirks & NVME_QUIRK_STRIPE_SIZE) |
1197 | blk_queue_chunk_sectors(q, ctrl->stripe_size >> 9); | 1197 | blk_queue_chunk_sectors(q, ctrl->max_hw_sectors); |
1198 | blk_queue_virt_boundary(q, ctrl->page_size - 1); | 1198 | blk_queue_virt_boundary(q, ctrl->page_size - 1); |
1199 | if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) | 1199 | if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) |
1200 | vwc = true; | 1200 | vwc = true; |
@@ -1250,19 +1250,6 @@ int nvme_init_identify(struct nvme_ctrl *ctrl) | |||
1250 | ctrl->max_hw_sectors = | 1250 | ctrl->max_hw_sectors = |
1251 | min_not_zero(ctrl->max_hw_sectors, max_hw_sectors); | 1251 | min_not_zero(ctrl->max_hw_sectors, max_hw_sectors); |
1252 | 1252 | ||
1253 | if ((ctrl->quirks & NVME_QUIRK_STRIPE_SIZE) && id->vs[3]) { | ||
1254 | unsigned int max_hw_sectors; | ||
1255 | |||
1256 | ctrl->stripe_size = 1 << (id->vs[3] + page_shift); | ||
1257 | max_hw_sectors = ctrl->stripe_size >> (page_shift - 9); | ||
1258 | if (ctrl->max_hw_sectors) { | ||
1259 | ctrl->max_hw_sectors = min(max_hw_sectors, | ||
1260 | ctrl->max_hw_sectors); | ||
1261 | } else { | ||
1262 | ctrl->max_hw_sectors = max_hw_sectors; | ||
1263 | } | ||
1264 | } | ||
1265 | |||
1266 | nvme_set_queue_limits(ctrl, ctrl->admin_q); | 1253 | nvme_set_queue_limits(ctrl, ctrl->admin_q); |
1267 | ctrl->sgls = le32_to_cpu(id->sgls); | 1254 | ctrl->sgls = le32_to_cpu(id->sgls); |
1268 | ctrl->kas = le16_to_cpu(id->kas); | 1255 | ctrl->kas = le16_to_cpu(id->kas); |
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 771e2e761872..aa0bc60810a7 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c | |||
@@ -1491,19 +1491,20 @@ static int | |||
1491 | nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) | 1491 | nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) |
1492 | { | 1492 | { |
1493 | struct nvme_fc_queue *queue = &ctrl->queues[1]; | 1493 | struct nvme_fc_queue *queue = &ctrl->queues[1]; |
1494 | int i, j, ret; | 1494 | int i, ret; |
1495 | 1495 | ||
1496 | for (i = 1; i < ctrl->queue_count; i++, queue++) { | 1496 | for (i = 1; i < ctrl->queue_count; i++, queue++) { |
1497 | ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize); | 1497 | ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize); |
1498 | if (ret) { | 1498 | if (ret) |
1499 | for (j = i-1; j >= 0; j--) | 1499 | goto delete_queues; |
1500 | __nvme_fc_delete_hw_queue(ctrl, | ||
1501 | &ctrl->queues[j], j); | ||
1502 | return ret; | ||
1503 | } | ||
1504 | } | 1500 | } |
1505 | 1501 | ||
1506 | return 0; | 1502 | return 0; |
1503 | |||
1504 | delete_queues: | ||
1505 | for (; i >= 0; i--) | ||
1506 | __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i); | ||
1507 | return ret; | ||
1507 | } | 1508 | } |
1508 | 1509 | ||
1509 | static int | 1510 | static int |
@@ -2401,8 +2402,8 @@ __nvme_fc_create_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, | |||
2401 | WARN_ON_ONCE(!changed); | 2402 | WARN_ON_ONCE(!changed); |
2402 | 2403 | ||
2403 | dev_info(ctrl->ctrl.device, | 2404 | dev_info(ctrl->ctrl.device, |
2404 | "NVME-FC{%d}: new ctrl: NQN \"%s\" (%p)\n", | 2405 | "NVME-FC{%d}: new ctrl: NQN \"%s\"\n", |
2405 | ctrl->cnum, ctrl->ctrl.opts->subsysnqn, &ctrl); | 2406 | ctrl->cnum, ctrl->ctrl.opts->subsysnqn); |
2406 | 2407 | ||
2407 | kref_get(&ctrl->ctrl.kref); | 2408 | kref_get(&ctrl->ctrl.kref); |
2408 | 2409 | ||
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index bd5321441d12..6377e14586dc 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h | |||
@@ -135,7 +135,6 @@ struct nvme_ctrl { | |||
135 | 135 | ||
136 | u32 page_size; | 136 | u32 page_size; |
137 | u32 max_hw_sectors; | 137 | u32 max_hw_sectors; |
138 | u32 stripe_size; | ||
139 | u16 oncs; | 138 | u16 oncs; |
140 | u16 vid; | 139 | u16 vid; |
141 | atomic_t abort_limit; | 140 | atomic_t abort_limit; |
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 3d21a154dce7..19beeb7b2ac2 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -712,15 +712,8 @@ static void __nvme_process_cq(struct nvme_queue *nvmeq, unsigned int *tag) | |||
712 | req = blk_mq_tag_to_rq(*nvmeq->tags, cqe.command_id); | 712 | req = blk_mq_tag_to_rq(*nvmeq->tags, cqe.command_id); |
713 | nvme_req(req)->result = cqe.result; | 713 | nvme_req(req)->result = cqe.result; |
714 | blk_mq_complete_request(req, le16_to_cpu(cqe.status) >> 1); | 714 | blk_mq_complete_request(req, le16_to_cpu(cqe.status) >> 1); |
715 | |||
716 | } | 715 | } |
717 | 716 | ||
718 | /* If the controller ignores the cq head doorbell and continuously | ||
719 | * writes to the queue, it is theoretically possible to wrap around | ||
720 | * the queue twice and mistakenly return IRQ_NONE. Linux only | ||
721 | * requires that 0.1% of your interrupts are handled, so this isn't | ||
722 | * a big problem. | ||
723 | */ | ||
724 | if (head == nvmeq->cq_head && phase == nvmeq->cq_phase) | 717 | if (head == nvmeq->cq_head && phase == nvmeq->cq_phase) |
725 | return; | 718 | return; |
726 | 719 | ||
@@ -1909,10 +1902,10 @@ static int nvme_dev_map(struct nvme_dev *dev) | |||
1909 | if (!dev->bar) | 1902 | if (!dev->bar) |
1910 | goto release; | 1903 | goto release; |
1911 | 1904 | ||
1912 | return 0; | 1905 | return 0; |
1913 | release: | 1906 | release: |
1914 | pci_release_mem_regions(pdev); | 1907 | pci_release_mem_regions(pdev); |
1915 | return -ENODEV; | 1908 | return -ENODEV; |
1916 | } | 1909 | } |
1917 | 1910 | ||
1918 | static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 1911 | static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
diff --git a/drivers/nvme/host/scsi.c b/drivers/nvme/host/scsi.c index b71e95044b43..a5c09e703bd8 100644 --- a/drivers/nvme/host/scsi.c +++ b/drivers/nvme/host/scsi.c | |||
@@ -2160,30 +2160,6 @@ static int nvme_trans_synchronize_cache(struct nvme_ns *ns, | |||
2160 | return nvme_trans_status_code(hdr, nvme_sc); | 2160 | return nvme_trans_status_code(hdr, nvme_sc); |
2161 | } | 2161 | } |
2162 | 2162 | ||
2163 | static int nvme_trans_start_stop(struct nvme_ns *ns, struct sg_io_hdr *hdr, | ||
2164 | u8 *cmd) | ||
2165 | { | ||
2166 | u8 immed, no_flush; | ||
2167 | |||
2168 | immed = cmd[1] & 0x01; | ||
2169 | no_flush = cmd[4] & 0x04; | ||
2170 | |||
2171 | if (immed != 0) { | ||
2172 | return nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, | ||
2173 | ILLEGAL_REQUEST, SCSI_ASC_INVALID_CDB, | ||
2174 | SCSI_ASCQ_CAUSE_NOT_REPORTABLE); | ||
2175 | } else { | ||
2176 | if (no_flush == 0) { | ||
2177 | /* Issue NVME FLUSH command prior to START STOP UNIT */ | ||
2178 | int res = nvme_trans_synchronize_cache(ns, hdr); | ||
2179 | if (res) | ||
2180 | return res; | ||
2181 | } | ||
2182 | |||
2183 | return 0; | ||
2184 | } | ||
2185 | } | ||
2186 | |||
2187 | static int nvme_trans_format_unit(struct nvme_ns *ns, struct sg_io_hdr *hdr, | 2163 | static int nvme_trans_format_unit(struct nvme_ns *ns, struct sg_io_hdr *hdr, |
2188 | u8 *cmd) | 2164 | u8 *cmd) |
2189 | { | 2165 | { |
@@ -2439,9 +2415,6 @@ static int nvme_scsi_translate(struct nvme_ns *ns, struct sg_io_hdr *hdr) | |||
2439 | case SECURITY_PROTOCOL_OUT: | 2415 | case SECURITY_PROTOCOL_OUT: |
2440 | retcode = nvme_trans_security_protocol(ns, hdr, cmd); | 2416 | retcode = nvme_trans_security_protocol(ns, hdr, cmd); |
2441 | break; | 2417 | break; |
2442 | case START_STOP: | ||
2443 | retcode = nvme_trans_start_stop(ns, hdr, cmd); | ||
2444 | break; | ||
2445 | case SYNCHRONIZE_CACHE: | 2418 | case SYNCHRONIZE_CACHE: |
2446 | retcode = nvme_trans_synchronize_cache(ns, hdr); | 2419 | retcode = nvme_trans_synchronize_cache(ns, hdr); |
2447 | break; | 2420 | break; |
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index ec1ad2aa0a4c..95ae52390478 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c | |||
@@ -382,7 +382,6 @@ static void nvmet_execute_set_features(struct nvmet_req *req) | |||
382 | { | 382 | { |
383 | struct nvmet_subsys *subsys = req->sq->ctrl->subsys; | 383 | struct nvmet_subsys *subsys = req->sq->ctrl->subsys; |
384 | u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10[0]); | 384 | u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10[0]); |
385 | u64 val; | ||
386 | u32 val32; | 385 | u32 val32; |
387 | u16 status = 0; | 386 | u16 status = 0; |
388 | 387 | ||
@@ -392,8 +391,7 @@ static void nvmet_execute_set_features(struct nvmet_req *req) | |||
392 | (subsys->max_qid - 1) | ((subsys->max_qid - 1) << 16)); | 391 | (subsys->max_qid - 1) | ((subsys->max_qid - 1) << 16)); |
393 | break; | 392 | break; |
394 | case NVME_FEAT_KATO: | 393 | case NVME_FEAT_KATO: |
395 | val = le64_to_cpu(req->cmd->prop_set.value); | 394 | val32 = le32_to_cpu(req->cmd->common.cdw10[1]); |
396 | val32 = val & 0xffff; | ||
397 | req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000); | 395 | req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000); |
398 | nvmet_set_result(req, req->sq->ctrl->kato); | 396 | nvmet_set_result(req, req->sq->ctrl->kato); |
399 | break; | 397 | break; |
diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c index bcb8ebeb01c5..4e8e6a22bce1 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c | |||
@@ -845,7 +845,7 @@ fcloop_create_remote_port(struct device *dev, struct device_attribute *attr, | |||
845 | rport->lport = nport->lport; | 845 | rport->lport = nport->lport; |
846 | nport->rport = rport; | 846 | nport->rport = rport; |
847 | 847 | ||
848 | return ret ? ret : count; | 848 | return count; |
849 | } | 849 | } |
850 | 850 | ||
851 | 851 | ||
@@ -952,7 +952,7 @@ fcloop_create_target_port(struct device *dev, struct device_attribute *attr, | |||
952 | tport->lport = nport->lport; | 952 | tport->lport = nport->lport; |
953 | nport->tport = tport; | 953 | nport->tport = tport; |
954 | 954 | ||
955 | return ret ? ret : count; | 955 | return count; |
956 | } | 956 | } |
957 | 957 | ||
958 | 958 | ||