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);


_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to