Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > muc.lists.freebsd.hardware > #1976

Re: watchdog timer programming

From Stephane Rochoy <stephane.rochoy@stormshield.eu>
Newsgroups muc.lists.freebsd.hardware
Subject Re: watchdog timer programming
Date 2024-09-25 09:13 +0200
Organization Newsgate at muc.de e.V.
Message-ID <86plosdv48.fsf@cthulhu.stephaner.labo.int> (permalink)
References <86plotbk5b.fsf@cthulhu.stephaner.labo.int> <9008b389-ab06-401d-9a95-84f849ca602a@sentex.net> <3065debc-8d4f-4487-abbb-c9408810cea6@sentex.net>

Show all headers | View raw


mike tancsa <mike@sentex.net> writes:

> On 9/24/2024 2:46 AM, Stephane Rochoy wrote:
>>
>> mike tancsa <mike@sentex.net> writes:
>>
>>> I am trying to get
>>>
>>> superio0: <ITE IT8613 SuperIO (revision 0x0c)> at port 
>>> 0x2e-0x2f on isa0
>>> itwd0: <Watchdog Timer on ITE SuperIO> at WDT ldn 0x07 on 
>>> superio0
>>> itwd0: Configured for system reset on timeout
>>>
>>> working on FreeBSD.  The driver seems to load / attach fine, 
>>> but it does
>>> not want to reboot the box.  Adding a #define DIAGNOSTICS 1
>>>
>>> shows
>>>
>>> itwd0: <Watchdog Timer on ITE SuperIO> at WDT ldn 0x07 on 
>>> superio0
>>> itwd0: Configured for system reset on timeout
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>> itwd0: setting timeout to 4
>>>
>>> when I do
>>>
>>>  watchdogd -t 3
>>>  killall -9 watchdogd
>>>
>>> but never a reboot :(
>>>
>>> Any idea how to get this hardware working ?
>>
>> Do you know if, at least, the pre-timeout is working?
>
>     How do I check that ?

Using --pretimeout and --pretimeout-action. See watchdogd(8) for
more details.

>> By the way, do you have the datasheet of the ITE chip? (I know 
>> I
>> must be very optimistic to ask such a question ;))
>
> I dont have the datasheet sadly. However, they do seem to be at
> …
> and are publicly available according to the
> Linux driver.
>
> I did load up ubuntu on the box, and the watchdog does seem to 
> work
> correctly.   sysctl doesnt seem to allow for setting those 
> values

The .nmi and .irq are FreeBSD-specific I guess. And they have to
be set via loader.conf(5). Note sysctl != tunable but tunable is,
most of the time, made available as sysctl.

> sysctl -A dev.itwd
> dev.itwd.0.%parent: superio0
> dev.itwd.0.%pnpinfo: type=WDT
> dev.itwd.0.%location: ldn=0x07
> dev.itwd.0.%driver: itwd
> dev.itwd.0.%desc: Watchdog Timer on ITE SuperIO
> dev.itwd.%parent:
>
> On linux,
> modprobe it87_wdt
> ] it87_wdt: Chip IT8613 revision 12 initialized. timeout=60 sec
> (nowayout=0 testmode=0)
>
> wdctl
> Device:        /dev/watchdog0
> Identity:      IT87 WDT [version 1]
> Timeout:       60 seconds
> Pre-timeout:    0 seconds
> FLAG           DESCRIPTION               STATUS BOOT-STATUS
> KEEPALIVEPING  Keep alive ping reply          1           0
> MAGICCLOSE     Supports magic close char      0           0
> SETTIMEOUT     Set timeout (in seconds)       0           0
>
> The code is at
> https://github.com/torvalds/linux/blob/master/drivers/watchdog/it87_wdt.c
> if that helps shed any light.

So chip is IT8613.

> i tried defining the irq and playing with the nmi at 1 or 0, and 
> still
> no luck. e.g. setting it to 0x05 and nmi 0, kldload (with boot 
> verbose)
> and then starting up watchdogd -t 8... wait 9 seconds,  and then 
> killall
> -9 watchdogd, still does not reboot the box
>
> itwd0: <Watchdog Timer on ITE SuperIO> at WDT ldn 0x07 on 
> superio0
> ioapic0: routing intpin 5 (ISA IRQ 5) to lapic 0 vector 56
> itwd0: Using IRQ5 to signal timeout
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: setting timeout to 8
> itwd0: got interrupt, wdt status = 1
>
> Same with irq at 0x0f with and without nmi=0 or 1.
>
> itwd0: <Watchdog Timer on ITE SuperIO> at WDT ldn 0x07 on 
> superio0
> itwd0: Using IRQ15 to signal timeout
> itwd0: setting timeout to 16
> itwd0: setting timeout to 16
> itwd0: setting timeout to 16
> itwd0: setting timeout to 16
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4
> itwd0: setting timeout to 4

OK no luck. The Linux driver don't seems to set IRQ either.

Regards,
-- 
Stéphane Rochoy
O: Stormshield


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

Back to muc.lists.freebsd.hardware | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: watchdog timer programming Stephane Rochoy <stephane.rochoy@stormshield.eu> - 2024-09-24 08:46 +0200
  Re: watchdog timer programming Stephane Rochoy <stephane.rochoy@stormshield.eu> - 2024-09-25 09:13 +0200
    Re: watchdog timer programming Stephane Rochoy <stephane.rochoy@stormshield.eu> - 2024-09-27 08:09 +0200
    Re: watchdog timer programming Stephane Rochoy <stephane.rochoy@stormshield.eu> - 2024-09-27 15:55 +0200
      Re: watchdog timer programming Stephane Rochoy <stephane.rochoy@stormshield.eu> - 2024-09-30 09:18 +0200
      Re: watchdog timer programming Stephane Rochoy <stephane.rochoy@stormshield.eu> - 2024-10-01 08:07 +0200
  Re: watchdog timer programming (progress) Stephane Rochoy <stephane.rochoy@stormshield.eu> - 2024-10-02 11:13 +0200

csiph-web