summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2015-09-11 16:59:04 +0000
committerjimharris <jimharris@FreeBSD.org>2015-09-11 16:59:04 +0000
commitf5725c2bdfce75c4020feb9d8ca1b702d6a158b6 (patch)
treeda809ba568436624c3cf79a6b6a648c38ac9da58
parent5be2a0f48edf04cc6f799c301c10871cb21a705b (diff)
downloadFreeBSD-src-f5725c2bdfce75c4020feb9d8ca1b702d6a158b6.zip
FreeBSD-src-f5725c2bdfce75c4020feb9d8ca1b702d6a158b6.tar.gz
MFC r286043:
nvme: do not notify a consumer about failures that occur during initialization Sponsored by: Intel
-rw-r--r--sys/dev/nvme/nvme.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/nvme/nvme.c b/sys/dev/nvme/nvme.c
index 329c5e5..cc14d34 100644
--- a/sys/dev/nvme/nvme.c
+++ b/sys/dev/nvme/nvme.c
@@ -390,6 +390,15 @@ nvme_notify_fail_consumers(struct nvme_controller *ctrlr)
struct nvme_consumer *cons;
uint32_t i;
+ /*
+ * This controller failed during initialization (i.e. IDENTIFY
+ * command failed or timed out). Do not notify any nvme
+ * consumers of the failure here, since the consumer does not
+ * even know about the controller yet.
+ */
+ if (!ctrlr->is_initialized)
+ return;
+
for (i = 0; i < NVME_MAX_CONSUMERS; i++) {
cons = &nvme_consumer[i];
if (cons->id != INVALID_CONSUMER_ID && cons->fail_fn != NULL)
OpenPOWER on IntegriCloud