Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Nov 2018 22:41:21 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340412 - head/sys/dev/nvme
Message-ID:  <201811132241.wADMfLL5056118@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Tue Nov 13 22:41:20 2018
New Revision: 340412
URL: https://svnweb.freebsd.org/changeset/base/340412

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

Modified:
  head/sys/dev/nvme/nvme_ns.c

Modified: head/sys/dev/nvme/nvme_ns.c
==============================================================================
--- head/sys/dev/nvme/nvme_ns.c	Tue Nov 13 21:40:56 2018	(r340411)
+++ head/sys/dev/nvme/nvme_ns.c	Tue Nov 13 22:41:20 2018	(r340412)
@@ -535,11 +535,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?201811132241.wADMfLL5056118>