From patchwork Sun Sep 2 05:59:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 1396291 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 854D7DF283 for ; Sun, 2 Sep 2012 08:18:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A1A849E7E1 for ; Sun, 2 Sep 2012 01:18:29 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.chad-versace.us (209-20-75-48.static.cloud-ips.com [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 732D69E835 for ; Sat, 1 Sep 2012 23:00:14 -0700 (PDT) Received: by shiva.chad-versace.us (Postfix, from userid 1005) id 08A68885D3; Sun, 2 Sep 2012 06:00:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on shiva.chad-versace.us X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.2 Received: from stallone.kumite (static-50-53-63-81.bvtn.or.frontiernet.net [50.53.63.81]) by shiva.chad-versace.us (Postfix) with ESMTPSA id 95A28885D0; Sun, 2 Sep 2012 06:00:24 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Sat, 1 Sep 2012 22:59:48 -0700 Message-Id: <1346565590-1760-2-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1346565590-1760-1-git-send-email-ben@bwidawsk.net> References: <1346565590-1760-1-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 2/4] drm/i915: use cpu_relax() in wait_for_atomic 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 As part of the advice given to us from the hardware designers regarding the maximum wait time on the forcewake handshake we need to move from us granularity to ms granularity. In earlier patches to do this, Jani noticed that wait_for_us was properly converted to use cpu_relax(), but wait_for was not. The issue has existed since the introduction of the macro: commit 913d8d110078788c14812dce8bb62c37946821d2 Author: Chris Wilson Date: Sat Aug 7 11:01:35 2010 +0100 drm/i915: Ensure that while(INREG()) are bounded (v2) CC: Jani Nikula Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/intel_drv.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 95f635b..1707de5 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -41,7 +41,11 @@ ret__ = -ETIMEDOUT; \ break; \ } \ - if (W && drm_can_sleep()) msleep(W); \ + if (W && drm_can_sleep()) { \ + msleep(W); \ + } else { \ + cpu_relax(); \ + } \ } \ ret__; \ })