Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286323
b: refs/heads/master
c: df34813
h: refs/heads/master
i:
  286321: bf6a75b
  286319: 23123be
v: v3
  • Loading branch information
Matthew Wilcox committed Jan 11, 2012
1 parent 99136a4 commit ec0d750
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 366e8217e5ec6ce9f73aec19c46d983110fb4a98
refs/heads/master: df3481399042200792822b6243e36a95a557b57e
20 changes: 17 additions & 3 deletions trunk/drivers/block/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ static int nvme_identify(struct nvme_dev *dev, unsigned nsid, unsigned cns,
}

static int nvme_get_features(struct nvme_dev *dev, unsigned fid,
unsigned dword11, dma_addr_t dma_addr, u32 *result)
unsigned dword11, dma_addr_t dma_addr)
{
struct nvme_command c;

Expand All @@ -850,6 +850,20 @@ static int nvme_get_features(struct nvme_dev *dev, unsigned fid,
c.features.fid = cpu_to_le32(fid);
c.features.dword11 = cpu_to_le32(dword11);

return nvme_submit_admin_cmd(dev, &c, NULL);
}

static int nvme_set_features(struct nvme_dev *dev, unsigned fid,
unsigned dword11, dma_addr_t dma_addr, u32 *result)
{
struct nvme_command c;

memset(&c, 0, sizeof(c));
c.features.opcode = nvme_admin_set_features;
c.features.prp1 = cpu_to_le64(dma_addr);
c.features.fid = cpu_to_le32(fid);
c.features.dword11 = cpu_to_le32(dword11);

return nvme_submit_admin_cmd(dev, &c, result);
}

Expand Down Expand Up @@ -1365,7 +1379,7 @@ static int set_queue_count(struct nvme_dev *dev, int count)
u32 result;
u32 q_count = (count - 1) | ((count - 1) << 16);

status = nvme_get_features(dev, NVME_FEAT_NUM_QUEUES, q_count, 0,
status = nvme_set_features(dev, NVME_FEAT_NUM_QUEUES, q_count, 0,
&result);
if (status)
return -EIO;
Expand Down Expand Up @@ -1482,7 +1496,7 @@ static int __devinit nvme_dev_add(struct nvme_dev *dev)
continue;

res = nvme_get_features(dev, NVME_FEAT_LBA_RANGE, i,
dma_addr + 4096, NULL);
dma_addr + 4096);
if (res)
continue;

Expand Down

0 comments on commit ec0d750

Please sign in to comment.