Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jan 2022 02:26:57 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 21de49b06cb8 - stable/13 - nvme: Use MS_2_TICKS rather than rolling our own
Message-ID:  <202201210226.20L2QvY0001335@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=21de49b06cb85225e5b4a26ff99f4d3aa4604ca6

commit 21de49b06cb85225e5b4a26ff99f4d3aa4604ca6
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-10-01 16:50:04 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-01-21 02:07:30 +0000

    nvme: Use MS_2_TICKS rather than rolling our own
    
    Sponsored by:           Netflix
    Reviewed by:            mav
    Differential Revision:  https://reviews.freebsd.org/D32246
    
    (cherry picked from commit 26259f6ab96e68766556b973d3a4ca0ad125e174)
---
 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?202201210226.20L2QvY0001335>