From patchwork Sun Jul 14 16:30:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 2827634 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 AF6E6C0AB2 for ; Mon, 15 Jul 2013 15:37:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A325320108 for ; Mon, 15 Jul 2013 15:37:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 88310200EA for ; Mon, 15 Jul 2013 15:37:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F411E622B for ; Mon, 15 Jul 2013 08:37:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by gabe.freedesktop.org (Postfix) with ESMTP id F3C6AE5DC8; Sun, 14 Jul 2013 09:30:16 -0700 (PDT) Received: by mail-lb0-f170.google.com with SMTP id t13so8914240lbd.15 for ; Sun, 14 Jul 2013 09:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:from:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=2/I2i8cAwEm1DZBr2R5rW3jWZM3T/RgNSwiC8/Jiwbo=; b=dmbvKvVnbKvaHau5U83uAlsO9ZLPdvi2MjOKjzPjNmpGB9AEmCFQdfcPdPoVfI1FWj K8JIoszYPYl7tL4UgMeBkXFLTGNZP3acJKDu6qR3ntSCdYrDe/9MRHORHV8DmOM8MfYc /ar9vY4TiK3zCEDODbOZNlx18difWym+JHD/DB3AntoP4KJlSpYwyQGhWfkB/FutCAhW dJG7mqO5B3U40yiF0k/pz03KuUxrX6OiyXLDkiOB9fbQnKGmYQ1Ji6kCEs2XeJVdlKR0 Yo1b4yrNOht4NSF38hRKVu3SremTi0S6MSb61Ou8WIyAosaFYSc0MxDcl4lxGuUV++dJ qGlA== X-Received: by 10.112.143.162 with SMTP id sf2mr2141953lbb.1.1373819415731; Sun, 14 Jul 2013 09:30:15 -0700 (PDT) Received: from localhost (95-28-160-250.broadband.corbina.ru. [95.28.160.250]) by mx.google.com with ESMTPSA id p17sm1094285lbv.11.2013.07.14.09.30.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 14 Jul 2013 09:30:14 -0700 (PDT) To: David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chris Wilson From: Konstantin Khlebnikov Date: Sun, 14 Jul 2013 20:30:09 +0400 Message-ID: <20130714163009.22374.22100.stgit@zurg> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 15 Jul 2013 08:37:46 -0700 Subject: [Intel-gfx] [PATCH] drm/i915: fix long-standing SNB regression in power consumption after resume 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: , 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=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 This patch fixes regression in power consumtion of sandy bridge gpu, which exists since v3.6 Sometimes after resuming from s2ram gpu starts thinking that it's extremely busy. After that it never reaches rc6 state. Bug was introduce by commit b4ae3f22d238617ca11610b29fde16cf8c0bc6e0 ("drm/i915: load boot context at driver init time"). Without documentation it's not clear what is happening here, probably this breaks internal state of hardware ring buffers and confuses RPS engine. Fortunately keeping forcewake during whole initialization sequence in gen6_init_clock_gating() fixes this bug. References: https://bugs.freedesktop.org/show_bug.cgi?id=54089 Signed-off-by: Konstantin Khlebnikov Tested-by: Alexander Kaltsas Tested-by: rocko Tested-by: JohnMB --- drivers/gpu/drm/i915/intel_pm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index aa01128..839a43f 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -3640,6 +3640,8 @@ static void gen6_init_clock_gating(struct drm_device *dev) int pipe; uint32_t dspclk_gate = ILK_VRHUNIT_CLOCK_GATE_DISABLE; + gen6_gt_force_wake_get(dev_priv); + I915_WRITE(ILK_DSPCLK_GATE_D, dspclk_gate); I915_WRITE(ILK_DISPLAY_CHICKEN2, @@ -3728,6 +3730,8 @@ static void gen6_init_clock_gating(struct drm_device *dev) cpt_init_clock_gating(dev); gen6_check_mch_setup(dev); + + gen6_gt_force_wake_put(dev_priv); } static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)