From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paulo Zanoni Subject: [PATCH 1/6] drm/i915: grab force_wake when restoring LCPLL Date: Mon, 19 Aug 2013 16:01:13 -0300 Message-ID: <1376938873-3692-1-git-send-email-przanoni@gmail.com> References: <20130819182541.GC7784@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-yh0-f52.google.com (mail-yh0-f52.google.com [209.85.213.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 00E15E6633 for ; Mon, 19 Aug 2013 12:01:32 -0700 (PDT) Received: by mail-yh0-f52.google.com with SMTP id f11so919828yha.25 for ; Mon, 19 Aug 2013 12:01:32 -0700 (PDT) In-Reply-To: <20130819182541.GC7784@nuc-i3427.alporthouse.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 Cc: Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org From: Paulo Zanoni If LCPLL is disabled, there's a chance we might be in package C8 state or deeper, and we'll get a hard hang when restoring LCPLL (also, a red led lights up on my motherboard). So grab the force_wake, which will get us out of RC6 and, as a consequence, out of PC8+ (since we need RC6 to get into PC8+). v2: Call the correct force_wake interface. Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_display.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 00114a5..ef22161 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6031,6 +6031,10 @@ void hsw_restore_lcpll(struct drm_i915_private *dev_priv) LCPLL_POWER_DOWN_ALLOW)) == LCPLL_PLL_LOCK) return; + /* Make sure we're not on PC8 state before disabling PC8, otherwise + * we'll hang the machine! */ + gen6_gt_force_wake_get(dev_priv); + if (val & LCPLL_POWER_DOWN_ALLOW) { val &= ~LCPLL_POWER_DOWN_ALLOW; I915_WRITE(LCPLL_CTL, val); @@ -6058,6 +6062,8 @@ void hsw_restore_lcpll(struct drm_i915_private *dev_priv) LCPLL_CD_SOURCE_FCLK_DONE) == 0, 1)) DRM_ERROR("Switching back to LCPLL failed\n"); } + + gen6_gt_force_wake_put(dev_priv); } static void haswell_modeset_global_resources(struct drm_device *dev) -- 1.8.1.2