diff options
| author | Attilio Rao <attilio@FreeBSD.org> | 2011-04-25 14:12:58 +0000 |
|---|---|---|
| committer | Attilio Rao <attilio@FreeBSD.org> | 2011-04-25 14:12:58 +0000 |
| commit | f451d23cfca58e9353ae7c58bf72abdf9e0a1b99 (patch) | |
| tree | 898a9726d0e089f6060f1c4e986ef46787e75788 /sys/dev/ichwd | |
| parent | bb83df766ccf7e0873fa58ef3b5c1af286cffd87 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ichwd')
| -rw-r--r-- | sys/dev/ichwd/ichwd.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/ichwd/ichwd.c b/sys/dev/ichwd/ichwd.c index 6bb9eee32989..b39747a27187 100644 --- a/sys/dev/ichwd/ichwd.c +++ b/sys/dev/ichwd/ichwd.c @@ -217,6 +217,15 @@ ichwd_smi_enable(struct ichwd_softc *sc) } /* + * Check if the watchdog SMI triggering is enabled. + */ +static __inline int +ichwd_smi_is_enabled(struct ichwd_softc *sc) +{ + return ((ichwd_read_smi_4(sc, SMI_EN) & SMI_TCO_EN) != 0); +} + +/* * Reset the watchdog status bits. */ static __inline void @@ -534,6 +543,7 @@ ichwd_attach(device_t dev) sc->ev_tag = EVENTHANDLER_REGISTER(watchdog_list, ichwd_event, sc, 0); /* disable the SMI handler */ + sc->smi_enabled = ichwd_smi_is_enabled(sc); ichwd_smi_disable(sc); return (0); @@ -565,7 +575,8 @@ ichwd_detach(device_t dev) ichwd_tmr_disable(sc); /* enable the SMI handler */ - ichwd_smi_enable(sc); + if (sc->smi_enabled != 0) + ichwd_smi_enable(sc); /* deregister event handler */ if (sc->ev_tag != NULL) |
