summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_uc.c
diff options
context:
space:
mode:
authorChris Wilson2019-05-02 22:30:09 +0200
committerChris Wilson2019-05-03 09:38:37 +0200
commit818f5cb3e8fb386609f7d3c751f195dd3050d22d (patch)
tree3158db6fc299b813fb67e221c80afe1f22750774 /drivers/gpu/drm/i915/intel_uc.c
parentdrm/i915: extract intel_gmbus.h from i915_drv.h and rename intel_i2c.c (diff)
downloadkernel-qcow2-linux-818f5cb3e8fb386609f7d3c751f195dd3050d22d.tar.gz
kernel-qcow2-linux-818f5cb3e8fb386609f7d3c751f195dd3050d22d.tar.xz
kernel-qcow2-linux-818f5cb3e8fb386609f7d3c751f195dd3050d22d.zip
drm/i915/guc: Fix runtime suspend
We are not allowed to rpm_get() inside the runtime-suspend callback, so split the intel_uc_suspend() into the core that assumes the caller holds the wakeref (intel_uc_runtime_suspend), and one that acquires the wakeref as necessary (intel_uc_suspend). Reported-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Fixes: 79ffac8599c4 ("drm/i915: Invert the GEM wakeref hierarchy") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190502203009.15727-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_uc.c')
-rw-r--r--drivers/gpu/drm/i915/intel_uc.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 01ea36e3150c..1ee70df51627 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -481,22 +481,31 @@ void intel_uc_reset_prepare(struct drm_i915_private *i915)
intel_uc_sanitize(i915);
}
-void intel_uc_suspend(struct drm_i915_private *i915)
+void intel_uc_runtime_suspend(struct drm_i915_private *i915)
{
struct intel_guc *guc = &i915->guc;
- intel_wakeref_t wakeref;
int err;
if (guc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
return;
- with_intel_runtime_pm(i915, wakeref) {
- err = intel_guc_suspend(guc);
- if (err)
- DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);
+ err = intel_guc_suspend(guc);
+ if (err)
+ DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);
- guc_disable_communication(guc);
- }
+ guc_disable_communication(guc);
+}
+
+void intel_uc_suspend(struct drm_i915_private *i915)
+{
+ struct intel_guc *guc = &i915->guc;
+ intel_wakeref_t wakeref;
+
+ if (guc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
+ return;
+
+ with_intel_runtime_pm(i915, wakeref)
+ intel_uc_runtime_suspend(i915);
}
int intel_uc_resume(struct drm_i915_private *i915)