Index: sys/dev/nvme/nvme_qpair.c =================================================================== --- sys/dev/nvme/nvme_qpair.c +++ sys/dev/nvme/nvme_qpair.c @@ -615,6 +615,23 @@ qpair->sq_head = cpl.sqhd; done++; } else if (!in_panic) { + /* + * Sanity check: make sure we've submitted a command. + * At least one NVMe device will generate a surious + * completion interrupt on startup. This lets us ignore + * these silently. We only check here when we would + * otherwise report on a missing completion. Since the + * controller also reads '0' when this happens, the + * phase check above is a false positive. + */ + if (qpair->num_cmds == 0) { + if (bootverbose) + nvme_printf(qpair->ctrlr, + "Warning: Completion interrupt before commands submitted queue %d\n", + qpair->id); + return (false); + } + /* * A missing tracker is normally an error. However, a * panic can stop the CPU this routine is running on