From patchwork Thu Aug 9 15:23:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 176176 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 112222C00E2 for ; Fri, 10 Aug 2012 01:24:01 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SzUaU-0007xX-Rx; Thu, 09 Aug 2012 15:23:50 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SzUaS-0007xR-PA for kernel-team@lists.ubuntu.com; Thu, 09 Aug 2012 15:23:48 +0000 Received: from 64-126-113-183.dyn.everestkc.net ([64.126.113.183] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SzUaS-0003ft-Gg for kernel-team@lists.ubuntu.com; Thu, 09 Aug 2012 15:23:48 +0000 From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [Quantal][PATCH 1/2] hwmon: (applesmc) Shorten minimum wait time Date: Thu, 9 Aug 2012 10:23:37 -0500 Message-Id: <1344525818-27653-2-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344525818-27653-1-git-send-email-seth.forshee@canonical.com> References: <1344525818-27653-1-git-send-email-seth.forshee@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: 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 Signed-off-by: Guenter Roeck (cherry picked from commit a332bf9a65ab34b01226ed177f6937af843c8465) BugLink: http://bugs.launchpad.net/bugs/1034449 Signed-off-by: Seth Forshee --- 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 2cde9ec..745bd41 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