Commit 01666975 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

drm/i915/guc: Use correct lock for accessing guc->mmio_msg

Guc->mmio_msg is set under the guc->irq_lock in guc_get_mmio_msg so it
should be consumed under the same lock from guc_handle_mmio_msg.

I am not sure if the overall flow here makes complete sense but at least
the correct lock is now used.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20201120095636.1987395-1-tvrtko.ursulin@linux.intel.com
parent 46eecfcc
...@@ -175,19 +175,15 @@ static void guc_get_mmio_msg(struct intel_guc *guc) ...@@ -175,19 +175,15 @@ static void guc_get_mmio_msg(struct intel_guc *guc)
static void guc_handle_mmio_msg(struct intel_guc *guc) static void guc_handle_mmio_msg(struct intel_guc *guc)
{ {
struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
/* we need communication to be enabled to reply to GuC */ /* we need communication to be enabled to reply to GuC */
GEM_BUG_ON(!guc_communication_enabled(guc)); GEM_BUG_ON(!guc_communication_enabled(guc));
if (!guc->mmio_msg) spin_lock_irq(&guc->irq_lock);
return; if (guc->mmio_msg) {
spin_lock_irq(&i915->irq_lock);
intel_guc_to_host_process_recv_msg(guc, &guc->mmio_msg, 1); intel_guc_to_host_process_recv_msg(guc, &guc->mmio_msg, 1);
spin_unlock_irq(&i915->irq_lock);
guc->mmio_msg = 0; guc->mmio_msg = 0;
}
spin_unlock_irq(&guc->irq_lock);
} }
static void guc_reset_interrupts(struct intel_guc *guc) static void guc_reset_interrupts(struct intel_guc *guc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment