summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_guc_log.c
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2018-03-19 12:53:36 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2018-03-19 15:23:01 +0300
commiteacd8391f977d3800cc41a026f9f81fce210a78c (patch)
tree58ef5ed9636f4808452920aefcfbb325c1a8529f /drivers/gpu/drm/i915/intel_guc_log.c
parentad260ab32a4d94fa974f58262f8000472d34fd5b (diff)
downloadlinux-eacd8391f977d3800cc41a026f9f81fce210a78c.tar.xz
drm/i915/guc: Keep GuC interrupts enabled when using GuC
The GuC log contains a separate space used for crash dump. We even get a separate notification for it. While we're not handling crash differently yet, it makes sense to decouple the two right now to simplify the following patches. v2: Move guc_log_flush_irq_disable up to avoid movement in following patches (Sagar). v3: s/guc_log_flush_irq_*/guc_flush_log_msg_*, rebase after mass rename Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com> (v2) Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20180319095348.9716-1-michal.winiarski@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_guc_log.c')
-rw-r--r--drivers/gpu/drm/i915/intel_guc_log.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_guc_log.c b/drivers/gpu/drm/i915/intel_guc_log.c
index 1c2127bc3878..1e209fcf90e1 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/intel_guc_log.c
@@ -73,6 +73,22 @@ static int guc_log_control(struct intel_guc *guc, bool enable, u32 verbosity)
return intel_guc_send(guc, action, ARRAY_SIZE(action));
}
+static void guc_flush_log_msg_enable(struct intel_guc *guc)
+{
+ spin_lock_irq(&guc->irq_lock);
+ guc->msg_enabled_mask |= INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER |
+ INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED;
+ spin_unlock_irq(&guc->irq_lock);
+}
+
+static void guc_flush_log_msg_disable(struct intel_guc *guc)
+{
+ spin_lock_irq(&guc->irq_lock);
+ guc->msg_enabled_mask &= ~(INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER |
+ INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED);
+ spin_unlock_irq(&guc->irq_lock);
+}
+
static inline struct intel_guc *log_to_guc(struct intel_guc_log *log)
{
return container_of(log, struct intel_guc, log);
@@ -709,12 +725,7 @@ int intel_guc_log_register(struct intel_guc_log *log)
if (ret)
goto err_runtime;
- /* GuC logging is currently the only user of Guc2Host interrupts */
- mutex_lock(&i915->drm.struct_mutex);
- intel_runtime_pm_get(i915);
- gen9_enable_guc_interrupts(i915);
- intel_runtime_pm_put(i915);
- mutex_unlock(&i915->drm.struct_mutex);
+ guc_flush_log_msg_enable(guc);
return 0;
@@ -733,6 +744,8 @@ void intel_guc_log_unregister(struct intel_guc_log *log)
struct intel_guc *guc = log_to_guc(log);
struct drm_i915_private *i915 = guc_to_i915(guc);
+ guc_flush_log_msg_disable(guc);
+
/*
* Once logging is disabled, GuC won't generate logs & send an
* interrupt. But there could be some data in the log buffer
@@ -742,12 +755,6 @@ void intel_guc_log_unregister(struct intel_guc_log *log)
guc_flush_logs(log);
mutex_lock(&i915->drm.struct_mutex);
-
- /* GuC logging is currently the only user of Guc2Host interrupts */
- intel_runtime_pm_get(i915);
- gen9_disable_guc_interrupts(i915);
- intel_runtime_pm_put(i915);
-
guc_log_runtime_destroy(log);
mutex_unlock(&i915->drm.struct_mutex);