Skip to content

Commit

Permalink
NVMe: Correct the Controller Configuration settings
Browse files Browse the repository at this point in the history
The arbitration field was extended by one bit, shifting the shutdown
notification bits by one.  Also, the SQ/CQ entry size was made
configurable for future extensions.

Reported-by: Paul Luse <paul.e.luse@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
  • Loading branch information
Matthew Wilcox committed Nov 4, 2011
1 parent 8ef7006 commit 7f53f9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions drivers/block/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ static int __devinit nvme_configure_admin_queue(struct nvme_dev *dev)
dev->ctrl_config = NVME_CC_ENABLE | NVME_CC_CSS_NVM;
dev->ctrl_config |= (PAGE_SHIFT - 12) << NVME_CC_MPS_SHIFT;
dev->ctrl_config |= NVME_CC_ARB_RR | NVME_CC_SHN_NONE;
dev->ctrl_config |= NVME_CC_IOSQES | NVME_CC_IOCQES;

writel(0, &dev->bar->cc);
writel(aqa, &dev->bar->aqa);
Expand Down
10 changes: 6 additions & 4 deletions include/linux/nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ enum {
NVME_CC_MPS_SHIFT = 7,
NVME_CC_ARB_RR = 0 << 11,
NVME_CC_ARB_WRRU = 1 << 11,
NVME_CC_ARB_VS = 3 << 11,
NVME_CC_SHN_NONE = 0 << 13,
NVME_CC_SHN_NORMAL = 1 << 13,
NVME_CC_SHN_ABRUPT = 2 << 13,
NVME_CC_ARB_VS = 7 << 11,
NVME_CC_SHN_NONE = 0 << 14,
NVME_CC_SHN_NORMAL = 1 << 14,
NVME_CC_SHN_ABRUPT = 2 << 14,
NVME_CC_IOSQES = 6 << 16,
NVME_CC_IOCQES = 4 << 20,
NVME_CSTS_RDY = 1 << 0,
NVME_CSTS_CFS = 1 << 1,
NVME_CSTS_SHST_NORMAL = 0 << 2,
Expand Down

0 comments on commit 7f53f9d

Please sign in to comment.