Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177643107
D61630.1794930587.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D61630.1794930587.diff
View Options
diff --git a/share/man/man4/nvme.4 b/share/man/man4/nvme.4
--- a/share/man/man4/nvme.4
+++ b/share/man/man4/nvme.4
@@ -31,7 +31,7 @@
.\"
.\" Author: Jim Harris <jimharris@FreeBSD.org>
.\"
-.Dd September 1, 2026
+.Dd November 13, 2026
.Dt NVME 4
.Os
.Sh NAME
@@ -51,6 +51,7 @@
.Cd hw.nvme.arb_burst= Ns Aq Ar X
.Cd hw.nvme.apst_enable= Ns Ar 1
.Cd hw.nvme.apst_data
+.Cd hw.nvme.timestamp= Ns Ar 0
.Cd hw.nvme.use_nvd= Ns Ar 0
.Cd nvme_load="YES"
.Pp
@@ -186,6 +187,10 @@
transition to, as well as the idle time in milliseconds (bits 8..31)
to wait before that transition.
Bits 0..2 must be zero.
+.It Va hw.nvme.timestamp=0
+Do not set the controller's Timestamp feature.
+By default it is set to the system time when the root file system is
+mounted and again after every controller reset.
.It Va hw.nvme.use_nvd=0
The
.Xr nvd 4
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
@@ -915,6 +915,16 @@
free(data, M_NVME);
}
+static bool
+nvme_ctrlr_timestamp_enabled(struct nvme_controller *ctrlr)
+{
+ bool enable = true;
+
+ TUNABLE_BOOL_FETCH("hw.nvme.timestamp", &enable);
+ return (enable &&
+ NVMEV(NVME_CTRLR_DATA_ONCS_TIMESTAMP, ctrlr->cdata.oncs) != 0);
+}
+
/* XXX revisit the ordering if the clock ever comes up earlier. */
static void
nvme_ctrlr_set_timestamp(struct nvme_controller *ctrlr)
@@ -953,7 +963,7 @@
static void
nvme_ctrlr_configure_timestamp(struct nvme_controller *ctrlr)
{
- if (NVMEV(NVME_CTRLR_DATA_ONCS_TIMESTAMP, ctrlr->cdata.oncs) == 0)
+ if (!nvme_ctrlr_timestamp_enabled(ctrlr))
return;
/* The mountroot handler registered at attach does the initial set. */
@@ -1310,8 +1320,7 @@
nvme_printf(ctrlr,
"ignoring Apple-internal namespaces above NSID 1\n");
- if (!root_mounted() &&
- NVMEV(NVME_CTRLR_DATA_ONCS_TIMESTAMP, ctrlr->cdata.oncs) != 0)
+ if (!root_mounted() && nvme_ctrlr_timestamp_enabled(ctrlr))
ctrlr->timestamp_tag = EVENTHANDLER_REGISTER(mountroot,
nvme_ctrlr_timestamp_mountroot, ctrlr,
EVENTHANDLER_PRI_ANY);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 17, 3:49 PM (18 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41802428
Default Alt Text
D61630.1794930587.diff (2 KB)
Attached To
Mode
D61630: nvme: add a tunable to disable setting the controller Timestamp
Attached
Detach File
Event Timeline