mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] hwmon: (applesmc) Shorten minimum wait time
@ 2012-07-09 10:10 Henrik Rydberg
  2012-07-09 14:07 ` [lm-sensors] " Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Henrik Rydberg @ 2012-07-09 10:10 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Jean Delvare, lm-sensors, linux-kernel, Henrik Rydberg

The 2012 series of MacBooks have a faster SMC, and the current driver
timings do not work at all. Tests show that decreasing the minimum
wait time, from 64 us to 16 us, works well. Since this is still larger
than the original minimum of 10 us used before 2008, there is nothing
inherently problematic with changing it. The fail frequency on older
machines seems to increase slightly, but not enough to be noticeable.

Tested on MBA11, MBA31, MBA5,2, MBP9,2.

The patch was originally written by adamski99 (ubuntuforums.org) and
later tested by janhouse (bbs.archlinux.org).

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
Hi Guenter,

This patch enables the mid-2012 MacBook models. The patch affects
older models slightly, but mostly in a good way; all models get
slightly faster reads, but some older models see a slight increase in
read fail frequency. I do not think this will be noticeable, but I
would hesitate to backport too far. For 3.6.

Thanks,
Henrik

 drivers/hwmon/applesmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 0162f55..f41585e 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -54,7 +54,7 @@
 #define APPLESMC_MAX_DATA_LENGTH 32
 
 /* wait up to 32 ms for a status change. */
-#define APPLESMC_MIN_WAIT	0x0040
+#define APPLESMC_MIN_WAIT	0x0010
 #define APPLESMC_MAX_WAIT	0x8000
 
 #define APPLESMC_STATUS_MASK	0x0f
-- 
1.7.11.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-09 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-09 10:10 [PATCH] hwmon: (applesmc) Shorten minimum wait time Henrik Rydberg
2012-07-09 14:07 ` [lm-sensors] " Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®