aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/watchdog
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-05-22 05:40:26 -0400
committerWim Van Sebroeck <wim@iguana.be>2012-05-30 01:55:23 -0400
commitf4e9c82f64b524314a390b13d3ba7d483f09258f (patch)
tree82d688ae7782234dc01c6a340596bac21531aae4 /Documentation/watchdog
parent7a87982420e5e126bfefeb42232d1fd92052794e (diff)
watchdog: Add Locking support
This patch fixes some potential multithreading issues, despite only allowing one process to open the /dev/watchdog device, we can still get called multiple times at the same time, since a program could be using thread, or could share the fd after a fork. This causes 2 potential problems: 1) watchdog_start / open do an unlocked test_n_set / test_n_clear, if these 2 race, the watchdog could be stopped while the active bit indicates it is running or visa versa. 2) Most watchdog_dev drivers probably assume that only one watchdog-op will get called at a time, this is not necessary true atm. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'Documentation/watchdog')
-rw-r--r--Documentation/watchdog/watchdog-kernel-api.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt
index ce1fa22aa70b..08d34e11bc54 100644
--- a/Documentation/watchdog/watchdog-kernel-api.txt
+++ b/Documentation/watchdog/watchdog-kernel-api.txt
@@ -50,6 +50,7 @@ struct watchdog_device {
50 unsigned int min_timeout; 50 unsigned int min_timeout;
51 unsigned int max_timeout; 51 unsigned int max_timeout;
52 void *driver_data; 52 void *driver_data;
53 struct mutex lock;
53 unsigned long status; 54 unsigned long status;
54}; 55};
55 56
@@ -74,6 +75,7 @@ It contains following fields:
74* driver_data: a pointer to the drivers private data of a watchdog device. 75* driver_data: a pointer to the drivers private data of a watchdog device.
75 This data should only be accessed via the watchdog_set_drvdata and 76 This data should only be accessed via the watchdog_set_drvdata and
76 watchdog_get_drvdata routines. 77 watchdog_get_drvdata routines.
78* lock: Mutex for WatchDog Timer Driver Core internal use only.
77* status: this field contains a number of status bits that give extra 79* status: this field contains a number of status bits that give extra
78 information about the status of the device (Like: is the watchdog timer 80 information about the status of the device (Like: is the watchdog timer
79 running/active, is the nowayout bit set, is the device opened via 81 running/active, is the nowayout bit set, is the device opened via