Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151302041
D34869.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D34869.diff
View Options
diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/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 Memory Page Size selected during device initialization. Note
+ * that value stored in mps is suitable to use here without adjusting by
+ * NVME_MPS_SHIFT.
+ */
+ cc |= ctrlr->mps << NVME_CC_REG_MPS_SHIFT;
nvme_ctrlr_barrier(ctrlr, BUS_SPACE_BARRIER_WRITE);
nvme_mmio_write_4(ctrlr, cc, cc);
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h
--- a/sys/dev/nvme/nvme_private.h
+++ b/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.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 10:46 AM (9 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31095510
Default Alt Text
D34869.diff (1 KB)
Attached To
Mode
D34869: nvme: Use saved mps when initializing drive
Attached
Detach File
Event Timeline
Log In to Comment