From: sagar.a.kamble@intel.com Subject: [PATCH 2/2] drm/i915/vlv: Set D3_hot for vlv during runtime_suspend Date: Tue, 10 Jun 2014 00:27:30 +0530 Message-ID: <1402340250-3909-3-git-send-email-sagar.a.kamble@intel.com> References: <1402340250-3909-1-git-send-email-sagar.a.kamble@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id D501D6E5D9 for ; Mon, 9 Jun 2014 11:56:36 -0700 (PDT) In-Reply-To: <1402340250-3909-1-git-send-email-sagar.a.kamble@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org Cc: Daniel Vetter , sagar.a.kamble@intel.com, shashidhar.hiremath@intel.com List-Id: intel-gfx@lists.freedesktop.org From: Sagar Kamble To do a platform wide S0i3 transition, Gfx is required to go to D3_hot state. pci_save_state and pci_restore_state needed to avoid ring hangs across D3_hot transitions. Cc: Daniel Vetter (supporter:INTEL DRM DRIVERS...) Cc: Jani Nikula (supporter:INTEL DRM DRIVERS...) Signed-off-by: Sagar Kamble --- drivers/gpu/drm/i915/i915_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 5a08c86..70bb456 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -1412,6 +1412,11 @@ static int intel_runtime_suspend(struct device *device) * via the suspend path. */ intel_opregion_notify_adapter(dev, PCI_D1); + if (IS_VALLEYVIEW(dev)) { + pci_save_state(pdev); + pci_disable_device(pdev); + pci_set_power_state(pdev, PCI_D3hot); + } DRM_DEBUG_KMS("Device suspended\n"); return 0; @@ -1428,6 +1433,12 @@ static int intel_runtime_resume(struct device *device) DRM_DEBUG_KMS("Resuming device\n"); + if (IS_VALLEYVIEW(dev)) { + pci_set_power_state(pdev, PCI_D0); + pci_restore_state(pdev); + pci_enable_device(pdev); + } + intel_opregion_notify_adapter(dev, PCI_D0); dev_priv->pm.suspended = false; -- 1.8.5