diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2007-04-24 10:48:15 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-04-25 02:00:27 -0400 |
commit | 40ca9fdf8aa7d929e2b8939be1e6380d107381e1 (patch) | |
tree | 285d9e5a577b87064ecb06ee7aea46e206d1a3ac /drivers/misc/thinkpad_acpi.h | |
parent | 7252374a39d794879f5e47bcfa0a16e7599b27b5 (diff) |
ACPI: thinkpad-acpi: protect fan and hotkey data structures
Add proper mutex locking to some data structures access subject to races
due to concurrent access of driver functions on the hotkey and fan
subdrivers.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/thinkpad_acpi.h')
-rw-r--r-- | drivers/misc/thinkpad_acpi.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index 84fdefe0d200..a9feb53c6d3c 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/string.h> | 31 | #include <linux/string.h> |
32 | #include <linux/list.h> | 32 | #include <linux/list.h> |
33 | #include <linux/mutex.h> | ||
33 | 34 | ||
34 | #include <linux/proc_fs.h> | 35 | #include <linux/proc_fs.h> |
35 | #include <linux/sysfs.h> | 36 | #include <linux/sysfs.h> |
@@ -375,6 +376,8 @@ static enum fan_control_commands fan_control_commands; | |||
375 | static u8 fan_control_initial_status; | 376 | static u8 fan_control_initial_status; |
376 | static int fan_watchdog_maxinterval; | 377 | static int fan_watchdog_maxinterval; |
377 | 378 | ||
379 | struct mutex fan_mutex; | ||
380 | |||
378 | static acpi_handle fans_handle, gfan_handle, sfan_handle; | 381 | static acpi_handle fans_handle, gfan_handle, sfan_handle; |
379 | 382 | ||
380 | static int fan_init(struct ibm_init_struct *iibm); | 383 | static int fan_init(struct ibm_init_struct *iibm); |
@@ -403,6 +406,8 @@ static int fan_write_cmd_watchdog(const char *cmd, int *rc); | |||
403 | static int hotkey_orig_status; | 406 | static int hotkey_orig_status; |
404 | static int hotkey_orig_mask; | 407 | static int hotkey_orig_mask; |
405 | 408 | ||
409 | static struct mutex hotkey_mutex; | ||
410 | |||
406 | static int hotkey_init(struct ibm_init_struct *iibm); | 411 | static int hotkey_init(struct ibm_init_struct *iibm); |
407 | static void hotkey_exit(void); | 412 | static void hotkey_exit(void); |
408 | static int hotkey_get(int *status, int *mask); | 413 | static int hotkey_get(int *status, int *mask); |