From owner-freebsd-current@FreeBSD.ORG Wed Dec 7 09:30:10 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74E3F106564A for ; Wed, 7 Dec 2011 09:30:10 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 1B24C8FC17 for ; Wed, 7 Dec 2011 09:30:09 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 8537D3CF; Wed, 7 Dec 2011 10:30:06 +0100 (CET) Date: Wed, 7 Dec 2011 10:29:07 +0100 From: Pawel Jakub Dawidek To: d@delphij.net Message-ID: <20111207092907.GA1645@garage.freebsd.pl> References: <4E0A5689.2020302@delphij.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <4E0A5689.2020302@delphij.net> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: FreeBSD Current Subject: Re: [RFC] winbond watchdog driver for FreeBSD/i386 and FreeBSD/amd64 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2011 09:30:10 -0000 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 28, 2011 at 03:32:41PM -0700, Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 >=20 > Hi, >=20 > I'd like to request for comments on the attached driver, which supports > watchdogs on several Winbond super I/O chip models and have been tested > on a few of recent Supermicro motherboards. Is there any reason this is not yet committed? Please commit, pretty please. One minor problem I found is described below. Other than that it works for me, thanks! [...] > +static void > +winbondwd_event(void *arg, unsigned int cmd, int *error) > +{ > + struct winbondwd_softc *sc =3D arg; > + unsigned char rtimeout; > + uint64_t timeout; > + > + if (cmd =3D=3D 0) > + winbondwd_set_timeout(sc, 0); > + else { > + timeout =3D (uint64_t)1 << (cmd & WD_INTERVAL); > + if (timeout < (uint64_t)0xff * 1000 * 1000 * 1000) { > + rtimeout =3D timeout / (1000 * 1000 * 1000); > + if (rtimeout =3D=3D 0) > + rtimeout =3D 0xff; > + winbondwd_set_timeout(sc, rtimeout); > + } else { > + device_printf(sc->device, > + "Value %u too big, disabling\n", cmd & WD_INTERVAL); > + /* Proposed timeout can not be satisified */ > + winbondwd_set_timeout(sc, 0); > + } You should add '*error =3D 0;' right here. Without it we return some random error, in my case watchdgod is able to arm the watchdog but exits when trying to pat it, as it gets an error, which leads to a reset short aferwards. > + } > +} --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk7fMeMACgkQForvXbEpPzTg4ACg6n5LNqN3cNW4yBiWZ0vTVDeB JCMAniBz2kXsKcfpyxe96ifN/roR6eHN =CqVQ -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx--