From patchwork Fri Aug 16 00:30:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Ausmus X-Patchwork-Id: 2845315 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 65E17BF546 for ; Fri, 16 Aug 2013 00:38:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 874D9202AE for ; Fri, 16 Aug 2013 00:38:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A8361202A1 for ; Fri, 16 Aug 2013 00:38:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADD39E83CC for ; Thu, 15 Aug 2013 17:38:18 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 15 Aug 2013 17:31:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,889,1367996400"; d="scan'208";a="387901466" Received: from jausmus-gentoo-dev5.jf.intel.com ([10.7.198.60]) by orsmga002.jf.intel.com with ESMTP; 15 Aug 2013 17:31:57 -0700 From: james.ausmus@intel.com To: intel-gfx@lists.freedesktop.org Date: Thu, 15 Aug 2013 17:30:59 -0700 Message-Id: <1376613069-15790-35-git-send-email-james.ausmus@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1376613069-15790-1-git-send-email-james.ausmus@intel.com> References: <1376613069-15790-1-git-send-email-james.ausmus@intel.com> Subject: [Intel-gfx] [PATCH] CHROMIUM: drm/i915/intel_drv: reduce wait_for polling time X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(); \ } \