diff options
-rw-r--r-- | drivers/nvme/host/core.c | 17 | ||||
-rw-r--r-- | drivers/nvme/host/nvme.h | 1 |
2 files changed, 2 insertions, 16 deletions
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/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; |