| From 3dd012f943c1fde747737e4792da2c9a8721ad79 Mon Sep 17 00:00:00 2001 |
| From: Paulo Zanoni <paulo.r.zanoni@intel.com> |
| Date: Mon, 19 Aug 2013 13:18:07 -0300 |
| Subject: drm/i915: grab force_wake when restoring LCPLL |
| |
| 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+). |
| |
| Note: Discussions with hw designers are still ongoing what exactly |
| goes boom here. But I think we can go ahead and just merge this little |
| hack for now until it's clear what we actually need. |
| |
| Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> |
| [danvet: Add small note about the current state of the discussion |
| around this hack.] |
| Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> |
| |
| (cherry picked from commit 215733fadb87709e91b3a622d786865292c9ab11) |
| Signed-off-by: Darren Hart <dvhart@linux.intel.com> |
| --- |
| 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 0426c92a4c18..d46f554c2a9e 100644 |
| --- a/drivers/gpu/drm/i915/intel_display.c |
| +++ b/drivers/gpu/drm/i915/intel_display.c |
| @@ -6033,6 +6033,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! */ |
| + dev_priv->uncore.funcs.force_wake_get(dev_priv); |
| + |
| if (val & LCPLL_POWER_DOWN_ALLOW) { |
| val &= ~LCPLL_POWER_DOWN_ALLOW; |
| I915_WRITE(LCPLL_CTL, val); |
| @@ -6060,6 +6064,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"); |
| } |
| + |
| + dev_priv->uncore.funcs.force_wake_put(dev_priv); |
| } |
| |
| static void haswell_modeset_global_resources(struct drm_device *dev) |
| -- |
| 1.8.5.rc3 |
| |