From: james.ausmus@intel.com Subject: [PATCH] CHROMIUM: drm/i915/intel_drv: reduce wait_for polling time Date: Thu, 15 Aug 2013 17:30:59 -0700 Message-ID: <1376613069-15790-35-git-send-email-james.ausmus@intel.com> References: <1376613069-15790-1-git-send-email-james.ausmus@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id BB729E6025 for ; Thu, 15 Aug 2013 17:31:58 -0700 (PDT) In-Reply-To: <1376613069-15790-1-git-send-email-james.ausmus@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org From: Daniel Kurtz Currently, 400kHz i2c transactions on i915 ddc adapters are gated by long polling loops in the wait_for() macro. For the case where the polling loops sleep, make them tighter by converting a msleep(1) to usleep_range(50, 100); A better solution might be to eliminate this polling entirely, and use the i915 interrupts to detect state transitions instead of polling. Signed-off-by: Daniel Kurtz BUG=chromium:246465 TEST=i2c reads over ddc succeed. On a scope, single transactions no longer have large gaps. Change-Id: I96cef50ed8a3d0ad8a3c6fa6f079234242fa17d3 Reviewed-on: https://gerrit.chromium.org/gerrit/17937 Reviewed-by: Daniel Kurtz Tested-by: Daniel Kurtz Commit-Ready: Daniel Kurtz Reviewed-on: https://gerrit.chromium.org/gerrit/57458 Tested-by: Yufeng Shen Commit-Queue: Yufeng Shen --- drivers/gpu/drm/i915/intel_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 60ec305..9f32cfc 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -42,7 +42,7 @@ break; \ } \ if (W && drm_can_sleep()) { \ - msleep(W); \ + usleep_range(W * 50, W * 100); \ } else { \ cpu_relax(); \ } \ -- 1.8.3.2