Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ struct nvme_dev {
unsigned max_qid;
unsigned io_queues[HCTX_MAX_TYPES];
unsigned int num_vecs;
u16 q_depth;
u32 q_depth;
int io_sqes;
u32 db_stride;
void __iomem *bar;
Expand Down Expand Up @@ -157,13 +157,13 @@ struct nvme_dev {
static int io_queue_depth_set(const char *val, const struct kernel_param *kp)
{
int ret;
u16 n;
u32 n;

ret = kstrtou16(val, 10, &n);
ret = kstrtou32(val, 10, &n);
if (ret != 0 || n < 2)
return -EINVAL;

return param_set_ushort(val, kp);
return param_set_uint(val, kp);
}

static inline unsigned int sq_idx(unsigned int qid, u32 stride)
Expand Down Expand Up @@ -195,7 +195,7 @@ struct nvme_queue {
dma_addr_t sq_dma_addr;
dma_addr_t cq_dma_addr;
u32 __iomem *q_db;
u16 q_depth;
u32 q_depth;
u16 cq_vector;
u16 sq_tail;
u16 cq_head;
Expand Down Expand Up @@ -2320,7 +2320,7 @@ static int nvme_pci_enable(struct nvme_dev *dev)

dev->ctrl.cap = lo_hi_readq(dev->bar + NVME_REG_CAP);

dev->q_depth = min_t(u16, NVME_CAP_MQES(dev->ctrl.cap) + 1,
dev->q_depth = min_t(u32, NVME_CAP_MQES(dev->ctrl.cap) + 1,
io_queue_depth);
dev->ctrl.sqsize = dev->q_depth - 1; /* 0's based queue depth */
dev->db_stride = 1 << NVME_CAP_STRIDE(dev->ctrl.cap);
Expand Down