summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_huc.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-02-14 13:34:20 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-02-14 22:30:22 +0000
commit65300b1f6e04a905200ac5943cb9bfdadc3651a2 (patch)
treebe95dc5b041e61f102d4ecf28aeb7b0b41a99ab2 /drivers/gpu/drm/i915/intel_huc.c
parentb8f2169db98eba2c5009cc67a448dc48a0fd4c48 (diff)
downloadop-kernel-dev-65300b1f6e04a905200ac5943cb9bfdadc3651a2.zip
op-kernel-dev-65300b1f6e04a905200ac5943cb9bfdadc3651a2.tar.gz
drm/i915/guc: Don't take struct_mutex for object unreference
We no longer need to take the struct_mutex for freeing objects, and on the finalisation paths here the mutex is not been used for serialisation of the pointer access, so remove the BKL wart. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: http://patchwork.freedesktop.org/patch/msgid/20170214133420.7977-1-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_huc.c')
-rw-r--r--drivers/gpu/drm/i915/intel_huc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_huc.c b/drivers/gpu/drm/i915/intel_huc.c
index c144609..c28543d 100644
--- a/drivers/gpu/drm/i915/intel_huc.c
+++ b/drivers/gpu/drm/i915/intel_huc.c
@@ -274,12 +274,11 @@ fail:
void intel_huc_fini(struct drm_i915_private *dev_priv)
{
struct intel_uc_fw *huc_fw = &dev_priv->huc.fw;
+ struct drm_i915_gem_object *obj;
- mutex_lock(&dev_priv->drm.struct_mutex);
- if (huc_fw->obj)
- i915_gem_object_put(huc_fw->obj);
- huc_fw->obj = NULL;
- mutex_unlock(&dev_priv->drm.struct_mutex);
+ obj = fetch_and_zero(&huc_fw->obj);
+ if (obj)
+ i915_gem_object_put(obj);
huc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE;
}
OpenPOWER on IntegriCloud