aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/watchdog
Commit message (Collapse)AuthorAgeFilesLines
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* make SW_WATCHDOG dynamicMike Karels2018-01-031-0/+15
| | | | | | | | | | | | | | | | | | | | Enable the hardclock-based watchdog previously conditional on the SW_WATCHDOG option whenever hardware watchdogs are not found, and watchdogd attempts to enable the watchdog. The SW_WATCHDOG option still causes the sofware watchdog to be enabled even if there is a hardware watchdog. This does not change the other software-based watchdog enabled by the --softtimeout option to watchdogd. Note that the code to reprime the watchdog during kernel core dumps is no longer conditional on SW_WATCHDOG. I think this was previously a bug. Reviewed by: imp alfred bjk MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D13713 Notes: svn path=/head/; revision=327505
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Some cosmetic polishing for pre-timeouts.Alexander Motin2017-04-201-4/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=317185
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim2015-05-221-2/+2
| | | | | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=283291
* Add a missing include of an options header.Ryan Stone2015-02-281-0/+3
| | | | | | | | | | | watchdog.c does an #ifdef DDB but does not #include "opt_ddb.h". Fixing this turned up a missing include file. MFC after: 1 week X-MFC-With: r261495, r279410 Notes: svn path=/head/; revision=279413
* Use right buffer to print to.Ed Schouten2014-02-041-1/+1
| | | | | | | | | PR: kern/176597 Submitted by: Christoph Mallon <christoph mallon gmx de> MFC after: 2 weeks Notes: svn path=/head/; revision=261495
* Fix watchdog pretimeout.Alfred Perlstein2013-07-271-4/+70
| | | | | | | | | | | The original API calls for pow2ns, however the new APIs from Linux call for seconds. We need to be able to convert to/from 2^Nns to seconds in both userland and kernel to fix this and properly compare units. Notes: svn path=/head/; revision=253719
* watchdogd(8) and watchdog(4) enhancements.Alfred Perlstein2013-02-271-18/+224
| | | | | | | | | | | | | | | | | | | | | | The following support was added to watchdog(4): - Support to query the outstanding timeout. - Support to set a software pre-timeout function watchdog with an 'action' - Support to set a software only watchdog with a configurable 'action' 'action' can be a mask specifying a single operation or a combination of: log(9), printf(9), panic(9) and/or kdb_enter(9). Support the following in watchdogged: - Support to utilize the new additions to watchdog(4). - Support to warn if a watchdog script runs for too long. - Support for "dry run" where we do not actually arm the watchdog, but only report on our timing. Sponsored by: iXsystems, Inc. MFC after: 1 month Notes: svn path=/head/; revision=247405
* - Add the possibility to reuse the already last used timeout when pattingAttilio Rao2011-04-271-13/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | the watchdog, via the watchdog(9) interface. For that, the WD_LASTVAL bitwise operation is used. It is mutually exclusive with any explicit timout passing to the watchdogs. The last timeout can be returned via the wdog_kern_last_timeout() KPI. - Add the possibility to pat the watchdogs installed via the watchdog(9) interface from the kernel. In order to do that the new KPI wdog_kern_pat() is offered and it does accept normalized nanoseconds or WD_LASTVAL. - Avoid to pass WD_ACTIVE down in the watchdog handlers. All the control bit processing should over to the upper layer functions and not passed down to the handlers at all. These changes are intended to be used in order to fix up the watchdog tripping in situation when the userland is busted, but protection is still wanted (examples: shutdown syncing / disk dumping). Sponsored by: Sandvine Incorporated Reviewed by: emaste, des, cognet MFC after: 2 weeks Notes: svn path=/head/; revision=221121
* Revisit the watchdogs: Resetting the error to EINVAL after failing to set theNick Hibma2007-03-271-0/+2
| | | | | | | | | | | watchdog might hide the succesful arming of an earlier one. Accept that on failing to arm any watchdog (because of non-supported timeouts) EOPNOTSUPP is returned instead of the more appropriate EINVAL. MFC after: 3 days Notes: svn path=/head/; revision=167950
* Align the interfaces for the various watchdogs and make the interfaceNick Hibma2006-12-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | behave as expected. Also: - Return an error if WD_PASSIVE is passed in to the ioctl as only WD_ACTIVE is implemented at the moment. See sys/watchdog.h for an explanation of the difference between WD_ACTIVE and WD_PASSIVE. - Remove the I_HAVE_TOTALLY_LOST_MY_SENSE_OF_HUMOR define. If you've lost your sense of humor, than don't add a define. Specific changes: i80321_wdog.c Don't roll your own passive watchdog tickle as this would defeat the purpose of an active (userland) watchdog tickle. ichwd.c / ipmi.c: WD_ACTIVE means active patting of the watchdog by a userland process, not whether the watchdog is active. See sys/watchdog.h. kern_clock.c: (software watchdog) Remove a check for WD_ACTIVE as this does not make sense here. This reverts r1.181. Notes: svn path=/head/; revision=165260
* Return zero when disabling watchdog, unless any of the drivers complain.Poul-Henning Kamp2005-09-291-2/+6
| | | | Notes: svn path=/head/; revision=150707
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-2/+2
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Add a generic watchdog facility which through a single device entryPoul-Henning Kamp2004-02-281-0/+89
in /dev controls all available watchdog implementations. Notes: svn path=/head/; revision=126370