Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:06:58 -0000
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r346240 - stable/11/sys/dev/nvme
Message-ID:  <201904151624.x3FGOQBv038210@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Apr 15 16:24:26 2019
New Revision: 346240
URL: https://svnweb.freebsd.org/changeset/base/346240

Log:
  MFC r340412: Use atomic_load_acq_int() here too to poll done, ala r328521

Modified:
  stable/11/sys/dev/nvme/nvme_ns.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/nvme/nvme_ns.c
==============================================================================
--- stable/11/sys/dev/nvme/nvme_ns.c	Mon Apr 15 16:23:57 2019	(r346239)
+++ stable/11/sys/dev/nvme/nvme_ns.c	Mon Apr 15 16:24:26 2019	(r346240)
@@ -516,11 +516,11 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t 
 	if (!mtx_initialized(&ns->lock))
 		mtx_init(&ns->lock, "nvme ns lock", NULL, MTX_DEF);
 
-	status.done = FALSE;
+	status.done = 0;
 	nvme_ctrlr_cmd_identify_namespace(ctrlr, id, &ns->data,
 	    nvme_completion_poll_cb, &status);
-	while (status.done == FALSE)
-		DELAY(5);
+	while (!atomic_load_acq_int(&status.done))
+		pause("nvme", 1);
 	if (nvme_completion_is_error(&status.cpl)) {
 		nvme_printf(ctrlr, "nvme_identify_namespace failed\n");
 		return (ENXIO);





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