Date: Wed, 7 Dec 2011 10:29:07 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: d@delphij.net Cc: FreeBSD Current <freebsd-current@FreeBSD.ORG> Subject: Re: [RFC] winbond watchdog driver for FreeBSD/i386 and FreeBSD/amd64 Message-ID: <20111207092907.GA1645@garage.freebsd.pl> In-Reply-To: <4E0A5689.2020302@delphij.net> References: <4E0A5689.2020302@delphij.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111207092907.GA1645>