1 From 7646ea88af80a92f2775e17d4283830d7f09ea2d Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Sun, 11 Jan 2009 03:01:04 -0200
4 Subject: ACPI: thinkpad-acpi: use killable instead of interruptible mutexes
6 Unfortunately, POSIX in all of its braindamage, do not state that userspace has
7 to deal with EINTR in read/write and friends... so, lesser code just doesn't.
9 Switch from *_interruptible to *_killable on the sysfs- and procfs-related
10 mutexes. This closes this possible can of worms.
12 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
13 Signed-off-by: Len Brown <len.brown@intel.com>
15 drivers/platform/x86/thinkpad_acpi.c | 26 +++++++++++++-------------
16 1 files changed, 13 insertions(+), 13 deletions(-)
18 diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
19 index c1d4041..7670c8e 100644
20 --- a/drivers/platform/x86/thinkpad_acpi.c
21 +++ b/drivers/platform/x86/thinkpad_acpi.c
22 @@ -1878,7 +1878,7 @@ static ssize_t hotkey_mask_show(struct device *dev,
26 - if (mutex_lock_interruptible(&hotkey_mutex))
27 + if (mutex_lock_killable(&hotkey_mutex))
29 res = hotkey_mask_get();
30 mutex_unlock(&hotkey_mutex);
31 @@ -1897,7 +1897,7 @@ static ssize_t hotkey_mask_store(struct device *dev,
32 if (parse_strtoul(buf, 0xffffffffUL, &t))
35 - if (mutex_lock_interruptible(&hotkey_mutex))
36 + if (mutex_lock_killable(&hotkey_mutex))
39 res = hotkey_mask_set(t);
40 @@ -1983,7 +1983,7 @@ static ssize_t hotkey_source_mask_store(struct device *dev,
41 ((t & ~TPACPI_HKEY_NVRAM_KNOWN_MASK) != 0))
44 - if (mutex_lock_interruptible(&hotkey_mutex))
45 + if (mutex_lock_killable(&hotkey_mutex))
48 HOTKEY_CONFIG_CRITICAL_START
49 @@ -2018,7 +2018,7 @@ static ssize_t hotkey_poll_freq_store(struct device *dev,
50 if (parse_strtoul(buf, 25, &t))
53 - if (mutex_lock_interruptible(&hotkey_mutex))
54 + if (mutex_lock_killable(&hotkey_mutex))
58 @@ -2754,7 +2754,7 @@ static int hotkey_read(char *p)
62 - if (mutex_lock_interruptible(&hotkey_mutex))
63 + if (mutex_lock_killable(&hotkey_mutex))
65 res = hotkey_status_get(&status);
67 @@ -2785,7 +2785,7 @@ static int hotkey_write(char *buf)
68 if (!tp_features.hotkey)
71 - if (mutex_lock_interruptible(&hotkey_mutex))
72 + if (mutex_lock_killable(&hotkey_mutex))
76 @@ -5311,7 +5311,7 @@ static int brightness_set(int value)
80 - res = mutex_lock_interruptible(&brightness_mutex);
81 + res = mutex_lock_killable(&brightness_mutex);
85 @@ -5849,7 +5849,7 @@ static int fan_get_status_safe(u8 *status)
89 - if (mutex_lock_interruptible(&fan_mutex))
90 + if (mutex_lock_killable(&fan_mutex))
92 rc = fan_get_status(&s);
94 @@ -5932,7 +5932,7 @@ static int fan_set_level_safe(int level)
95 if (!fan_control_allowed)
98 - if (mutex_lock_interruptible(&fan_mutex))
99 + if (mutex_lock_killable(&fan_mutex))
102 if (level == TPACPI_FAN_LAST_LEVEL)
103 @@ -5954,7 +5954,7 @@ static int fan_set_enable(void)
104 if (!fan_control_allowed)
107 - if (mutex_lock_interruptible(&fan_mutex))
108 + if (mutex_lock_killable(&fan_mutex))
111 switch (fan_control_access_mode) {
112 @@ -6009,7 +6009,7 @@ static int fan_set_disable(void)
113 if (!fan_control_allowed)
116 - if (mutex_lock_interruptible(&fan_mutex))
117 + if (mutex_lock_killable(&fan_mutex))
121 @@ -6047,7 +6047,7 @@ static int fan_set_speed(int speed)
122 if (!fan_control_allowed)
125 - if (mutex_lock_interruptible(&fan_mutex))
126 + if (mutex_lock_killable(&fan_mutex))
130 @@ -6249,7 +6249,7 @@ static ssize_t fan_pwm1_store(struct device *dev,
131 /* scale down from 0-255 to 0-7 */
132 newlevel = (s >> 5) & 0x07;
134 - if (mutex_lock_interruptible(&fan_mutex))
135 + if (mutex_lock_killable(&fan_mutex))
138 rc = fan_get_status(&status);