diff mbox

[3/4] drm/i915: Detect and clear unclaimed access on resume

Message ID 1449674007-11876-1-git-send-email-mika.kuoppala@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kuoppala Dec. 9, 2015, 3:13 p.m. UTC
If something, the usual suspect being bios, access hw
behind our back, dont let it slide into situation where
normal register access will detect this and spit out
a warn on into dmesg. On some bdw bioses this happens
during igt/bat run always and as there is not much we can
do about it, its better just to detect and flush this
explicitly on resume and only print a debug message.

v2: use DRM_DEBUG_DRIVER (Chris)

Testcase: igt/pm_rpm/basic-rte
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Paulo Zanoni <przanoni@gmail.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Chris Wilson Dec. 9, 2015, 3:21 p.m. UTC | #1
On Wed, Dec 09, 2015 at 05:13:27PM +0200, Mika Kuoppala wrote:
> If something, the usual suspect being bios, access hw
> behind our back, dont let it slide into situation where
> normal register access will detect this and spit out
> a warn on into dmesg. On some bdw bioses this happens
> during igt/bat run always and as there is not much we can
> do about it, its better just to detect and flush this
> explicitly on resume and only print a debug message.
> 
> v2: use DRM_DEBUG_DRIVER (Chris)
> 
> Testcase: igt/pm_rpm/basic-rte
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Paulo Zanoni <przanoni@gmail.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index e6935f1..eb6d8c5 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1477,6 +1477,9 @@ static int intel_runtime_suspend(struct device *device)
>  
>  	cancel_delayed_work_sync(&dev_priv->gpu_error.hangcheck_work);
>  	intel_uncore_forcewake_reset(dev, false);
> +	if (intel_uncore_unclaimed_access(dev))
> +		DRM_ERROR("Unclaimed access detected prior suspending\n");

s/prior/prior to/
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index e6935f1..eb6d8c5 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1477,6 +1477,9 @@  static int intel_runtime_suspend(struct device *device)
 
 	cancel_delayed_work_sync(&dev_priv->gpu_error.hangcheck_work);
 	intel_uncore_forcewake_reset(dev, false);
+	if (intel_uncore_unclaimed_access(dev))
+		DRM_ERROR("Unclaimed access detected prior suspending\n");
+
 	dev_priv->pm.suspended = true;
 
 	/*
@@ -1522,6 +1525,8 @@  static int intel_runtime_resume(struct device *device)
 
 	intel_opregion_notify_adapter(dev, PCI_D0);
 	dev_priv->pm.suspended = false;
+	if (intel_uncore_unclaimed_access(dev))
+		DRM_DEBUG_DRIVER("Unclaimed access during suspend, bios?\n");
 
 	intel_guc_resume(dev);