Index: sys/dev/nvme/nvme_ahci.c =================================================================== --- sys/dev/nvme/nvme_ahci.c +++ sys/dev/nvme/nvme_ahci.c @@ -104,7 +104,15 @@ } ctrlr->tag = (void *)0x1; - return nvme_attach(dev); + /* + * We're attached via this funky mechanism. Flag the controller so that + * it avoids things that can't work when we do that. + */ + ctrlr->quirks |= QUIRK_AHCI; + + ret = nvme_attach(dev); + if (ret != 0) + goto bad; bad: if (ctrlr->resource != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, Index: sys/dev/nvme/nvme_private.h =================================================================== --- sys/dev/nvme/nvme_private.h +++ sys/dev/nvme/nvme_private.h @@ -241,6 +241,7 @@ #define QUIRK_DELAY_B4_CHK_RDY 1 /* Can't touch MMIO on disable */ #define QUIRK_DISABLE_TIMEOUT 2 /* Disable broken completion timeout feature */ #define QUIRK_INTEL_ALIGNMENT 4 /* Pre NVMe 1.3 performance alignment */ +#define QUIRK_AHCI 8 /* Attached via AHCI redirect */ bus_space_tag_t bus_tag; bus_space_handle_t bus_handle;