diff options
| -rw-r--r-- | drivers/nvme/host/core.c | 11 | ||||
| -rw-r--r-- | drivers/nvme/host/fc.c | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index f837d666cbd4..1e46e60b8f10 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
| @@ -1287,7 +1287,7 @@ static void nvme_config_discard(struct nvme_ctrl *ctrl, | |||
| 1287 | BUILD_BUG_ON(PAGE_SIZE / sizeof(struct nvme_dsm_range) < | 1287 | BUILD_BUG_ON(PAGE_SIZE / sizeof(struct nvme_dsm_range) < |
| 1288 | NVME_DSM_MAX_RANGES); | 1288 | NVME_DSM_MAX_RANGES); |
| 1289 | 1289 | ||
| 1290 | queue->limits.discard_alignment = size; | 1290 | queue->limits.discard_alignment = 0; |
| 1291 | queue->limits.discard_granularity = size; | 1291 | queue->limits.discard_granularity = size; |
| 1292 | 1292 | ||
| 1293 | blk_queue_max_discard_sectors(queue, UINT_MAX); | 1293 | blk_queue_max_discard_sectors(queue, UINT_MAX); |
| @@ -1705,7 +1705,8 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, | |||
| 1705 | blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors); | 1705 | blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors); |
| 1706 | blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX)); | 1706 | blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX)); |
| 1707 | } | 1707 | } |
| 1708 | if (ctrl->quirks & NVME_QUIRK_STRIPE_SIZE) | 1708 | if ((ctrl->quirks & NVME_QUIRK_STRIPE_SIZE) && |
| 1709 | is_power_of_2(ctrl->max_hw_sectors)) | ||
| 1709 | blk_queue_chunk_sectors(q, ctrl->max_hw_sectors); | 1710 | blk_queue_chunk_sectors(q, ctrl->max_hw_sectors); |
| 1710 | blk_queue_virt_boundary(q, ctrl->page_size - 1); | 1711 | blk_queue_virt_boundary(q, ctrl->page_size - 1); |
| 1711 | if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) | 1712 | if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) |
| @@ -2869,7 +2870,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
| 2869 | 2870 | ||
| 2870 | blk_queue_logical_block_size(ns->queue, 1 << ns->lba_shift); | 2871 | blk_queue_logical_block_size(ns->queue, 1 << ns->lba_shift); |
| 2871 | nvme_set_queue_limits(ctrl, ns->queue); | 2872 | nvme_set_queue_limits(ctrl, ns->queue); |
| 2872 | nvme_setup_streams_ns(ctrl, ns); | ||
| 2873 | 2873 | ||
| 2874 | id = nvme_identify_ns(ctrl, nsid); | 2874 | id = nvme_identify_ns(ctrl, nsid); |
| 2875 | if (!id) | 2875 | if (!id) |
| @@ -2880,6 +2880,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
| 2880 | 2880 | ||
| 2881 | if (nvme_init_ns_head(ns, nsid, id, &new)) | 2881 | if (nvme_init_ns_head(ns, nsid, id, &new)) |
| 2882 | goto out_free_id; | 2882 | goto out_free_id; |
| 2883 | nvme_setup_streams_ns(ctrl, ns); | ||
| 2883 | 2884 | ||
| 2884 | #ifdef CONFIG_NVME_MULTIPATH | 2885 | #ifdef CONFIG_NVME_MULTIPATH |
| 2885 | /* | 2886 | /* |
| @@ -2965,8 +2966,6 @@ static void nvme_ns_remove(struct nvme_ns *ns) | |||
| 2965 | return; | 2966 | return; |
| 2966 | 2967 | ||
| 2967 | if (ns->disk && ns->disk->flags & GENHD_FL_UP) { | 2968 | if (ns->disk && ns->disk->flags & GENHD_FL_UP) { |
| 2968 | if (blk_get_integrity(ns->disk)) | ||
| 2969 | blk_integrity_unregister(ns->disk); | ||
| 2970 | nvme_mpath_remove_disk_links(ns); | 2969 | nvme_mpath_remove_disk_links(ns); |
| 2971 | sysfs_remove_group(&disk_to_dev(ns->disk)->kobj, | 2970 | sysfs_remove_group(&disk_to_dev(ns->disk)->kobj, |
| 2972 | &nvme_ns_id_attr_group); | 2971 | &nvme_ns_id_attr_group); |
| @@ -2974,6 +2973,8 @@ static void nvme_ns_remove(struct nvme_ns *ns) | |||
| 2974 | nvme_nvm_unregister_sysfs(ns); | 2973 | nvme_nvm_unregister_sysfs(ns); |
| 2975 | del_gendisk(ns->disk); | 2974 | del_gendisk(ns->disk); |
| 2976 | blk_cleanup_queue(ns->queue); | 2975 | blk_cleanup_queue(ns->queue); |
| 2976 | if (blk_get_integrity(ns->disk)) | ||
| 2977 | blk_integrity_unregister(ns->disk); | ||
| 2977 | } | 2978 | } |
| 2978 | 2979 | ||
| 2979 | mutex_lock(&ns->ctrl->subsys->lock); | 2980 | mutex_lock(&ns->ctrl->subsys->lock); |
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 0a8af4daef89..794e66e4aa20 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c | |||
| @@ -3221,7 +3221,6 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, | |||
| 3221 | 3221 | ||
| 3222 | /* initiate nvme ctrl ref counting teardown */ | 3222 | /* initiate nvme ctrl ref counting teardown */ |
| 3223 | nvme_uninit_ctrl(&ctrl->ctrl); | 3223 | nvme_uninit_ctrl(&ctrl->ctrl); |
| 3224 | nvme_put_ctrl(&ctrl->ctrl); | ||
| 3225 | 3224 | ||
| 3226 | /* Remove core ctrl ref. */ | 3225 | /* Remove core ctrl ref. */ |
| 3227 | nvme_put_ctrl(&ctrl->ctrl); | 3226 | nvme_put_ctrl(&ctrl->ctrl); |
