*/
        synchronize_srcu(&dev->odp_srcu);
 
+       /*
+        * All work on the prefetch list must be completed, xa_erase() prevented
+        * new work from being created.
+        */
+       wait_event(imr->q_deferred_work, !atomic_read(&imr->num_deferred_work));
+
+       /*
+        * At this point it is forbidden for any other thread to enter
+        * pagefault_mr() on this imr. It is already forbidden to call
+        * pagefault_mr() on an implicit child. Due to this additions to
+        * implicit_children are prevented.
+        */
+
+       /*
+        * Block destroy_unused_implicit_child_mr() from incrementing
+        * num_deferred_work.
+        */
        xa_lock(&imr->implicit_children);
        xa_for_each (&imr->implicit_children, idx, mtt) {
                __xa_erase(&imr->implicit_children, idx);
        xa_unlock(&imr->implicit_children);
 
        /*
-        * num_deferred_work can only be incremented inside the odp_srcu, or
-        * under xa_lock while the child is in the xarray. Thus at this point
-        * it is only decreasing, and all work holding it is now on the wq.
+        * Wait for any concurrent destroy_unused_implicit_child_mr() to
+        * complete.
         */
        wait_event(imr->q_deferred_work, !atomic_read(&imr->num_deferred_work));