Skip to content

Commit

Permalink
hwmon: applesmc: prolong status wait
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Henrik Rydberg authored and Linus Torvalds committed Oct 20, 2008
1 parent 84d2d7f commit 02fcbd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hwmon/applesmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static unsigned int key_at_index;
static struct workqueue_struct *applesmc_led_wq;

/*
* __wait_status - Wait up to 2ms for the status port to get a certain value
* __wait_status - Wait up to 10ms for the status port to get a certain value
* (masked with 0x0f), returning zero if the value is obtained. Callers must
* hold applesmc_lock.
*/
Expand All @@ -173,7 +173,7 @@ static int __wait_status(u8 val)

val = val & APPLESMC_STATUS_MASK;

for (i = 0; i < 200; i++) {
for (i = 0; i < 1000; i++) {
if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == val) {
if (debug)
printk(KERN_DEBUG
Expand Down

0 comments on commit 02fcbd1

Please sign in to comment.