Commit 959cbc1b authored by Imre Deak's avatar Imre Deak Committed by Daniel Vetter

drm/i915: change power_well->lock to be mutex

There is no hard need for this to be a spin lock, as we don't take these
locks in irq context from anywhere. An upcoming patch will add calls to
punit read/write functions from within regions protected by this lock
and those functions need a mutex in turn. As a solution for that convert
the spin lock to be a mutex.
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent bddc7645
...@@ -909,7 +909,7 @@ struct intel_ilk_power_mgmt { ...@@ -909,7 +909,7 @@ struct intel_ilk_power_mgmt {
/* Power well structure for haswell */ /* Power well structure for haswell */
struct i915_power_well { struct i915_power_well {
struct drm_device *device; struct drm_device *device;
spinlock_t lock; struct mutex lock;
/* power well enable/disable usage count */ /* power well enable/disable usage count */
int count; int count;
int i915_request; int i915_request;
......
...@@ -5626,9 +5626,9 @@ void intel_display_power_get(struct drm_device *dev, ...@@ -5626,9 +5626,9 @@ void intel_display_power_get(struct drm_device *dev,
if (is_always_on_power_domain(dev, domain)) if (is_always_on_power_domain(dev, domain))
return; return;
spin_lock_irq(&power_well->lock); mutex_lock(&power_well->lock);
__intel_power_well_get(power_well); __intel_power_well_get(power_well);
spin_unlock_irq(&power_well->lock); mutex_unlock(&power_well->lock);
} }
void intel_display_power_put(struct drm_device *dev, void intel_display_power_put(struct drm_device *dev,
...@@ -5643,9 +5643,9 @@ void intel_display_power_put(struct drm_device *dev, ...@@ -5643,9 +5643,9 @@ void intel_display_power_put(struct drm_device *dev,
if (is_always_on_power_domain(dev, domain)) if (is_always_on_power_domain(dev, domain))
return; return;
spin_lock_irq(&power_well->lock); mutex_lock(&power_well->lock);
__intel_power_well_put(power_well); __intel_power_well_put(power_well);
spin_unlock_irq(&power_well->lock); mutex_unlock(&power_well->lock);
} }
static struct i915_power_well *hsw_pwr; static struct i915_power_well *hsw_pwr;
...@@ -5656,9 +5656,9 @@ void i915_request_power_well(void) ...@@ -5656,9 +5656,9 @@ void i915_request_power_well(void)
if (WARN_ON(!hsw_pwr)) if (WARN_ON(!hsw_pwr))
return; return;
spin_lock_irq(&hsw_pwr->lock); mutex_lock(&hsw_pwr->lock);
__intel_power_well_get(hsw_pwr); __intel_power_well_get(hsw_pwr);
spin_unlock_irq(&hsw_pwr->lock); mutex_unlock(&hsw_pwr->lock);
} }
EXPORT_SYMBOL_GPL(i915_request_power_well); EXPORT_SYMBOL_GPL(i915_request_power_well);
...@@ -5668,9 +5668,9 @@ void i915_release_power_well(void) ...@@ -5668,9 +5668,9 @@ void i915_release_power_well(void)
if (WARN_ON(!hsw_pwr)) if (WARN_ON(!hsw_pwr))
return; return;
spin_lock_irq(&hsw_pwr->lock); mutex_lock(&hsw_pwr->lock);
__intel_power_well_put(hsw_pwr); __intel_power_well_put(hsw_pwr);
spin_unlock_irq(&hsw_pwr->lock); mutex_unlock(&hsw_pwr->lock);
} }
EXPORT_SYMBOL_GPL(i915_release_power_well); EXPORT_SYMBOL_GPL(i915_release_power_well);
...@@ -5681,7 +5681,7 @@ int i915_init_power_well(struct drm_device *dev) ...@@ -5681,7 +5681,7 @@ int i915_init_power_well(struct drm_device *dev)
hsw_pwr = &dev_priv->power_well; hsw_pwr = &dev_priv->power_well;
hsw_pwr->device = dev; hsw_pwr->device = dev;
spin_lock_init(&hsw_pwr->lock); mutex_init(&hsw_pwr->lock);
hsw_pwr->count = 0; hsw_pwr->count = 0;
return 0; return 0;
...@@ -5703,7 +5703,7 @@ void intel_set_power_well(struct drm_device *dev, bool enable) ...@@ -5703,7 +5703,7 @@ void intel_set_power_well(struct drm_device *dev, bool enable)
if (!i915_disable_power_well && !enable) if (!i915_disable_power_well && !enable)
return; return;
spin_lock_irq(&power_well->lock); mutex_lock(&power_well->lock);
/* /*
* This function will only ever contribute one * This function will only ever contribute one
...@@ -5722,7 +5722,7 @@ void intel_set_power_well(struct drm_device *dev, bool enable) ...@@ -5722,7 +5722,7 @@ void intel_set_power_well(struct drm_device *dev, bool enable)
__intel_power_well_put(power_well); __intel_power_well_put(power_well);
out: out:
spin_unlock_irq(&power_well->lock); mutex_unlock(&power_well->lock);
} }
static void intel_resume_power_well(struct drm_device *dev) static void intel_resume_power_well(struct drm_device *dev)
...@@ -5733,9 +5733,9 @@ static void intel_resume_power_well(struct drm_device *dev) ...@@ -5733,9 +5733,9 @@ static void intel_resume_power_well(struct drm_device *dev)
if (!HAS_POWER_WELL(dev)) if (!HAS_POWER_WELL(dev))
return; return;
spin_lock_irq(&power_well->lock); mutex_lock(&power_well->lock);
__intel_set_power_well(dev, power_well->count > 0); __intel_set_power_well(dev, power_well->count > 0);
spin_unlock_irq(&power_well->lock); mutex_unlock(&power_well->lock);
} }
/* /*
......
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