]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915: move getting struct_mutex lower in the callstack during GPU reset
authorImre Deak <imre.deak@intel.com>
Mon, 14 Apr 2014 17:24:28 +0000 (20:24 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 25 Apr 2014 07:52:10 +0000 (09:52 +0200)
Getting struct_mutex around the whole intel_enable_gt_powersave()
function is not necessary, since it's only needed for the ILK path
therein.

This will make intel_enable_gt_powersave() useable on the RPM resume
path for >=GEN6 (added in an upcoming patch to reset the RPS state
during RPM resume), where we can't (and need not) get this mutex.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/intel_pm.c

index f50168dcfd85fd6468fb6db2ff69f58d0b5a4fb2..75409ff5f08ca3718cafd03e20aaf999d033338c 100644 (file)
@@ -776,11 +776,8 @@ int i915_reset(struct drm_device *dev)
                 * reset and the re-install of drm irq. Skip for ironlake per
                 * previous concerns that it doesn't respond well to some forms
                 * of re-init after reset. */
-               if (INTEL_INFO(dev)->gen > 5) {
-                       mutex_lock(&dev->struct_mutex);
+               if (INTEL_INFO(dev)->gen > 5)
                        intel_enable_gt_powersave(dev);
-                       mutex_unlock(&dev->struct_mutex);
-               }
 
                intel_hpd_init(dev);
        } else {
index cb5e76aba13c907ef065ca5a9cc2c17e7c7fe8b8..30d252cf57fc75efa59ef45e236381b6edc2ad43 100644 (file)
@@ -4546,9 +4546,11 @@ void intel_enable_gt_powersave(struct drm_device *dev)
        struct drm_i915_private *dev_priv = dev->dev_private;
 
        if (IS_IRONLAKE_M(dev)) {
+               mutex_lock(&dev->struct_mutex);
                ironlake_enable_drps(dev);
                ironlake_enable_rc6(dev);
                intel_init_emon(dev);
+               mutex_unlock(&dev->struct_mutex);
        } else if (IS_GEN6(dev) || IS_GEN7(dev)) {
                /*
                 * PCU communication is slow and this doesn't need to be