From: Henrik Rydberg Date: Sun, 19 Oct 2008 03:27:39 +0000 (-0700) Subject: hwmon: applesmc: prolong status wait X-Git-Tag: MMI-PSA29.97-13-9~31282 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=02fcbd144d684167aa67b1d3ad68f18d265f2d08;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Cc: Nicolas Boichat Cc: Riki Oktarianto Cc: Mark M. Hoffman Cc: Jean Delvare Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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; 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. */ @@ -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