Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/isa Handle watchdog attachment in the wbsio_rescan()...



details:   https://anonhg.NetBSD.org/src/rev/c2df61d1f252
branches:  trunk
changeset: 829963:c2df61d1f252
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Feb 20 01:53:39 2018 +0000

description:
Handle watchdog attachment in the wbsio_rescan() function, where we
take care of other children.

ok knakahara@ and yamaguchi@

diffstat:

 sys/dev/isa/wbsio.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 60f4e2f2cc91 -r c2df61d1f252 sys/dev/isa/wbsio.c
--- a/sys/dev/isa/wbsio.c       Mon Feb 19 23:03:00 2018 +0000
+++ b/sys/dev/isa/wbsio.c       Tue Feb 20 01:53:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wbsio.c,v 1.21 2018/01/02 00:47:14 pgoyette Exp $      */
+/*     $NetBSD: wbsio.c,v 1.22 2018/02/20 01:53:39 pgoyette Exp $      */
 /*     $OpenBSD: wbsio.c,v 1.10 2015/03/14 03:38:47 jsg Exp $  */
 /*
  * Copyright (c) 2008 Mark Kettenis <kettenis%openbsd.org@localhost>
@@ -284,8 +284,7 @@
        if (!pmf_device_register(self, wbsio_suspend, NULL))
                aprint_error_dev(self, "couldn't establish power handler\n");
 
-       wbsio_wdog_attach(self);
-
+       sc->sc_smw_valid = false;
        wbsio_rescan(self, "wbsio", NULL);
 
 #if NGPIO > 0
@@ -336,6 +335,8 @@
 #endif
        config_search_loc(wbsio_search, self, ifattr, locators, NULL);
 
+       wbsio_wdog_attach(self);
+
        return 0;
 }
 
@@ -799,7 +800,8 @@
        uint16_t devid;
        uint8_t rev;
 
-       sc->sc_smw_valid = false;
+       if (sc->sc_smw_valid)
+               return;         /* watchdog already attached */
 
        wbsio_conf_enable(&sc->sc_conf_lock, sc->sc_iot, sc->sc_ioh);
        devid = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_ID);



Home | Main Index | Thread Index | Old Index