Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171767470
D59631.id186570.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
D59631.id186570.diff
View Options
diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h
--- a/sys/dev/nvme/nvme.h
+++ b/sys/dev/nvme/nvme.h
@@ -186,6 +186,16 @@
#define NVME_AQA_REG_ACQS_SHIFT (16)
#define NVME_AQA_REG_ACQS_MASK (0xFFF)
+#define NVME_CRTO_REG_CRWMT_SHIFT (0)
+#define NVME_CRTO_REG_CRWMT_MASK (0xFFFF)
+#define NVME_CRTO_REG_CRIMT_SHIFT (16)
+#define NVME_CRTO_REG_CRIMT_MASK (0xFFFF)
+
+#define NVME_CRTO_CRWMT(x) \
+ NVMEV(NVME_CRTO_REG_CRWMT, x)
+#define NVME_CRTO_CRIMT(x) \
+ NVMEV(NVME_CRTO_REG_CRIMT, x)
+
#define NVME_PMRCAP_REG_RDS_SHIFT (3)
#define NVME_PMRCAP_REG_RDS_MASK (0x1)
#define NVME_PMRCAP_REG_WDS_SHIFT (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
@@ -1698,7 +1698,7 @@
struct make_dev_args md_args;
uint32_t cap_lo;
uint32_t cap_hi;
- uint32_t to, vs, pmrcap;
+ uint32_t crto, to, vs, pmrcap;
int status, timeout_period;
ctrlr->dev = dev;
@@ -1761,7 +1761,11 @@
ctrlr->page_size = 1 << (NVME_MPS_SHIFT + ctrlr->mps);
/* Get ready timeout value from controller, in units of 500ms. */
- to = NVME_CAP_LO_TO(cap_lo) + 1;
+ if (NVME_CAP_HI_CRWMS(cap_hi)) {
+ crto = nvme_mmio_read_4(ctrlr, crto);
+ to = max(NVME_CRTO_CRWMT(crto), NVME_CAP_LO_TO(cap_lo)) + 1;
+ } else
+ to = NVME_CAP_LO_TO(cap_lo) + 1;
ctrlr->ready_timeout_in_ms = to * 500;
timeout_period = NVME_ADMIN_TIMEOUT_PERIOD;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 14, 9:25 AM (13 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38899627
Default Alt Text
D59631.id186570.diff (1 KB)
Attached To
Mode
D59631: nvme: honor CRTO for the controller ready timeout
Attached
Detach File
Event Timeline
Log In to Comment