Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Apr 2011 14:12:58 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221016 - head/sys/dev/ichwd
Message-ID:  <201104251412.p3PECwb4079423@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Mon Apr 25 14:12:58 2011
New Revision: 221016
URL: http://svn.freebsd.org/changeset/base/221016

Log:
  Add missing bit in r221015.
  
  Sponsored by:	Sandvine Incorporated
  Reviewed by:	des
  MFC after:	1 week
  X-MFC:		r221015

Modified:
  head/sys/dev/ichwd/ichwd.c

Modified: head/sys/dev/ichwd/ichwd.c
==============================================================================
--- head/sys/dev/ichwd/ichwd.c	Mon Apr 25 14:10:33 2011	(r221015)
+++ head/sys/dev/ichwd/ichwd.c	Mon Apr 25 14:12:58 2011	(r221016)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104251412.p3PECwb4079423>