Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Oct 2021 16:56:23 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 26259f6ab96e - main - nvme: Use MS_2_TICKS rather than rolling our own
Message-ID:  <202110011656.191GuNM3004057@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=26259f6ab96e68766556b973d3a4ca0ad125e174

commit 26259f6ab96e68766556b973d3a4ca0ad125e174
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-10-01 16:50:04 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-10-01 16:56:10 +0000

    nvme: Use MS_2_TICKS rather than rolling our own
    
    Sponsored by:           Netflix
    Reviewed by:            mav
    Differential Revision:  https://reviews.freebsd.org/D32246
---
 sys/dev/nvme/nvme_ctrlr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
index 897d832047ce..f22e21eaf54a 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -262,7 +262,7 @@ nvme_ctrlr_fail_req_task(void *arg, int pending)
 static int
 nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val)
 {
-	int timeout = ticks + (uint64_t)ctrlr->ready_timeout_in_ms * hz / 1000;
+	int timeout = ticks + MSEC_2_TICKS(ctrlr->ready_timeout_in_ms);
 	uint32_t csts;
 
 	while (1) {
@@ -326,7 +326,7 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr)
 	 * cope with these issues.
 	 */
 	if (ctrlr->quirks & QUIRK_DELAY_B4_CHK_RDY)
-		pause("nvmeR", B4_CHK_RDY_DELAY_MS * hz / 1000);
+		pause("nvmeR", MSEC_2_TICKS(B4_CHK_RDY_DELAY_MS));
 	return (nvme_ctrlr_wait_for_ready(ctrlr, 0));
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110011656.191GuNM3004057>