diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-11 16:45:59 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-11 16:45:59 -0700 |
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 6b9aafed225..a50173ca1d7 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -66,20 +66,25 @@ enum { #define NVME_VS(major, minor) (major << 16 | minor) -#define NVME_IO_TIMEOUT (5 * HZ) +extern unsigned char io_timeout; +#define NVME_IO_TIMEOUT (io_timeout * HZ) /* * Represents an NVM Express device. Each nvme_dev is a PCI function. */ struct nvme_dev { struct list_head node; - struct nvme_queue **queues; + struct nvme_queue __rcu **queues; + unsigned short __percpu *io_queue; u32 __iomem *dbs; struct pci_dev *pci_dev; struct dma_pool *prp_page_pool; struct dma_pool *prp_small_pool; int instance; - int queue_count; + unsigned queue_count; + unsigned online_queues; + unsigned max_qid; + int q_depth; u32 db_stride; u32 ctrl_config; struct msix_entry *entry; @@ -89,6 +94,7 @@ struct nvme_dev { struct miscdevice miscdev; work_func_t reset_workfn; struct work_struct reset_work; + struct notifier_block nb; char name[12]; char serial[20]; char model[40]; @@ -131,6 +137,7 @@ struct nvme_iod { int length; /* Of data, in bytes */ unsigned long start_time; dma_addr_t first_dma; + struct list_head node; struct scatterlist sg[0]; }; @@ -146,16 +153,12 @@ static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector) */ void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod); -int nvme_setup_prps(struct nvme_dev *dev, struct nvme_common_command *cmd, - struct nvme_iod *iod, int total_len, gfp_t gfp); +int nvme_setup_prps(struct nvme_dev *, struct nvme_iod *, int , gfp_t); struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write, unsigned long addr, unsigned length); void nvme_unmap_user_pages(struct nvme_dev *dev, int write, struct nvme_iod *iod); -struct nvme_queue *get_nvmeq(struct nvme_dev *dev); -void put_nvmeq(struct nvme_queue *nvmeq); -int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd, - u32 *result, unsigned timeout); +int nvme_submit_io_cmd(struct nvme_dev *, struct nvme_command *, u32 *); int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns); int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *, u32 *result); diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h index e5ab6220111..096fe1c6f83 100644 --- a/include/uapi/linux/nvme.h +++ b/include/uapi/linux/nvme.h @@ -434,6 +434,7 @@ enum { NVME_SC_REFTAG_CHECK = 0x284, NVME_SC_COMPARE_FAILED = 0x285, NVME_SC_ACCESS_DENIED = 0x286, + NVME_SC_DNR = 0x4000, }; struct nvme_completion { |