Re: [Intel-gfx] [PATCH] drm/i915: Fix rps irq warning

2011-09-04 Thread Chris Wilson
On Sat, 3 Sep 2011 20:24:15 -0700, Ben Widawsky b...@bwidawsk.net wrote: I couldn't reproduce this one, but... Interrupt mask state is lost if three interrupts occur before the workqueue has run. Should be straight forward to reproduce even without SMP. I'm pretty sure Dan Vetter was

Re: [Intel-gfx] [PATCH v5] drm/i915: pass ELD to HDMI/DP audio driver

2011-09-04 Thread James Cloos
WF == Wu Fengguang fengguang...@intel.com writes: WF ... If only the stereo playback capability is reported, the user WF won't be able to start 8-channel playback; if the 8-channel ELD is WF reported, then user space applications may send 8-channel samples WF down, however the user may actually

Re: [Intel-gfx] [PATCH v5] drm/i915: pass ELD to HDMI/DP audio driver

2011-09-04 Thread Paul Menzel
Dear Wu, I hope that is your first name. Am Sonntag, den 04.09.2011, 05:15 +0800 schrieb Wu Fengguang: Changes from v4: remove a debug call to dump_stack(). Thanks to Bossart for catching this! His first name is Pierre-Louis. I do not know how you address people at Intel though. --- I

Re: [Intel-gfx] [PATCH v5] drm/i915: pass ELD to HDMI/DP audio driver

2011-09-04 Thread Chris Wilson
On Sun, 4 Sep 2011 05:15:10 +0800, Wu Fengguang fengguang...@intel.com wrote: Changes from v4: remove a debug call to dump_stack(). Thanks to Bossart for catching this! --- Add ELD support for Intel Eaglelake, IbexPeak/Ironlake, SandyBridge/CougarPoint and IvyBridge/PantherPoint chips.

Re: [Intel-gfx] [PATCH] drm/i915: Fix rps irq warning

2011-09-04 Thread Ben Widawsky
On Sun, 04 Sep 2011 10:03:21 +0100 Chris Wilson ch...@chris-wilson.co.uk wrote: On Sat, 3 Sep 2011 20:24:15 -0700, Ben Widawsky b...@bwidawsk.net wrote: I couldn't reproduce this one, but... Interrupt mask state is lost if three interrupts occur before the workqueue has run. Should

[Intel-gfx] [PATCH 0/3] slaughter rps races some more

2011-09-04 Thread Daniel Vetter
Hi all, Let's have some new ideas for races around the rps code. Not yet tested (I can't hit the WARN anyway in my testing), I've just wanted to get this out for discussion. Yours, Daniel Daniel Vetter (3): drm/i915: close PM interrupt masking races in the irq handler drm/i915: close PM

[Intel-gfx] [PATCH 1/3] drm/i915: close PM interrupt masking races in the irq handler

2011-09-04 Thread Daniel Vetter
Quoting Chris Wilson's more concise description: Ah I think I see the problem. As you point out we only mask the current interrupt received, so that if we have a task pending (and so IMR != 0) we actually unmask the pending interrupt and so could receive it again before the tasklet is finally

[Intel-gfx] [PATCH 2/3] drm/i915: close PM interrupt masking races in the rps work func

2011-09-04 Thread Daniel Vetter
This patch closes the following race: We get a PM interrupt A, mask it, set dev_priv-iir = PM_A and kick of the work item. Scheduler isn't grumpy, so the work queue takes rps_lock, grabs pm_iir = dev_priv-pm_iir and pm_imr = READ(PMIMR). Note that pm_imr == pm_iir because we've just masked the

Re: [Intel-gfx] [PATCH 3/3] drm/i915: close rps work vs. rps disable races

2011-09-04 Thread Ben Widawsky
On Sun, Sep 04, 2011 at 05:35:02PM +0200, Daniel Vetter wrote: The rps disabling code wasn't properly cancelling outstanding work items. Also add a comment that explains why we're not racing with the work item, that could again unmask interrupts. This also fixes a bug on module unload

Re: [Intel-gfx] [PATCH 3/3] drm/i915: close rps work vs. rps disable races

2011-09-04 Thread Daniel Vetter
On Sun, Sep 04, 2011 at 05:23:30PM +, Ben Widawsky wrote: On Sun, Sep 04, 2011 at 05:35:02PM +0200, Daniel Vetter wrote: The rps disabling code wasn't properly cancelling outstanding work items. Also add a comment that explains why we're not racing with the work item, that could again

Re: [Intel-gfx] [PATCH 2/3] drm/i915: close PM interrupt masking races in the rps work func

2011-09-04 Thread Daniel Vetter
On Sun, Sep 04, 2011 at 10:08:17AM -0700, Ben Widawsky wrote: diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 55518e3..3bc1479 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -415,12 +415,7 @@ static void

Re: [Intel-gfx] [PATCH 3/3] drm/i915: close rps work vs. rps disable races

2011-09-04 Thread Ben Widawsky
On Sun, Sep 04, 2011 at 09:17:24PM +0200, Daniel Vetter wrote: spin_lock_irq(dev_priv-rps_lock); dev_priv-pm_iir = 0; + I915_WRITE(GEN6_PMIER, 0); spin_unlock_irq(dev_priv-rps_lock); I915_WRITE(GEN6_PMIIR, I915_READ(GEN6_PMIIR)); I'm not sure this actually fixes a

Re: [Intel-gfx] [PATCH 2/3] drm/i915: close PM interrupt masking races in the rps work func

2011-09-04 Thread Ben Widawsky
On Sun, Sep 04, 2011 at 09:26:48PM +0200, Daniel Vetter wrote: On Sun, Sep 04, 2011 at 10:08:17AM -0700, Ben Widawsky wrote: diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 55518e3..3bc1479 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++

Re: [Intel-gfx] [PATCH 3/3] drm/i915: close rps work vs. rps disable races

2011-09-04 Thread Daniel Vetter
On Sun, Sep 04, 2011 at 07:50:08PM +, Ben Widawsky wrote: So I would rework some of your comments a bit, and I also think it's about time we create a central place to cancel workqueue items. Mostly because I think this patch is subject to a deadlock with struct_mutex (you're holding it

Re: [Intel-gfx] [PATCH 2/3] drm/i915: close PM interrupt masking races in the rps work func

2011-09-04 Thread Daniel Vetter
On Sun, Sep 04, 2011 at 07:56:57PM +, Ben Widawsky wrote: On Sun, Sep 04, 2011 at 09:26:48PM +0200, Daniel Vetter wrote: On Sun, Sep 04, 2011 at 10:08:17AM -0700, Ben Widawsky wrote: diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index

Re: [Intel-gfx] [PATCH v5] drm/i915: pass ELD to HDMI/DP audio driver

2011-09-04 Thread Wu Fengguang
Dear Paul, On Sun, Sep 04, 2011 at 07:11:54PM +0800, Paul Menzel wrote: Dear Wu, I hope that is your first name. My first name is Fengguang. LAST NAME, FIRSTNAME is the convention in Intel emails. However I often forgot this and pick whatever comes first...and happily accept both Fengguang

Re: [Intel-gfx] [PATCH v5] drm/i915: pass ELD to HDMI/DP audio driver

2011-09-04 Thread Wu Fengguang
On Sun, Sep 04, 2011 at 08:08:37PM +0800, Chris Wilson wrote: On Sun, 4 Sep 2011 05:15:10 +0800, Wu Fengguang fengguang...@intel.com wrote: Changes from v4: remove a debug call to dump_stack(). Thanks to Bossart for catching this! --- Add ELD support for Intel Eaglelake,

Re: [Intel-gfx] [PATCH v5] drm/i915: pass ELD to HDMI/DP audio driver

2011-09-04 Thread Wu Fengguang
On Sun, Sep 04, 2011 at 06:57:23PM +0800, James Cloos wrote: WF == Wu Fengguang fengguang...@intel.com writes: WF ... If only the stereo playback capability is reported, the user WF won't be able to start 8-channel playback; if the 8-channel ELD is WF reported, then user space applications

[Intel-gfx] [PATCH] drm/i915: Dumb down the semaphore logic

2011-09-04 Thread Ben Widawsky
While I think the previous code is correct, it was hard to follow and hard to debug. Since we already have a ring abstraction, might as well use it to handle the semaphore updates and compares. I don't expect this code to make semaphores better or worse, but you never know... Cc: Chris Wilson