summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2016-02-17 15:36:02 +0000
committerjimharris <jimharris@FreeBSD.org>2016-02-17 15:36:02 +0000
commitb9d4be0c4e918d40c0526998dc097fccb3d08426 (patch)
tree96ba492b3a9b43a649d80a16f4417f42e24c530a /sys/dev
parent4aef3019513be35be30d1ea8ff5b072a743f99df (diff)
downloadFreeBSD-src-b9d4be0c4e918d40c0526998dc097fccb3d08426.zip
FreeBSD-src-b9d4be0c4e918d40c0526998dc097fccb3d08426.tar.gz
MFC r295532:
nvme: avoid duplicate SET_NUM_QUEUES commands nvme(4) issues a SET_NUM_QUEUES command during device initialization to ensure enough I/O queues exists for each of the MSI-X vectors we have allocated. The SET_NUM_QUEUES command is then issued again during nvme_ctrlr_start(), to ensure that is properly set after any controller reset. At least one NVMe drive exists which fails this second SET_NUM_QUEUES command during device initialization. So change nvme_ctrlr_start() to only issue its SET_NUM_QUEUES command when it is coming out of a reset - avoiding the duplicate SET_NUM_QUEUES during device initialization. Approved by: re (glebius) Sponsored by: Intel
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/nvme/nvme_ctrlr.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
index 86f2a54..991c52f 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -725,15 +725,17 @@ nvme_ctrlr_start(void *ctrlr_arg)
* explicit specify how many queues it will use. This value should
* never change between resets, so panic if somehow that does happen.
*/
- old_num_io_queues = ctrlr->num_io_queues;
- if (nvme_ctrlr_set_num_qpairs(ctrlr) != 0) {
- nvme_ctrlr_fail(ctrlr);
- return;
- }
+ if (ctrlr->is_resetting) {
+ old_num_io_queues = ctrlr->num_io_queues;
+ if (nvme_ctrlr_set_num_qpairs(ctrlr) != 0) {
+ nvme_ctrlr_fail(ctrlr);
+ return;
+ }
- if (old_num_io_queues != ctrlr->num_io_queues) {
- panic("num_io_queues changed from %u to %u", old_num_io_queues,
- ctrlr->num_io_queues);
+ if (old_num_io_queues != ctrlr->num_io_queues) {
+ panic("num_io_queues changed from %u to %u",
+ old_num_io_queues, ctrlr->num_io_queues);
+ }
}
if (nvme_ctrlr_create_qpairs(ctrlr) != 0) {
OpenPOWER on IntegriCloud