Skip to content

Commit 4b9e038

Browse files
pelwellpopcornmix
authored andcommitted
watchdog: Reduce severity of release without stop
Distinguish between releasing the watchdog without requesting that it is stopped, and failing to stop it when requested. The former is standard behaviour for systemd, while the latter may be unexpected. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent ae8cb0d commit 4b9e038

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/watchdog/watchdog_dev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ static int watchdog_release(struct inode *inode, struct file *file)
943943
{
944944
struct watchdog_core_data *wd_data = file->private_data;
945945
struct watchdog_device *wdd;
946-
int err = -EBUSY;
946+
int err = EBUSY; /* +ve because this may be expected behaviour */
947947
bool running;
948948

949949
mutex_lock(&wd_data->lock);
@@ -967,6 +967,9 @@ static int watchdog_release(struct inode *inode, struct file *file)
967967
if (err < 0) {
968968
pr_crit("watchdog%d: watchdog did not stop!\n", wdd->id);
969969
watchdog_ping(wdd);
970+
} else if (err > 0) {
971+
pr_info("watchdog%d: watchdog left running\n", wdd->id);
972+
watchdog_ping(wdd);
970973
}
971974

972975
watchdog_update_worker(wdd);

0 commit comments

Comments
 (0)