Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Oct 2008 15:31:20 +0200
From:      Patrick =?ISO-8859-15?Q?Lamaizi=E8re?= <patfbsd@davenulle.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   watchdog(9) bug in geode cs5536 watchdog
Message-ID:  <20081010153120.2ca88ef5@baby-jane-lamaiziere-net.local>

next in thread | raw e-mail | index | archive | help
--MP_/D_3JDDYDNCxH1cXBZgAUe2e
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello,

On a soekris Net5501, if you do a watchdog -t 16, followed by a watchdog
-t 0 to disable the watchdog, and then after some time (16s) re-enable
the watchdog the box reboots immediatly. This prevents also to stop and
restart watchdogd(8).

This is because when you stop the watchdog, the timer is not stoped,
only the hard reset is disabled. So when the timer has elapsed, the C2
event of the timer is set. 

But when the hard reset is re-enabled, the event is not cleared and the
box reboots.


The attached patch stops and resets the counter when the watchdog is
disabled and do not disable the hard reset of the timer (if the timer
has elapsed it's too late).

(also on http://user.lamaiziere.net/patrick/geode.c-patch.txt)

Regards.
--MP_/D_3JDDYDNCxH1cXBZgAUe2e
Content-Type: application/octet-stream; name=geode.c-patch.txt
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=geode.c-patch.txt

LS0tIGdlb2RlLmMJMjAwOC0xMC0wOSAyMDo1Mjo0Ny4wMDAwMDAwMDAgKzAyMDAKKysrIC91c3Iv
c3JjL3N5cy9pMzg2L2kzODYvZ2VvZGUuYwkyMDA4LTEwLTEwIDEwOjI1OjQ3LjAwMDAwMDAwMCAr
MDIwMApAQCAtMjA4LDE0ICsyMDgsMTEgQEAKIHN0YXRpYyB2b2lkCiBjczU1MzZfd2F0Y2hkb2co
dm9pZCAqZm9vIF9fdW51c2VkLCB1X2ludCBjbWQsIGludCAqZXJyb3IpCiB7Ci0JdV9pbnQgdSwg
cDsKKwl1X2ludCB1LCBwLCBzOwogCXVpbnQxNl90IGE7CiAJdWludDMyX3QgbTsKIAogCWEgPSBy
ZG1zcigweDUxNDAwMDBkKTsKLQltID0gcmRtc3IoMHg1MTQwMDAyOSk7Ci0JbSAmPSB+KDEgPDwg
MjQpOwotCXdybXNyKDB4NTE0MDAwMjksIG0pOwogCiAJdSA9IGNtZCAmIFdEX0lOVEVSVkFMOwog
CWlmICh1ID49IDMwICYmIHUgPD0gNDQpIHsKQEAgLTIyOCwxMiArMjI1LDI0IEBACiAJCS8qIHJl
c2V0IGNvdW50ZXIgKi8KIAkJb3V0dyhhICsgNCwgMCk7CiAJCS8qIEFybSByZXNldCBtZWNoYW5p
c20gKi8KKwkJbSA9IHJkbXNyKDB4NTE0MDAwMjkpOwogCQltIHw9ICgxIDw8IDI0KTsKIAkJd3Jt
c3IoMHg1MTQwMDAyOSwgbSk7CiAJCS8qIFN0YXJ0IGNvdW50ZXIgKi8KIAkJb3V0dyhhICsgNiwg
MHg4MDAwKTsKIAogCQkqZXJyb3IgPSAwOworCX0gZWxzZSB7CisJCS8qIAorCQkgKiBNRkdQVF9T
RVRVUCBpcyB3cml0ZS1vbmNlCisJCSAqIENoZWNrIGlmIHRoZSBjb3VudGVyIGhhcyBiZWVuIHNl
dHVwCisJCSAqLworCQlzID0gaW53KGEgKyA2KTsKKwkJaWYgKHMgJiAoMSA8PCAxMikpIHsKKwkJ
CS8qIFN0b3AgYW5kIHJlc2V0IGNvdW50ZXIgKi8KKwkJCW91dHcoYSArIDYsIDApOworCQkJb3V0
dyhhICsgNCwgMCk7CisJCX0KIAl9CiB9CiAK

--MP_/D_3JDDYDNCxH1cXBZgAUe2e--



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