mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-03 15:15:01 +00:00
Assume that the timeout value from the capacity is 1-based
Neither the 1.3 or 1.4 standards say this number is 1's based, but adding 1 costs little and copes with those NVMe drives that report '0' in this field cheaply. This is consistent with what the Linux driver does as well.
This commit is contained in:
parent
1575a795cb
commit
dc9df3a59d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350068
|
@ -1255,7 +1255,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
|
||||||
|
|
||||||
/* Get ready timeout value from controller, in units of 500ms. */
|
/* Get ready timeout value from controller, in units of 500ms. */
|
||||||
cap_lo = nvme_mmio_read_4(ctrlr, cap_lo);
|
cap_lo = nvme_mmio_read_4(ctrlr, cap_lo);
|
||||||
to = (cap_lo >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK;
|
to = ((cap_lo >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK) + 1;
|
||||||
ctrlr->ready_timeout_in_ms = to * 500;
|
ctrlr->ready_timeout_in_ms = to * 500;
|
||||||
|
|
||||||
timeout_period = NVME_DEFAULT_TIMEOUT_PERIOD;
|
timeout_period = NVME_DEFAULT_TIMEOUT_PERIOD;
|
||||||
|
|
Loading…
Reference in a new issue