aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2014-08-18 07:42:44 -0400
committerJani Nikula <jani.nikula@intel.com>2014-08-18 09:16:03 -0400
commit1d0d343abb70922adebebc1cfcef6622f4c7edec (patch)
treecaedb147da5e3f9609d87aa02b8443497daa5594 /drivers
parent6323751d28b0cc785dab972eff6b7fca1a165a40 (diff)
drm/i915: cancel hotplug and dig_port work during suspend and unload
Make sure these work handlers don't run after we system suspend or unload the driver. Note that we don't cancel the handlers during runtime suspend. That could lead to a lockup, since we take a runtime PM ref from the handlers themselves. Fortunaltely canceling there is not needed since the RPM ref itself provides for the needed serialization. v2: - fix the order of canceling dig_port_work wrt. hotplug_work (Ville) - zero out {long,short}_hpd_port_mask and hpd_event_bits for speed (Ville) Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: stable@vger.kernel.org (3.16+) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c16
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c3
3 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index ec96f9a9724c..3f9c8f6b2418 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -494,6 +494,21 @@ bool i915_semaphore_is_enabled(struct drm_device *dev)
494 return true; 494 return true;
495} 495}
496 496
497void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)
498{
499 spin_lock_irq(&dev_priv->irq_lock);
500
501 dev_priv->long_hpd_port_mask = 0;
502 dev_priv->short_hpd_port_mask = 0;
503 dev_priv->hpd_event_bits = 0;
504
505 spin_unlock_irq(&dev_priv->irq_lock);
506
507 cancel_work_sync(&dev_priv->dig_port_work);
508 cancel_work_sync(&dev_priv->hotplug_work);
509 cancel_delayed_work_sync(&dev_priv->hotplug_reenable_work);
510}
511
497static int i915_drm_freeze(struct drm_device *dev) 512static int i915_drm_freeze(struct drm_device *dev)
498{ 513{
499 struct drm_i915_private *dev_priv = dev->dev_private; 514 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -538,6 +553,7 @@ static int i915_drm_freeze(struct drm_device *dev)
538 flush_delayed_work(&dev_priv->rps.delayed_resume_work); 553 flush_delayed_work(&dev_priv->rps.delayed_resume_work);
539 554
540 intel_runtime_pm_disable_interrupts(dev); 555 intel_runtime_pm_disable_interrupts(dev);
556 intel_hpd_cancel_work(dev_priv);
541 557
542 intel_suspend_gt_powersave(dev); 558 intel_suspend_gt_powersave(dev);
543 559
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 1263aacbe025..7a830eac5ba3 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2178,6 +2178,7 @@ extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv);
2178extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv); 2178extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv);
2179extern void i915_update_gfx_val(struct drm_i915_private *dev_priv); 2179extern void i915_update_gfx_val(struct drm_i915_private *dev_priv);
2180int vlv_force_gfx_clock(struct drm_i915_private *dev_priv, bool on); 2180int vlv_force_gfx_clock(struct drm_i915_private *dev_priv, bool on);
2181void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
2181 2182
2182extern void intel_console_resume(struct work_struct *work); 2183extern void intel_console_resume(struct work_struct *work);
2183 2184
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index bcf8d18ffbb1..d074d704f458 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13103,8 +13103,7 @@ void intel_modeset_cleanup(struct drm_device *dev)
13103 * experience fancy races otherwise. 13103 * experience fancy races otherwise.
13104 */ 13104 */
13105 drm_irq_uninstall(dev); 13105 drm_irq_uninstall(dev);
13106 cancel_work_sync(&dev_priv->hotplug_work); 13106 intel_hpd_cancel_work(dev_priv);
13107 cancel_delayed_work_sync(&dev_priv->hotplug_reenable_work);
13108 dev_priv->pm._irqs_disabled = true; 13107 dev_priv->pm._irqs_disabled = true;
13109 13108
13110 /* 13109 /*