Sleep for the same duration as the delay(9) in the cold path.

ok?

Index: pv/hyperv.c
===================================================================
RCS file: /cvs/src/sys/dev/pv/hyperv.c,v
retrieving revision 1.44
diff -u -p -r1.44 hyperv.c
--- pv/hyperv.c 7 Oct 2019 15:36:01 -0000       1.44
+++ pv/hyperv.c 23 Jan 2020 02:09:12 -0000
@@ -560,8 +560,10 @@ hv_start(struct hv_softc *sc, struct hv_
                        s = splnet();
                        hv_intr();
                        splx(s);
-               } else
-                       tsleep(wchan, PRIBIO, wchan, 1);
+               } else {
+                       tsleep_nsec(wchan, PRIBIO, wchan,
+                           USEC_TO_NSEC(delays[i]));
+               }
        }
        if (status != 0) {
                printf("%s: posting vmbus message failed with %d\n",
@@ -622,8 +624,10 @@ hv_wait(struct hv_softc *sc, int (*cond)
                        s = splnet();
                        hv_intr();
                        splx(s);
-               } else
-                       tsleep(wchan, PRIBIO, wmsg ? wmsg : "hvwait", 1);
+               } else {
+                       tsleep_nsec(wchan, PRIBIO, wmsg ? wmsg : "hvwait",
+                           USEC_TO_NSEC(1000));
+               }
        }
 }
 

Reply via email to