Fork of alistair23 Linux kernel for reMarkable from https://github.com/alistair23/linux
Go to file
Eugeniu Rosca a3d6d79f11 selftests: watchdog: get boot reason via WDIOC_GETBOOTSTATUS
Some watchdog drivers implement WDIOF_CARDRESET feature. As example,
see commit b6ef36d2c1 ("watchdog: qcom: Report reboot reason").
This option allows reporting to userspace the cause of the last boot
(POR/watchdog reset), being helpful in e.g. automated test-cases.

Add support for WDIOC_GETBOOTSTATUS in the test code, to be able to:
- check if watchdog drivers properly implement WDIOF_CARDRESET.
- check the last boot status, if WDIOF_CARDRESET is implemented.

Make the `-b, --bootstatus` option one-shot. That means, skip the
keepalive mechanism if `-b` is provided on the command line, as we
are only interested in the boot status information.

Tested on Rcar-H3 Salvator-X board:

********************** Cold boot finished
salvator-x:/home/root# ./watchdog-test -h
Usage: ./watchdog-test [options]
 -b, --bootstatus    Get last boot status (Watchdog/POR)
 -d, --disable       Turn off the watchdog timer
 -e, --enable        Turn on the watchdog timer
 -h, --help          Print the help message
 -p, --pingrate=P    Set ping rate to P seconds (default 1)
 -t, --timeout=T     Set timeout to T seconds

Parameters are parsed left-to-right in real-time.
Example: ./watchdog-test -d -t 10 -p 5 -e
salvator-x:/home/root#
salvator-x:/home/root# ./watchdog-test -b
Last boot is caused by: Power-On-Reset.
salvator-x:/home/root#
salvator-x:/home/root# ./watchdog-test -d -t 1 -p 2 -e
Watchdog card disabled.
Watchdog timeout set to 1 seconds.
Watchdog ping rate set to 2 seconds.
Watchdog card enabled.
Watchdog Ticking Away!
********************** Reboot due to watchdog trigger finished
salvator-x:/home/root# ./watchdog-test -b
Last boot is caused by: Watchdog.
salvator-x:/home/root#
salvator-x:/home/root# reboot
********************** Reboot due to user action finished
salvator-x:/home/root# ./watchdog-test -b
Last boot is caused by: Power-On-Reset.
salvator-x:/home/root#

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-07-24 12:37:07 -06:00
arch Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 12:00:42 -07:00
block Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2017-07-11 15:36:52 -07:00
certs modsign: add markers to endif-statements in certs/Makefile 2017-07-14 11:01:37 +10:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-07-14 22:49:50 -07:00
Documentation This series converts a number of top-level documents to the RST format 2017-07-15 12:58:58 -07:00
drivers Add wait_for_random_bytes() and get_random_*_wait() functions so that 2017-07-15 12:44:02 -07:00
firmware firmware/Makefile: force recompilation if makefile changes 2017-05-08 17:15:10 -07:00
fs Add wait_for_random_bytes() and get_random_*_wait() functions so that 2017-07-15 12:44:02 -07:00
include Add wait_for_random_bytes() and get_random_*_wait() functions so that 2017-07-15 12:44:02 -07:00
init random: do not ignore early device randomness 2017-07-12 16:26:00 -07:00
ipc ipc/util.h: update documentation for ipc_getref() and ipc_putref() 2017-07-12 16:26:02 -07:00
kernel Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 12:00:42 -07:00
lib Add wait_for_random_bytes() and get_random_*_wait() functions so that 2017-07-15 12:44:02 -07:00
mm Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 12:00:42 -07:00
net Add wait_for_random_bytes() and get_random_*_wait() functions so that 2017-07-15 12:44:02 -07:00
samples Merge branch 'akpm' (patches from Andrew) 2017-07-13 12:38:49 -07:00
scripts Kbuild updates for v4.13 (2nd) 2017-07-13 13:37:57 -07:00
security KEYS: DH: validate __spare field 2017-07-14 11:01:38 +10:00
sound sound fixes for 4.13-rc1 2017-07-14 12:44:00 -07:00
tools selftests: watchdog: get boot reason via WDIOC_GETBOOTSTATUS 2017-07-24 12:37:07 -06:00
usr ramfs: clarify help text that compression applies to ramfs as well as legacy ramdisk. 2017-07-06 16:24:30 -07:00
virt Second batch of KVM updates for v4.13 2017-07-15 10:18:16 -07:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore kbuild: Add support to generate LLVM assembly files 2017-04-25 08:13:52 +09:00
.mailmap power supply and reset changes for the v4.12 series (part 2) 2017-05-12 12:02:21 -07:00
COPYING
CREDITS avr32: remove support for AVR32 architecture 2017-05-01 09:27:15 +02:00
Kbuild kbuild: Consolidate header generation from ASM offset information 2017-04-13 05:43:37 +09:00
Kconfig
MAINTAINERS Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2017-07-15 10:59:54 -07:00
Makefile Linux v4.13-rc1 2017-07-15 15:22:10 -07:00
README

Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.