| ec7b4511 | 21-Oct-2022 |
Shuah Khan <[email protected]> |
selftests/watchdog: add test for WDIOC_GETTEMP
Add test for WDIOC_GETTEMP and this ioctl might not be supported by some devices and if it is this test will print the following message:
Inappropriat
selftests/watchdog: add test for WDIOC_GETTEMP
Add test for WDIOC_GETTEMP and this ioctl might not be supported by some devices and if it is this test will print the following message:
Inappropriate ioctl for device
Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| ce3a6778 | 17-Sep-2019 |
George G. Davis <[email protected]> |
selftests: watchdog: Add command line option to show watchdog_info
With the new ioctl(WDIOC_GETSUPPORT) call in place, add a command line option to show the watchdog_info.
Suggested-by: Eugeniu Ros
selftests: watchdog: Add command line option to show watchdog_info
With the new ioctl(WDIOC_GETSUPPORT) call in place, add a command line option to show the watchdog_info.
Suggested-by: Eugeniu Rosca <[email protected]> Signed-off-by: George G. Davis <[email protected]> Signed-off-by: Eugeniu Rosca <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 0ca2923e | 13-Dec-2018 |
Colin Ian King <[email protected]> |
selftests: watchdog: fix spelling mistake "experies" -> "expires"
There is a spelling mistake in the --gettimeleft help text, fix it.
Signed-off-by: Colin Ian King <[email protected]> Signed
selftests: watchdog: fix spelling mistake "experies" -> "expires"
There is a spelling mistake in the --gettimeleft help text, fix it.
Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| d89d08ff | 26-Sep-2018 |
Shuah Khan (Samsung OSG) <[email protected]> |
selftests: watchdog: Fix ioctl SET* error paths to take oneshot exit path
When ioctls for WDIOC_SETOPTIONS (WDIOS_DISABLECARD or WDIOS_ENABLECARD), WDIOC_SETTIMEOUT, and WDIOC_SETPRETIMEOUT fail, th
selftests: watchdog: Fix ioctl SET* error paths to take oneshot exit path
When ioctls for WDIOC_SETOPTIONS (WDIOS_DISABLECARD or WDIOS_ENABLECARD), WDIOC_SETTIMEOUT, and WDIOC_SETPRETIMEOUT fail, the error path continues to handler watchdog timer until user terminates it. When ioctl returns error, it might not be safe to let the watchdog tick. The error could be due an unsupported ioctl command or some other error.
Fix it to handle error paths as oneshot to stop the watchdog ticks and exit right away.
Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
show more ...
|
| 7514c39c | 26-Sep-2018 |
Jerry Hoemann <[email protected]> |
selftests: watchdog: Add gettimeout and get|set pretimeout
Add command line arguments to call ioctl WDIOC_GETTIMEOUT, WDIOC_GETPRETIMEOUT and WDIOC_SETPRETIMEOUT.
Signed-off-by: Jerry Hoemann <jerr
selftests: watchdog: Add gettimeout and get|set pretimeout
Add command line arguments to call ioctl WDIOC_GETTIMEOUT, WDIOC_GETPRETIMEOUT and WDIOC_SETPRETIMEOUT.
Signed-off-by: Jerry Hoemann <[email protected]> Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
show more ...
|
| a3d6d79f | 01-Jul-2017 |
Eugeniu Rosca <[email protected]> |
selftests: watchdog: get boot reason via WDIOC_GETBOOTSTATUS
Some watchdog drivers implement WDIOF_CARDRESET feature. As example, see commit b6ef36d2c1e3 ("watchdog: qcom: Report reboot reason"). Th
selftests: watchdog: get boot reason via WDIOC_GETBOOTSTATUS
Some watchdog drivers implement WDIOF_CARDRESET feature. As example, see commit b6ef36d2c1e3 ("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 <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| f8f92c07 | 01-Jul-2017 |
Eugeniu Rosca <[email protected]> |
selftests: watchdog: avoid keepalive flood
Calling `watchdog-test [options] -p 0` results in flooding the kernel with WDIOC_KEEPALIVE. Fix this by enforcing 1 second as minimal/default keepalive/pin
selftests: watchdog: avoid keepalive flood
Calling `watchdog-test [options] -p 0` results in flooding the kernel with WDIOC_KEEPALIVE. Fix this by enforcing 1 second as minimal/default keepalive/ping rate.
Signed-off-by: Eugeniu Rosca <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 7a5e10d4 | 01-Jul-2017 |
Eugeniu Rosca <[email protected]> |
selftests: watchdog: prefer strtoul() over atoi()
commit f15d7114bbdd ("Documentation/watchdog: add timeout and ping rate control to watchdog-test.c") used both atoi() and strtoul() for string to in
selftests: watchdog: prefer strtoul() over atoi()
commit f15d7114bbdd ("Documentation/watchdog: add timeout and ping rate control to watchdog-test.c") used both atoi() and strtoul() for string to integer conversion. As usage of atoi() is discouraged in newer code, replace it with strtoul() for consistency.
Signed-off-by: Eugeniu Rosca <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 749fb263 | 01-Jul-2017 |
Eugeniu Rosca <[email protected]> |
selftests: watchdog: use getopt_long()
Switch from manual argv[] parsing to getopt_long() argument processing. This creates more readable code and allows easier feature addition. This also fixes som
selftests: watchdog: use getopt_long()
Switch from manual argv[] parsing to getopt_long() argument processing. This creates more readable code and allows easier feature addition. This also fixes some segmentation faults introduced by commit 1dbdcc810928 ("selftests: watchdog: accept multiple params on command line"), when options -t or -p are not given the required value:
./watchdog-test -p 1 -t ./watchdog-test -t 1 -p
No changes are intended in the way watchdog-test interacts with the kernel. The only noticible changes, tightly related to the addition of getopt (and done for easier maintenance), are: - help message has been reworked and migrated to a dedicated function. - all short/long options and the help message are sorted alphabetically. - all case statements inside the getopt loop are sorted alphabetically.
Fixes: 1dbdcc810928 ("selftests: watchdog: accept multiple params on command line") Signed-off-by: Eugeniu Rosca <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|