Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323248
b: refs/heads/master
c: 8fc23e0
h: refs/heads/master
v: v3
  • Loading branch information
Keith Busch authored and Matthew Wilcox committed Jul 26, 2012
1 parent ba018fd commit 606dd2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a42ceccef0c43b46ff6bc1b12a7c1076ef243df1
refs/heads/master: 8fc23e032debd682f5ba9fc524a5846c10d2c522
7 changes: 7 additions & 0 deletions trunk/drivers/block/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct nvme_dev {
char serial[20];
char model[40];
char firmware_rev[8];
u32 max_hw_sectors;
};

/*
Expand Down Expand Up @@ -1344,6 +1345,8 @@ static struct nvme_ns *nvme_alloc_ns(struct nvme_dev *dev, int nsid,
lbaf = id->flbas & 0xf;
ns->lba_shift = id->lbaf[lbaf].ds;
blk_queue_logical_block_size(ns->queue, 1 << ns->lba_shift);
if (dev->max_hw_sectors)
blk_queue_max_hw_sectors(ns->queue, dev->max_hw_sectors);

disk->major = nvme_major;
disk->minors = NVME_MINORS;
Expand Down Expand Up @@ -1485,6 +1488,10 @@ static int __devinit nvme_dev_add(struct nvme_dev *dev)
memcpy(dev->serial, ctrl->sn, sizeof(ctrl->sn));
memcpy(dev->model, ctrl->mn, sizeof(ctrl->mn));
memcpy(dev->firmware_rev, ctrl->fr, sizeof(ctrl->fr));
if (ctrl->mdts) {
int shift = NVME_CAP_MPSMIN(readq(&dev->bar->cap)) + 12;
dev->max_hw_sectors = 1 << (ctrl->mdts + shift - 9);
}

id_ns = mem;
for (i = 1; i <= nn; i++) {
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct nvme_bar {

#define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff)
#define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf)
#define NVME_CAP_MPSMIN(cap) (((cap) >> 48) & 0xf)

enum {
NVME_CC_ENABLE = 1 << 0,
Expand Down

0 comments on commit 606dd2e

Please sign in to comment.