Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Apr 2019 14:56:59 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r346231 - stable/12/sys/dev/nvme
Message-ID:  <201904151456.x3FEuxV0089686@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Apr 15 14:56:59 2019
New Revision: 346231
URL: https://svnweb.freebsd.org/changeset/base/346231

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

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

Modified: stable/12/sys/dev/nvme/nvme_ns.c
==============================================================================
--- stable/12/sys/dev/nvme/nvme_ns.c	Mon Apr 15 14:54:48 2019	(r346230)
+++ stable/12/sys/dev/nvme/nvme_ns.c	Mon Apr 15 14:56:59 2019	(r346231)
@@ -533,11 +533,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?201904151456.x3FEuxV0089686>