On Sat, 17 Jul 2010, David Young wrote:

It is a generic capability.  ...

That's the conclusion I came to.

... ISTM watchdog timers should eventually be
refactored in this way: each watchdog timer in the system should have a
corresponding pseudo-device, an instance of wdog(4). wdog(4) provides
its own suspension/resumption/detachment routines.  Let wdog_suspend()
return false if the watchdog is active (for now). ipmi0 should attach
wdog0 using a wdogbus interface attribute.  Let struct sysmon_wdog
become the watchdog attachment arguments, wdog_attach_args.

That's probably a bit more work than I want to commit to right now. I was hoping there would be an easier way, since the sysmon pseudo-device already exists (with exactly one device-minor for wdogs). But I could not find anywhere a device_t, so no way to register a power handler.

A also looked at just creating a new pmf device class for watchdogs, since most watchdogs are actually associated with some other hardware device (and therefore there's a device_t to use when registering the handler). But there's pseudo-device swwdog(4) that has no hardware behind it, so I ended up back with the same problem!

Your patch looks fine.

Thanks.  I will commit this for now, with a big XXX in the commit log.

I've also got a patch for itesio(4). Currently, itesio registers a NULL suspend handler, whether or not the particular device includes a wdog. My patch will register a real suspend handler if the wdog is present.



I'll add watchdog-factoring to my To-Do list, but for now I'll just commit the changes for itesio(4) and ipmi(4).



-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------

Reply via email to