diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2008-10-18 23:27:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 11:52:35 -0400 |
commit | 02fcbd144d684167aa67b1d3ad68f18d265f2d08 (patch) | |
tree | 78fd75f27dc9c25d3ec3f9631d4d2a943cb48315 /drivers/hwmon | |
parent | 84d2d7f2ee98dc9bd799790c89b5eb8280af2d37 (diff) |
hwmon: applesmc: prolong status wait
The time to wait for a status change while reading or writing to the SMC
ports is a balance between read reliability and system performance. The
current setting yields rougly three errors in a thousand when
simultaneously reading three different temperature values on a Macbook
Air. This patch increases the setting to a value yielding roughly one
error in ten thousand, with no noticable system performance degradation.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Cc: Nicolas Boichat <nicolas@boichat.ch>
Cc: Riki Oktarianto <rkoktarianto@gmail.com>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/applesmc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index d5bd0cadbf31..9a43c4b60ea9 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
@@ -163,7 +163,7 @@ static unsigned int key_at_index; | |||
163 | static struct workqueue_struct *applesmc_led_wq; | 163 | static struct workqueue_struct *applesmc_led_wq; |
164 | 164 | ||
165 | /* | 165 | /* |
166 | * __wait_status - Wait up to 2ms for the status port to get a certain value | 166 | * __wait_status - Wait up to 10ms for the status port to get a certain value |
167 | * (masked with 0x0f), returning zero if the value is obtained. Callers must | 167 | * (masked with 0x0f), returning zero if the value is obtained. Callers must |
168 | * hold applesmc_lock. | 168 | * hold applesmc_lock. |
169 | */ | 169 | */ |
@@ -173,7 +173,7 @@ static int __wait_status(u8 val) | |||
173 | 173 | ||
174 | val = val & APPLESMC_STATUS_MASK; | 174 | val = val & APPLESMC_STATUS_MASK; |
175 | 175 | ||
176 | for (i = 0; i < 200; i++) { | 176 | for (i = 0; i < 1000; i++) { |
177 | if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == val) { | 177 | if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == val) { |
178 | if (debug) | 178 | if (debug) |
179 | printk(KERN_DEBUG | 179 | printk(KERN_DEBUG |