diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-11 19:45:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-11 19:45:59 -0400 |
commit | 3e8072d48b2dd0898e99698018b2045f8cd49965 (patch) | |
tree | 5710e46918d4e358f22fb6038ad81d1abdd3f1f8 /include | |
parent | a63b747b41d6f6c9116fb2260381a3c96fe5dc02 (diff) | |
parent | edd10d33283899fb15d99a290dcc9ceb3604ca78 (diff) |
Merge git://git.infradead.org/users/willy/linux-nvme
Pull NVMe driver updates from Matthew Wilcox:
"Various updates to the NVMe driver. The most user-visible change is
that drive hotplugging now works and CPU hotplug while an NVMe drive
is installed should also work better"
* git://git.infradead.org/users/willy/linux-nvme:
NVMe: Retry failed commands with non-fatal errors
NVMe: Add getgeo to block ops
NVMe: Start-stop nvme_thread during device add-remove.
NVMe: Make I/O timeout a module parameter
NVMe: CPU hot plug notification
NVMe: per-cpu io queues
NVMe: Replace DEFINE_PCI_DEVICE_TABLE
NVMe: Fix divide-by-zero in nvme_trans_io_get_num_cmds
NVMe: IOCTL path RCU protect queue access
NVMe: RCU protected access to io queues
NVMe: Initialize device reference count earlier
NVMe: Add CONFIG_PM_SLEEP to suspend/resume functions
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nvme.h | 21 | ||||
-rw-r--r-- | include/uapi/linux/nvme.h | 1 |
2 files changed, 13 insertions, 9 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 6b9aafed225f..a50173ca1d72 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h | |||
@@ -66,20 +66,25 @@ enum { | |||
66 | 66 | ||
67 | #define NVME_VS(major, minor) (major << 16 | minor) | 67 | #define NVME_VS(major, minor) (major << 16 | minor) |
68 | 68 | ||
69 | #define NVME_IO_TIMEOUT (5 * HZ) | 69 | extern unsigned char io_timeout; |
70 | #define NVME_IO_TIMEOUT (io_timeout * HZ) | ||
70 | 71 | ||
71 | /* | 72 | /* |
72 | * Represents an NVM Express device. Each nvme_dev is a PCI function. | 73 | * Represents an NVM Express device. Each nvme_dev is a PCI function. |
73 | */ | 74 | */ |
74 | struct nvme_dev { | 75 | struct nvme_dev { |
75 | struct list_head node; | 76 | struct list_head node; |
76 | struct nvme_queue **queues; | 77 | struct nvme_queue __rcu **queues; |
78 | unsigned short __percpu *io_queue; | ||
77 | u32 __iomem *dbs; | 79 | u32 __iomem *dbs; |
78 | struct pci_dev *pci_dev; | 80 | struct pci_dev *pci_dev; |
79 | struct dma_pool *prp_page_pool; | 81 | struct dma_pool *prp_page_pool; |
80 | struct dma_pool *prp_small_pool; | 82 | struct dma_pool *prp_small_pool; |
81 | int instance; | 83 | int instance; |
82 | int queue_count; | 84 | unsigned queue_count; |
85 | unsigned online_queues; | ||
86 | unsigned max_qid; | ||
87 | int q_depth; | ||
83 | u32 db_stride; | 88 | u32 db_stride; |
84 | u32 ctrl_config; | 89 | u32 ctrl_config; |
85 | struct msix_entry *entry; | 90 | struct msix_entry *entry; |
@@ -89,6 +94,7 @@ struct nvme_dev { | |||
89 | struct miscdevice miscdev; | 94 | struct miscdevice miscdev; |
90 | work_func_t reset_workfn; | 95 | work_func_t reset_workfn; |
91 | struct work_struct reset_work; | 96 | struct work_struct reset_work; |
97 | struct notifier_block nb; | ||
92 | char name[12]; | 98 | char name[12]; |
93 | char serial[20]; | 99 | char serial[20]; |
94 | char model[40]; | 100 | char model[40]; |
@@ -131,6 +137,7 @@ struct nvme_iod { | |||
131 | int length; /* Of data, in bytes */ | 137 | int length; /* Of data, in bytes */ |
132 | unsigned long start_time; | 138 | unsigned long start_time; |
133 | dma_addr_t first_dma; | 139 | dma_addr_t first_dma; |
140 | struct list_head node; | ||
134 | struct scatterlist sg[0]; | 141 | struct scatterlist sg[0]; |
135 | }; | 142 | }; |
136 | 143 | ||
@@ -146,16 +153,12 @@ static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector) | |||
146 | */ | 153 | */ |
147 | void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod); | 154 | void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod); |
148 | 155 | ||
149 | int nvme_setup_prps(struct nvme_dev *dev, struct nvme_common_command *cmd, | 156 | int nvme_setup_prps(struct nvme_dev *, struct nvme_iod *, int , gfp_t); |
150 | struct nvme_iod *iod, int total_len, gfp_t gfp); | ||
151 | struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write, | 157 | struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write, |
152 | unsigned long addr, unsigned length); | 158 | unsigned long addr, unsigned length); |
153 | void nvme_unmap_user_pages(struct nvme_dev *dev, int write, | 159 | void nvme_unmap_user_pages(struct nvme_dev *dev, int write, |
154 | struct nvme_iod *iod); | 160 | struct nvme_iod *iod); |
155 | struct nvme_queue *get_nvmeq(struct nvme_dev *dev); | 161 | int nvme_submit_io_cmd(struct nvme_dev *, struct nvme_command *, u32 *); |
156 | void put_nvmeq(struct nvme_queue *nvmeq); | ||
157 | int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd, | ||
158 | u32 *result, unsigned timeout); | ||
159 | int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns); | 162 | int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns); |
160 | int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *, | 163 | int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *, |
161 | u32 *result); | 164 | u32 *result); |
diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h index e5ab62201119..096fe1c6f83d 100644 --- a/include/uapi/linux/nvme.h +++ b/include/uapi/linux/nvme.h | |||
@@ -434,6 +434,7 @@ enum { | |||
434 | NVME_SC_REFTAG_CHECK = 0x284, | 434 | NVME_SC_REFTAG_CHECK = 0x284, |
435 | NVME_SC_COMPARE_FAILED = 0x285, | 435 | NVME_SC_COMPARE_FAILED = 0x285, |
436 | NVME_SC_ACCESS_DENIED = 0x286, | 436 | NVME_SC_ACCESS_DENIED = 0x286, |
437 | NVME_SC_DNR = 0x4000, | ||
437 | }; | 438 | }; |
438 | 439 | ||
439 | struct nvme_completion { | 440 | struct nvme_completion { |