aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
AgeCommit message (Collapse)AuthorFilesLines
2011-11-04NVMe: Check for DMA mapping failureMatthew Wilcox1-1/+7
If dma_map_sg returns 0 (failure), we need to fail the I/O. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Pass the nvme_dev to nvme_free_prps and nvme_setup_prpsMatthew Wilcox1-13/+11
We were passing the nvme_queue to access the q_dmadev for the dma_alloc_coherent calls, but since we moved to the dma pool API, we really only need the nvme_dev. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Optimise memory usage for I/Os between 4k and 128kMatthew Wilcox1-8/+23
Add a second memory pool for smaller I/Os. We can pack 16 of these on a single page instead of using an entire page for each one. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Switch to use DMA Pool APIMatthew Wilcox1-7/+32
Calling dma_free_coherent from interrupt context causes warnings. Using the DMA pools delays freeing until pool destruction, so avoids the problem. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Rename nvme_req_info to nvme_bioMatthew Wilcox1-24/+24
There are too many things called 'info' in this driver. This data structure is auxiliary information for a struct bio, so call it nvme_bio, or nbio when used as a variable. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Initial PRP List supportShane Michael Matthews1-13/+91
Add a pointer to the nvme_req_info to hold a new data structure (nvme_prps) which contains a list of the pages allocated to this particular request for holding PRP list entries. nvme_setup_prps() now returns this pointer. To allocate and free the memory used for PRP lists, we need a struct device, so we need to pass the nvme_queue pointer to many functions which didn't use to need it. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Advance the sg pointer when filling in an sg listMatthew Wilcox1-0/+1
For multipage BIOs, we were always using sg[0] instead of advancing through the list. Oops :-) Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Renumber the special context valuesMatthew Wilcox1-3/+3
If POISON_POINTER_DELTA isn't defined, ensure they're in page 0 which should never be mapped. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Handle the congestion list a little betterMatthew Wilcox1-0/+17
In the bio completion handler, check for bios on the congestion list for this NVM queue. Also, lock the congestion list in the make_request function as the queue may end up being shared between multiple CPUs. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Record the timeout for each commandMatthew Wilcox1-17/+32
In addition to recording the completion data for each command, record the anticipated completion time. Choose a timeout of 5 seconds for normal I/Os and 60 seconds for admin I/Os. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Need to lock queue during interrupt handlingMatthew Wilcox1-6/+1
If we're sharing a queue between multiple CPUs and we cancel a sync I/O, we must have the queue locked to avoid corrupting the stack of the thread that submitted the I/O. It turns out this is the same locking that's needed for the threaded irq handler, so share that code. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Detect command IDs completing that are out of rangeMatthew Wilcox1-0/+9
If the adapter completes a command ID that is outside the bounds of the array, return CMD_CTX_INVALID instead of random data, and print a message in the sync_completion handler (which is rapidly becoming the misc completion handler :-) Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Detect commands that are completed twiceMatthew Wilcox1-3/+12
Set the context value to CMD_CTX_COMPLETED, and print a message in the sync_completion handler if we see it. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Use a symbolic name to represent cancelled commands instead of 0Matthew Wilcox1-8/+12
I have plans for other special values in sync_completion. Plus, this is more self-documenting, and lets us detect bogus usages. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Add a module parameter to use a threaded interruptMatthew Wilcox1-0/+27
We're currently calling bio_endio from hard interrupt context. This is not a good idea for preemptible kernels as it will cause longer latencies. Using a threaded interrupt will run the entire queue processing mechanism (including bio_endio) in a thread, which can be preempted. Unfortuantely, it also adds about 7us of latency to the single-I/O case, so make it a module parameter for the moment. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Call put_nvmeq() before calling nvme_submit_sync_cmd()Matthew Wilcox1-1/+6
We can't have preemption disabled when we call schedule(). Accept the possibility that we'll get preempted, and it'll cost us some cacheline bounces. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Allow fatal signals to interrupt I/OMatthew Wilcox1-6/+27
If the user sends a fatal signal, sleeping in the TASK_KILLABLE state permits the task to be aborted. The only wrinkle is making sure that if/when the command completes later that it doesn't upset anything. Handle this by setting the data pointer to 0, and checking the value isn't NULL in the sync completion path. Eventually, bios can be cancelled through this path too. Note that the cmdid isn't freed to prevent reuse. We should also abort the command in the future, but this is a good start. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Release 0.2Matthew Wilcox1-1/+1
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Add download / activate firmware ioctlsMatthew Wilcox1-0/+45
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Move sysfs entries to the right placeMatthew Wilcox1-0/+1
Because I wasn't setting driverfs_dev, the devices were showing up under /sys/devices/virtual/block. Now they appear underneath the PCI device which they belong to. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Disable the device before we write the admin queuesShane Michael Matthews1-0/+1
In case the card has been left in a partially-configured state, write 0 to the Enable bit. Signed-off-by: Shane Michael Matthews <shane.matthews@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Request I/O regionsMatthew Wilcox1-3/+9
Calling pci_request_selected_regions() reserves these regions for our use. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Allow queues to be allocated above 4GBMatthew Wilcox1-1/+2
Need to call dma_set_coherent_mask() to allow queues to be allocated above 4GB. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Enable device DMAMatthew Wilcox1-0/+1
Need to call pci_set_master() to enable device DMA Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Enable and disable the PCI deviceShane Michael Matthews1-0/+5
Call pci_enable_device_mem() at initialisation and pci_disable_device at exit. Signed-off-by: Shane Michael Matthews <shane.matthews@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Check returns from nvme_alloc_queue()Matthew Wilcox1-0/+5
It can return NULL, so handle that. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Remove 'node' from nvme_devMatthew Wilcox1-1/+0
We don't keep a list of nvme_dev any more Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Read the model, serial & firmware rev from the controllerMatthew Wilcox1-1/+9
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Add NVME_IOCTL_SUBMIT_IOMatthew Wilcox1-0/+43
Allow userspace to submit synchronous I/O like the SCSI sg interface does. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Create nvme_map_user_pages() and nvme_unmap_user_pages()Matthew Wilcox1-15/+53
These are generalisations of the code that was in nvme_submit_user_admin_command(). Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Change NVME_IOCTL_GET_RANGE_TYPE to return all the rangesMatthew Wilcox1-30/+19
Factor out most of nvme_identify() into a new nvme_submit_user_admin_command() function. Change nvme_get_range_type() to call it and change nvme_ioctl to realise that it's getting back all 64 ranges. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Zero the command before we send itMatthew Wilcox1-0/+1
Make sure there's no left-over bits set from previous commands that used this slot. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Add nvme_setup_prps()Matthew Wilcox1-24/+46
Generalise the code from nvme_identify() that sets PRP1 & PRP2 so that it's usable for commands sent by nvme_submit_bio_queue(). Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Use PRP2 for the nvme_identify ioctlMatthew Wilcox1-16/+40
DMA the result straight to userspace instead of bounce-buffering in the kernel. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Fix admin IRQ claim on real hardwareMatthew Wilcox1-0/+1
The admin IRQ is supposed to use the pin-based (or single message MSI) interrupt. Accomplish this by filling in entry[0]'s vector with the INTx irq number. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Rename 'cycle' to 'phase'Matthew Wilcox1-8/+8
It's called the phase bit in the current draft Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Implement per-CPU queuesMatthew Wilcox1-11/+50
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Reduce set_queue_count arguments by oneMatthew Wilcox1-3/+3
sq_count and cq_count are always the same, so just call it 'count'. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: Factor out queue_request_irq()Matthew Wilcox1-4/+9
Two callers with an almost identical long string of arguments, and introducing a third soon. Time to factor out the commonalities. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-04NVMe: New driverMatthew Wilcox3-0/+1055
This driver is for devices that follow the NVM Express standard Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
2011-11-02virtio-blk: use ida to allocate disk indexMichael S. Tsirkin1-6/+24
Based on a patch by Mark Wu <dwu@redhat.com> Current index allocation in virtio-blk is based on a monotonically increasing variable "index". This means we'll run out of numbers after a while. It also could cause confusion about the disk name in the case of hot-plugging disks. Change virtio-blk to use ida to allocate index, instead. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-10-31block: Fix files that are modules and hence need module.hPaul Gortmaker3-0/+3
We want to remove the implicit everywhere presence of module.h so fix up the people relying on that implicit presence in advance. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31block: add export.h to files using EXPORT_SYMBOL/THIS_MODULE macrosPaul Gortmaker2-0/+2
These files were getting <linux/module.h> via an implicit include path, but we want to crush those out of existence since they cost time during compiles of processing thousands of lines of headers for no reason. Give them the lightweight header that just contains the EXPORT_SYMBOL infrastructure. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31virtio-blk: use ida to allocate disk indexMichael S. Tsirkin1-6/+24
Based on a patch by Mark Wu <dwu@redhat.com> Current index allocation in virtio-blk is based on a monotonically increasing variable "index". This means we'll run out of numbers after a while. It also could cause confusion about the disk name in the case of hot-plugging disks. Change virtio-blk to use ida to allocate index, instead. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2011-10-28Merge branch 'for-linus' of git://ceph.newdream.net/git/ceph-clientLinus Torvalds1-1/+1
* 'for-linus' of git://ceph.newdream.net/git/ceph-client: libceph: fix double-free of page vector ceph: fix 32-bit ino numbers libceph: force resend of osd requests if we skip an osdmap ceph: use kernel DNS resolver ceph: fix ceph_monc_init memory leak ceph: let the set_layout ioctl set single traits Revert "ceph: don't truncate dirty pages in invalidate work thread" ceph: replace leading spaces with tabs libceph: warn on msg allocation failures libceph: don't complain on msgpool alloc failures libceph: always preallocate mon connection libceph: create messenger with client ceph: document ioctls ceph: implement (optional) max read size ceph: rename rsize -> rasize ceph: make readpages fully async
2011-10-26block: xen-blkback: use API provided by xenbus module to map ringsDavid Vrabel2-51/+8
The xenbus module provides xenbus_map_ring_valloc() and xenbus_map_ring_vfree(). Use these to map the ring pages granted by the frontend. Acked-by: Jens Axboe <jaxboe@fusionio.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-10-25libceph: create messenger with clientSage Weil1-1/+1
This simplifies the init/shutdown paths, and makes client->msgr available during the rest of the setup process. Signed-off-by: Sage Weil <sage@newdream.net>
2011-10-25Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds5-9/+6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (59 commits) MAINTAINERS: linux-m32r is moderated for non-subscribers linux@lists.openrisc.net is moderated for non-subscribers Drop default from "DM365 codec select" choice parisc: Kconfig: cleanup Kernel page size default Kconfig: remove redundant CONFIG_ prefix on two symbols cris: remove arch/cris/arch-v32/lib/nand_init.S microblaze: add missing CONFIG_ prefixes h8300: drop puzzling Kconfig dependencies MAINTAINERS: microblaze-uclinux@itee.uq.edu.au is moderated for non-subscribers tty: drop superfluous dependency in Kconfig ARM: mxc: fix Kconfig typo 'i.MX51' Fix file references in Kconfig files aic7xxx: fix Kconfig references to READMEs Fix file references in drivers/ide/ thinkpad_acpi: Fix printk typo 'bluestooth' bcmring: drop commented out line in Kconfig btmrvl_sdio: fix typo 'btmrvl_sdio_sd6888' doc: raw1394: Trivial typo fix CIFS: Don't free volume_info->UNC until we are entirely done with it. treewide: Correct spelling of successfully in comments ...
2011-10-25Merge branches 'stable/bug.fixes-3.2' and 'stable/mmu.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xenLinus Torvalds1-1/+1
* 'stable/bug.fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen/p2m/debugfs: Make type_name more obvious. xen/p2m/debugfs: Fix potential pointer exception. xen/enlighten: Fix compile warnings and set cx to known value. xen/xenbus: Remove the unnecessary check. xen/irq: If we fail during msi_capability_init return proper error code. xen/events: Don't check the info for NULL as it is already done. xen/events: BUG() when we can't allocate our event->irq array. * 'stable/mmu.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen: Fix selfballooning and ensure it doesn't go too far xen/gntdev: Fix sleep-inside-spinlock xen: modify kernel mappings corresponding to granted pages xen: add an "highmem" parameter to alloc_xenballooned_pages xen/p2m: Use SetPagePrivate and its friends for M2P overrides. xen/p2m: Make debug/xen/mmu/p2m visible again. Revert "xen/debug: WARN_ON when identity PFN has no _PAGE_IOMAP flag set."
2011-10-24Merge branch 'for-linus' into for-3.2/coreJens Axboe1-112/+23