#
6bf25d16 |
| 20-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: switch abort_limit to an atomic_t
There is no lock to sychronize access to the abort_limit field of struct nvme_ctrl, so switch it to an atomic_t.
Signed-off-by: Christoph Hellwig <hch@lst.de
nvme: switch abort_limit to an atomic_t
There is no lock to sychronize access to the abort_limit field of struct nvme_ctrl, so switch it to an atomic_t.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
5c8809e6 |
| 26-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: remove dead controllers from a work item
Compared to the kthread this gives us multiple call prevention for free.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kei
nvme: remove dead controllers from a work item
Compared to the kthread this gives us multiple call prevention for free.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
fd634f41 |
| 26-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: merge probe_work and reset_work
If we're using two work queues we're always going to run into races where one item is tearing down what the other one is initializing. So insted merge the two
nvme: merge probe_work and reset_work
If we're using two work queues we're always going to run into races where one item is tearing down what the other one is initializing. So insted merge the two work queues, and let the old probe_work also tear the controller down first if it was alive. Together with the better detection of the probe path using a flag this gives us a properly serialized reset/probe path that also doesn't accidentally trigger when two commands time out and the second one tries to reset the controller while the first reset is still in progress.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
e1569a16 |
| 26-Nov-2015 |
Keith Busch <keith.busch@intel.com> |
nvme: do not restart the request timeout if we're resetting the controller
Otherwise we're never going to complete a command when it is restarted just after we completed all other outstanding comman
nvme: do not restart the request timeout if we're resetting the controller
Otherwise we're never going to complete a command when it is restarted just after we completed all other outstanding commands in nvme_clear_queue.
The controller must be disabled prior to completing a presumed lost command, do this by directly shutting down the controller before queueing the reset work, and return EH_HANDLED from the timeout handler after we shut the controller down.
Signed-off-by: Keith Busch <keith.busch@intel.com> [hch: split and rebase] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
846cc05f |
| 26-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: simplify resets
Don't delete the controller from dev_list before queuing a reset, instead just check for it being reset in the polling kthread. This allows to remove the dev_list_lock in vari
nvme: simplify resets
Don't delete the controller from dev_list before queuing a reset, instead just check for it being reset in the polling kthread. This allows to remove the dev_list_lock in various places, and in addition we can simply rely on checking the queue_work return value to see if we could reset a controller.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
297465c8 |
| 26-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: add NVME_SC_CANCELLED
To properly document how we are using a negative Linux error value to communicate request cancellations inside the driver.
Signed-off-by: Christoph Hellwig <hch@lst.de>
nvme: add NVME_SC_CANCELLED
To properly document how we are using a negative Linux error value to communicate request cancellations inside the driver.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
31c7c7d2 |
| 22-Oct-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: merge nvme_abort_req and nvme_timeout
We want to be able to return bettern error values frmo nvme_timeout, which is significantly easier if the two functions are merged. Also clean up and red
nvme: merge nvme_abort_req and nvme_timeout
We want to be able to return bettern error values frmo nvme_timeout, which is significantly easier if the two functions are merged. Also clean up and reduce the printk spew so that we only get one message per abort.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
4c9f748f |
| 22-Oct-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: don't take the I/O queue q_lock in nvme_timeout
There is nothing it protects, but it makes lockdep unhappy in many different ways.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by:
nvme: don't take the I/O queue q_lock in nvme_timeout
There is nothing it protects, but it makes lockdep unhappy in many different ways.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
77bf25ea |
| 26-Nov-2015 |
Keith Busch <keith.busch@intel.com> |
nvme: protect against simultaneous shutdown invocations
Signed-off-by: Keith Busch <keith.busch@intel.com> [hch: split from a larger patch] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-b
nvme: protect against simultaneous shutdown invocations
Signed-off-by: Keith Busch <keith.busch@intel.com> [hch: split from a larger patch] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
7385014c |
| 22-Oct-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: only add a controller to dev_list after it's been fully initialized
Without this we can easily get bad derferences on nvmeq->d_db when the nvme kthread tries to poll the CQs for controllers th
nvme: only add a controller to dev_list after it's been fully initialized
Without this we can easily get bad derferences on nvmeq->d_db when the nvme kthread tries to poll the CQs for controllers that are in half initialized state.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
749941f2 |
| 26-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: only ignore hardware errors in nvme_create_io_queues
Half initialized queues due to kernel error returns or timeout are still a good reason to give up on initializing a controller.
Signed-off
nvme: only ignore hardware errors in nvme_create_io_queues
Half initialized queues due to kernel error returns or timeout are still a good reason to give up on initializing a controller.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
1f390c1f |
| 01-Dec-2015 |
Stephan Günther <guenther@tum.de> |
nvme: temporary fix for Apple controller reset
Recent patches added basic support for the Apple NVMe controller but still cause resets and data corruption on that particular controller when a specif
nvme: temporary fix for Apple controller reset
Recent patches added basic support for the Apple NVMe controller but still cause resets and data corruption on that particular controller when a specific pattern of read/flush commands occurs. Limiting the queue depth to 2 works around that issue.
This patch enforces that limit only for the Apple controller and is considered a temporary fix until we find the root source of that problem.
Signed-off-by: Stephan Günther <guenther@tum.de> Signed-off-by: Maurice Leclaire <leclaire@in.tum.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
9a0be7ab |
| 26-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: refactor set_queue_count
Split out a helper that just issues the Set Features and interprets the result which can go to common code, and document why we are ignoring non-timeout error returns
nvme: refactor set_queue_count
Split out a helper that just issues the Set Features and interprets the result which can go to common code, and document why we are ignoring non-timeout error returns in the PCIe driver.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
f3ca80fc |
| 28-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: move chardev and sysfs interface to common code
For this we need to add a proper controller init routine and a list of all controllers that is in addition to the list of PCIe controllers, whic
nvme: move chardev and sysfs interface to common code
For this we need to add a proper controller init routine and a list of all controllers that is in addition to the list of PCIe controllers, which stays in pci.c. Note that we remove the sysfs device when the last reference to a controller is dropped now - the old code would have kept it around longer, which doesn't make much sense.
This requires a new ->reset_ctrl operation to implement controleller resets, and a new ->write_reg32 operation that is required to implement subsystem resets. We also now store caches copied of the NVMe compliance version and the flag if a controller is attached to a subsystem or not in the generic controller structure now.
Signed-off-by: Christoph Hellwig <hch@lst.de> [Fixes for pr merge] Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
5bae7f73 |
| 28-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: move namespace scanning to common code
The namespace scanning code has been mostly generic already, we just need to store a pointer to the tagset in the nvme_ctrl structure, and add a method t
nvme: move namespace scanning to common code
The namespace scanning code has been mostly generic already, we just need to store a pointer to the tagset in the nvme_ctrl structure, and add a method to check if a controller is I/O incapable. The latter will hopefully be replaced by a proper controller state machine soon.
Signed-off-by: Christoph Hellwig <hch@lst.de> [Fixed pr conflicts] Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
ce4541f4 |
| 16-Oct-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: move the call to nvme_init_identify earlier
We want to record the identify and CAP values even if no I/O queue is available.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith
nvme: move the call to nvme_init_identify earlier
We want to record the identify and CAP values even if no I/O queue is available.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
7fd8930f |
| 28-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: add a common helper to read Identify Controller data
And add the 64-bit register read operation for it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@i
nvme: add a common helper to read Identify Controller data
And add the 64-bit register read operation for it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
5fd4ce1b |
| 28-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: move nvme_{enable,disable,shutdown}_ctrl to common code
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
|
#
1b2eb374 |
| 28-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: move remaining CC setup into nvme_enable_ctrl
Remove the calculation of all the bits written into the CC register into nvme_enable_ctrl, so that they can be moved into the core NVMe driver in
nvme: move remaining CC setup into nvme_enable_ctrl
Remove the calculation of all the bits written into the CC register into nvme_enable_ctrl, so that they can be moved into the core NVMe driver in the future.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
106198ed |
| 26-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: add explicit quirk handling
Add an enum for all workarounds not in the spec and identify the affected controllers at probe time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: K
nvme: add explicit quirk handling
Add an enum for all workarounds not in the spec and identify the affected controllers at probe time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
1673f1f0 |
| 26-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: move block_device_operations and ns/ctrl freeing to common code
This moves the block_device_operations over to common code mostly as-is. The only change is that the ns and ctrl refcounting go
nvme: move block_device_operations and ns/ctrl freeing to common code
This moves the block_device_operations over to common code mostly as-is. The only change is that the ns and ctrl refcounting got some small refcounting to have wrappers around the kref_put operations.
A new free_ctrl operation is added to allow the PCI driver to free it's ressources on the final drop.
Signed-off-by: Christoph Hellwig <hch@lst.de> [Moved the integrity and pr changes due to merge conflict] Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
0b7f1f26 |
| 23-Oct-2015 |
Keith Busch <keith.busch@intel.com> |
nvme: use the block layer for userspace passthrough metadata
Use the integrity API to pass through metadata from userspace. For PI enabled devices this means that we now validate the reftag, which
nvme: use the block layer for userspace passthrough metadata
Use the integrity API to pass through metadata from userspace. For PI enabled devices this means that we now validate the reftag, which seems like an unintentional ommission in the old code.
Thanks to Keith Busch for testing and fixes.
Signed-off-by: Christoph Hellwig <hch@lst.de> [Skip metadata setup on admin commands] Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
4160982e |
| 20-Nov-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: split __nvme_submit_sync_cmd
Add a separate nvme_submit_user_cmd for commands that directly DMA to or from userspace. We'll add metadata support to that soon and the common version would beco
nvme: split __nvme_submit_sync_cmd
Add a separate nvme_submit_user_cmd for commands that directly DMA to or from userspace. We'll add metadata support to that soon and the common version would become too messy.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
22944e99 |
| 16-Oct-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: move nvme_setup_flush and nvme_setup_rw to common code
And mark them inline so that we don't slow down the I/O submission path by having to turn it into a forced out of line call.
Signed-off-
nvme: move nvme_setup_flush and nvme_setup_rw to common code
And mark them inline so that we don't slow down the I/O submission path by having to turn it into a forced out of line call.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|
#
15a190f7 |
| 16-Oct-2015 |
Christoph Hellwig <hch@lst.de> |
nvme: move nvme_error_status to common code
And mark it inline so that we don't slow down the completion path by having to turn it into a forced out of line call.
Signed-off-by: Christoph Hellwig <
nvme: move nvme_error_status to common code
And mark it inline so that we don't slow down the completion path by having to turn it into a forced out of line call.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
show more ...
|