Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/hyperv hvn(4), hvkbd(4): Only need to poll when cold.



details:   https://anonhg.NetBSD.org/src/rev/91f01ef557b5
branches:  trunk
changeset: 461308:91f01ef557b5
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Fri Nov 22 12:40:07 2019 +0000

description:
hvn(4), hvkbd(4): Only need to poll when cold.

diffstat:

 sys/dev/hyperv/hvkbd.c  |  14 +++++++-------
 sys/dev/hyperv/if_hvn.c |  24 ++++++++++++------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diffs (93 lines):

diff -r 1206e2dbb05a -r 91f01ef557b5 sys/dev/hyperv/hvkbd.c
--- a/sys/dev/hyperv/hvkbd.c    Fri Nov 22 12:30:32 2019 +0000
+++ b/sys/dev/hyperv/hvkbd.c    Fri Nov 22 12:40:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hvkbd.c,v 1.5 2019/11/22 12:30:32 nonaka Exp $ */
+/*     $NetBSD: hvkbd.c,v 1.6 2019/11/22 12:40:07 nonaka Exp $ */
 
 /*-
  * Copyright (c) 2017 Microsoft Corp.
@@ -36,7 +36,7 @@
 #endif /* _KERNEL_OPT */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.5 2019/11/22 12:30:32 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.6 2019/11/22 12:40:07 nonaka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -344,13 +344,13 @@
        }
 
        do {
-               if (cold)
+               if (cold) {
                        delay(1000);
-               else
+                       s = spltty();
+                       hvkbd_intr(sc);
+                       splx(s);
+               } else
                        tsleep(sc, PRIBIO | PCATCH, "hvkbdcon", mstohz(1));
-               s = spltty();
-               hvkbd_intr(sc);
-               splx(s);
        } while (--timo > 0 && sc->sc_connected == 0);
 
        if (timo == 0 && sc->sc_connected == 0) {
diff -r 1206e2dbb05a -r 91f01ef557b5 sys/dev/hyperv/if_hvn.c
--- a/sys/dev/hyperv/if_hvn.c   Fri Nov 22 12:30:32 2019 +0000
+++ b/sys/dev/hyperv/if_hvn.c   Fri Nov 22 12:40:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_hvn.c,v 1.8 2019/11/22 12:30:32 nonaka Exp $        */
+/*     $NetBSD: if_hvn.c,v 1.9 2019/11/22 12:40:07 nonaka Exp $        */
 /*     $OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $       */
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.8 2019/11/22 12:30:32 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.9 2019/11/22 12:40:07 nonaka Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1081,13 +1081,13 @@
                return 0;
 
        do {
-               if (cold)
+               if (cold) {
                        delay(1000);
-               else
+                       s = splnet();
+                       hvn_nvs_intr(sc);
+                       splx(s);
+               } else
                        tsleep(sc, PRIBIO | PCATCH, "nvscmd", mstohz(1));
-               s = splnet();
-               hvn_nvs_intr(sc);
-               splx(s);
        } while (--timo > 0 && sc->sc_nvsdone != 1);
 
        if (timo == 0 && sc->sc_nvsdone != 1) {
@@ -1404,13 +1404,13 @@
            BUS_DMASYNC_POSTWRITE);
 
        do {
-               if (cold)
+               if (cold) {
                        delay(1000);
-               else
+                       s = splnet();
+                       hvn_nvs_intr(sc);
+                       splx(s);
+               } else
                        tsleep(rc, PRIBIO | PCATCH, "rndiscmd", mstohz(1));
-               s = splnet();
-               hvn_nvs_intr(sc);
-               splx(s);
        } while (--timo > 0 && rc->rc_done != 1);
 
        bus_dmamap_sync(sc->sc_dmat, rc->rc_dmap, 0, PAGE_SIZE,



Home | Main Index | Thread Index | Old Index