Index: sys/dev/nvme/nvme_ctrlr.c =================================================================== --- sys/dev/nvme/nvme_ctrlr.c +++ sys/dev/nvme/nvme_ctrlr.c @@ -388,8 +388,12 @@ cc |= 6 << NVME_CC_REG_IOSQES_SHIFT; /* SQ entry size == 64 == 2^6 */ cc |= 4 << NVME_CC_REG_IOCQES_SHIFT; /* CQ entry size == 16 == 2^4 */ - /* This evaluates to 0, which is according to spec. */ - cc |= (PAGE_SHIFT - NVME_BASE_SHIFT) << NVME_CC_REG_MPS_SHIFT; + /* + * Use the smallest page size because we set everything else relative to + * this both this field and the MPSMIN in cap_hi have the same bias of + * 12 so no adjustment here is needed. + */ + cc |= ctrlr->mps << NVME_CC_REG_MPS_SHIFT; nvme_ctrlr_barrier(ctrlr, BUS_SPACE_BARRIER_WRITE); nvme_mmio_write_4(ctrlr, cc, cc); Index: sys/dev/nvme/nvme_private.h =================================================================== --- sys/dev/nvme/nvme_private.h +++ sys/dev/nvme/nvme_private.h @@ -96,11 +96,6 @@ /* Maximum log page size to fetch for AERs. */ #define NVME_MAX_AER_LOG_SIZE (4096) -/* - * Page size parameters - */ -#define NVME_BASE_SHIFT 12 /* Several parameters (MSP) are 2^(12+x) */ - /* * Define CACHE_LINE_SIZE here for older FreeBSD versions that do not define * it.