Re: [Intel-gfx] [PATCH 1/4] drm/i915: fix HPD IRQ reenable work cancelation

2014-08-18 Thread Jani Nikula
On Fri, 15 Aug 2014, Imre Deak imre.d...@intel.com wrote:
 On Fri, 2014-08-15 at 12:48 +0300, Jani Nikula wrote:
 On Fri, 15 Aug 2014, Imre Deak imre.d...@intel.com wrote:
  On Wed, 2014-08-13 at 19:33 +0300, Ville Syrjälä wrote:
  The series seems fine to me.
  
  Reviewed-by: Ville Syrjälä ville.syrj...@linux.intel.com
  for the rest as well.
 
  Thanks, I assume it's for v2. I'd say this is for -fixes. The problem
  existed even in 3.16, but only the MST support made it apparent with the
  extra HPD signaling and DP AUX activity during suspend.
 
 The series no longer applies on any branch. Would you mind respinning on
 -fixes please?

 Ok. I just noticed that it depends on the following two patches that are
 only in -nightly not in -fixes:

 drm/i915: Introduce a for_each_intel_encoder() macro
 drm/i915: lock around link status and link training.

 Are you going to apply these? The second one is definitely needed in
 -fixes imo.

I've rebased -fixes on top of 3.17-rc1, so the second patch is there
now. However patch 3 still doesn't apply. Also, if we're going to queue
these for stable to fix 3.16, it's easier if we don't depend on
for_each_intel_encoder. Could you rebase this on -fixes now please?

Thanks,
Jani.



-- 
Jani Nikula, Intel Open Source Technology Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/4] drm/i915: fix HPD IRQ reenable work cancelation

2014-08-15 Thread Imre Deak
On Wed, 2014-08-13 at 19:33 +0300, Ville Syrjälä wrote:
 The series seems fine to me.
 
 Reviewed-by: Ville Syrjälä ville.syrj...@linux.intel.com
 for the rest as well.

Thanks, I assume it's for v2. I'd say this is for -fixes. The problem
existed even in 3.16, but only the MST support made it apparent with the
extra HPD signaling and DP AUX activity during suspend.

--Imre 


___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/4] drm/i915: fix HPD IRQ reenable work cancelation

2014-08-15 Thread Jani Nikula
On Fri, 15 Aug 2014, Imre Deak imre.d...@intel.com wrote:
 On Wed, 2014-08-13 at 19:33 +0300, Ville Syrjälä wrote:
 The series seems fine to me.
 
 Reviewed-by: Ville Syrjälä ville.syrj...@linux.intel.com
 for the rest as well.

 Thanks, I assume it's for v2. I'd say this is for -fixes. The problem
 existed even in 3.16, but only the MST support made it apparent with the
 extra HPD signaling and DP AUX activity during suspend.

The series no longer applies on any branch. Would you mind respinning on
-fixes please?

BR,
Jani.



 --Imre 



-- 
Jani Nikula, Intel Open Source Technology Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/4] drm/i915: fix HPD IRQ reenable work cancelation

2014-08-15 Thread Imre Deak
On Fri, 2014-08-15 at 12:48 +0300, Jani Nikula wrote:
 On Fri, 15 Aug 2014, Imre Deak imre.d...@intel.com wrote:
  On Wed, 2014-08-13 at 19:33 +0300, Ville Syrjälä wrote:
  The series seems fine to me.
  
  Reviewed-by: Ville Syrjälä ville.syrj...@linux.intel.com
  for the rest as well.
 
  Thanks, I assume it's for v2. I'd say this is for -fixes. The problem
  existed even in 3.16, but only the MST support made it apparent with the
  extra HPD signaling and DP AUX activity during suspend.
 
 The series no longer applies on any branch. Would you mind respinning on
 -fixes please?

Ok. I just noticed that it depends on the following two patches that are
only in -nightly not in -fixes:

drm/i915: Introduce a for_each_intel_encoder() macro
drm/i915: lock around link status and link training.

Are you going to apply these? The second one is definitely needed in
-fixes imo.

--Imre


signature.asc
Description: This is a digitally signed message part
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/4] drm/i915: fix HPD IRQ reenable work cancelation

2014-08-13 Thread Ville Syrjälä
The series seems fine to me.

Reviewed-by: Ville Syrjälä ville.syrj...@linux.intel.com
for the rest as well.

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 1/4] drm/i915: fix HPD IRQ reenable work cancelation

2014-08-11 Thread Imre Deak
Atm, the HPD IRQ reenable timer can get rearmed right after it's
canceled. Also to access the HPD IRQ mask registers we need to wake up
the HW.

Solve both issues by converting the reenable timer to a delayed work and
grabbing a runtime PM reference in the work. By this we can also forgo
canceling the timer during runtime suspend, since the only important
thing there is that the HW is awake when we write the registers and
that's ensured by the RPM ref. So do the cancelation only during driver
unload time; this is also a requirement for an upcoming patch where we
want to cancel all HPD related works only during system suspend and
driver unload time, but not during runtime suspend.

Note that there is still a race between the HPD IRQ reenable work and
drm_irq_uninstall() during driver unload, where the work can reenable
the HPD IRQs disabled by drm_irq_uninstall(). This isn't a problem since
the HPD IRQs will still be effectively masked by the first level
interrupt mask.

Signed-off-by: Imre Deak imre.d...@intel.com
---
 drivers/gpu/drm/i915/i915_drv.h  |  2 +-
 drivers/gpu/drm/i915/i915_irq.c  | 33 -
 drivers/gpu/drm/i915/intel_display.c |  1 +
 3 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9198f1c..35d150a 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1483,7 +1483,7 @@ struct drm_i915_private {
} hpd_mark;
} hpd_stats[HPD_NUM_PINS];
u32 hpd_event_bits;
-   struct timer_list hotplug_reenable_timer;
+   struct delayed_work hotplug_reenable_work;
 
struct i915_fbc fbc;
struct i915_drrs drrs;
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 8e6729e..fbf1eff 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1189,8 +1189,8 @@ static void i915_hotplug_work_func(struct work_struct 
*work)
  * some connectors */
if (hpd_disabled) {
drm_kms_helper_poll_enable(dev);
-   mod_timer(dev_priv-hotplug_reenable_timer,
- jiffies + 
msecs_to_jiffies(I915_REENABLE_HOTPLUG_DELAY));
+   schedule_delayed_work(dev_priv-hotplug_reenable_work,
+ msecs_to_jiffies(I915_REENABLE_HOTPLUG_DELAY));
}
 
spin_unlock_irqrestore(dev_priv-irq_lock, irqflags);
@@ -1213,11 +1213,6 @@ static void i915_hotplug_work_func(struct work_struct 
*work)
drm_kms_helper_hotplug_event(dev);
 }
 
-static void intel_hpd_irq_uninstall(struct drm_i915_private *dev_priv)
-{
-   del_timer_sync(dev_priv-hotplug_reenable_timer);
-}
-
 static void ironlake_rps_change_irq_handler(struct drm_device *dev)
 {
struct drm_i915_private *dev_priv = dev-dev_private;
@@ -3886,8 +3881,6 @@ static void gen8_irq_uninstall(struct drm_device *dev)
if (!dev_priv)
return;
 
-   intel_hpd_irq_uninstall(dev_priv);
-
gen8_irq_reset(dev);
 }
 
@@ -3902,8 +3895,6 @@ static void valleyview_irq_uninstall(struct drm_device 
*dev)
 
I915_WRITE(VLV_MASTER_IER, 0);
 
-   intel_hpd_irq_uninstall(dev_priv);
-
for_each_pipe(pipe)
I915_WRITE(PIPESTAT(pipe), 0x);
 
@@ -3982,8 +3973,6 @@ static void ironlake_irq_uninstall(struct drm_device *dev)
if (!dev_priv)
return;
 
-   intel_hpd_irq_uninstall(dev_priv);
-
ironlake_irq_reset(dev);
 }
 
@@ -4354,8 +4343,6 @@ static void i915_irq_uninstall(struct drm_device * dev)
struct drm_i915_private *dev_priv = dev-dev_private;
int pipe;
 
-   intel_hpd_irq_uninstall(dev_priv);
-
if (I915_HAS_HOTPLUG(dev)) {
I915_WRITE(PORT_HOTPLUG_EN, 0);
I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT));
@@ -4591,8 +4578,6 @@ static void i965_irq_uninstall(struct drm_device * dev)
if (!dev_priv)
return;
 
-   intel_hpd_irq_uninstall(dev_priv);
-
I915_WRITE(PORT_HOTPLUG_EN, 0);
I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT));
 
@@ -4608,14 +4593,18 @@ static void i965_irq_uninstall(struct drm_device * dev)
I915_WRITE(IIR, I915_READ(IIR));
 }
 
-static void intel_hpd_irq_reenable(unsigned long data)
+static void intel_hpd_irq_reenable(struct work_struct *work)
 {
-   struct drm_i915_private *dev_priv = (struct drm_i915_private *)data;
+   struct drm_i915_private *dev_priv =
+   container_of(work, typeof(*dev_priv),
+hotplug_reenable_work.work);
struct drm_device *dev = dev_priv-dev;
struct drm_mode_config *mode_config = dev-mode_config;
unsigned long irqflags;
int i;
 
+   intel_runtime_pm_get(dev_priv);
+
spin_lock_irqsave(dev_priv-irq_lock, irqflags);
for (i = (HPD_NONE + 1); i  HPD_NUM_PINS;