[PATCH 1/6] drm/i915: Fix lock order reversal in GTT pwrite path.

2009-03-25 Thread Eric Anholt
Since the pagefault path determines that the lock order we use has to be mmap_sem -> struct_mutex, we can't allow page faults to occur while the struct_mutex is held. To fix this in pwrite, we first try optimistically to see if we can copy from user without faulting. If it fails, fall back to usi

Re: [PATCH 1/6] drm/i915: Fix lock order reversal in GTT pwrite path.

2009-03-26 Thread Jesse Barnes
On Wed, 25 Mar 2009 14:45:05 -0700 Eric Anholt wrote: > Since the pagefault path determines that the lock order we use has to > be mmap_sem -> struct_mutex, we can't allow page faults to occur > while the struct_mutex is held. To fix this in pwrite, we first try > optimistically to see if we can

Re: [PATCH 1/6] drm/i915: Fix lock order reversal in GTT pwrite path.

2009-03-27 Thread Eric Anholt
On Thu, 2009-03-26 at 17:43 -0700, Jesse Barnes wrote: > On Wed, 25 Mar 2009 14:45:05 -0700 > Eric Anholt wrote: > > > Since the pagefault path determines that the lock order we use has to > > be mmap_sem -> struct_mutex, we can't allow page faults to occur > > while the struct_mutex is held. To

Re: [PATCH 1/6] drm/i915: Fix lock order reversal in GTT pwrite path.

2009-03-27 Thread Jesse Barnes
On Fri, 27 Mar 2009 09:56:03 -0700 Eric Anholt wrote: > On Thu, 2009-03-26 at 17:43 -0700, Jesse Barnes wrote: > > On Wed, 25 Mar 2009 14:45:05 -0700 > > Eric Anholt wrote: > > > > > Since the pagefault path determines that the lock order we use > > > has to be mmap_sem -> struct_mutex, we can'

Re: [PATCH 1/6] drm/i915: Fix lock order reversal in GTT pwrite path.

2009-03-27 Thread Jesse Barnes
On Sat, 28 Mar 2009 01:54:32 +0100 Peter Zijlstra wrote: > On Thu, 2009-03-26 at 17:43 -0700, Jesse Barnes wrote: > > On Wed, 25 Mar 2009 14:45:05 -0700 > > Eric Anholt wrote: > > > > > Since the pagefault path determines that the lock order we use > > > has to be mmap_sem -> struct_mutex, we c

Re: [PATCH 1/6] drm/i915: Fix lock order reversal in GTT pwrite path.

2009-03-27 Thread Dave Airlie
On Sat, Mar 28, 2009 at 12:35 PM, Jesse Barnes wrote: > On Sat, 28 Mar 2009 01:54:32 +0100 > Peter Zijlstra wrote: > >> On Thu, 2009-03-26 at 17:43 -0700, Jesse Barnes wrote: >> > On Wed, 25 Mar 2009 14:45:05 -0700 >> > Eric Anholt wrote: >> > >> > > Since the pagefault path determines that the

Re: [PATCH 1/6] drm/i915: Fix lock order reversal in GTT pwrite path.

2009-03-28 Thread Peter Zijlstra
On Thu, 2009-03-26 at 17:43 -0700, Jesse Barnes wrote: > On Wed, 25 Mar 2009 14:45:05 -0700 > Eric Anholt wrote: > > > Since the pagefault path determines that the lock order we use has to > > be mmap_sem -> struct_mutex, we can't allow page faults to occur > > while the struct_mutex is held. To