Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/24/2013 11:43 AM, Maarten Lankhorst wrote: Op 24-09-13 11:03, Thomas Hellstrom schreef: On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom schreef: Actually, it's not the locking order bo:reserve -> mmap_sem that triggers the lockdep warning, right?

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/24/2013 01:32 PM, Maarten Lankhorst wrote: Op 24-09-13 12:33, Thomas Hellstrom schreef: On 09/24/2013 12:11 PM, Maarten Lankhorst wrote: It seems userspace only updates offset and domain in nouveau. If it fails to update it would result in the same affect as when the buffer gets moved

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Maarten Lankhorst
Op 24-09-13 12:33, Thomas Hellstrom schreef: > On 09/24/2013 12:11 PM, Maarten Lankhorst wrote: >> Op 24-09-13 11:36, Daniel Vetter schreef: >>> On Tue, Sep 24, 2013 at 11:03:37AM +0200, Thomas Hellstrom wrote: On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: > Op 24-09-13 09:22, Thomas

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/24/2013 12:11 PM, Maarten Lankhorst wrote: Op 24-09-13 11:36, Daniel Vetter schreef: On Tue, Sep 24, 2013 at 11:03:37AM +0200, Thomas Hellstrom wrote: On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom schreef: On 09/23/2013 05:33 PM, Maarten Lankhorst

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Maarten Lankhorst
Op 24-09-13 11:36, Daniel Vetter schreef: > On Tue, Sep 24, 2013 at 11:03:37AM +0200, Thomas Hellstrom wrote: >> On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: >>> Op 24-09-13 09:22, Thomas Hellstrom schreef: On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: > Hey, > > Op

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Maarten Lankhorst
Op 24-09-13 11:03, Thomas Hellstrom schreef: > On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: >> Op 24-09-13 09:22, Thomas Hellstrom schreef: >>> On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: > On Fri, Sep 13, 2013 at

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Daniel Vetter
On Tue, Sep 24, 2013 at 11:03:37AM +0200, Thomas Hellstrom wrote: > On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: > >Op 24-09-13 09:22, Thomas Hellstrom schreef: > >>On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: > >>>Hey, > >>> > >>>Op 13-09-13 11:00, Peter Zijlstra schreef: > On Fri,

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom schreef: On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: On Fri, Sep 13, 2013 at 10:41:54AM +0200, Daniel Vetter wrote: On Fri, Sep 13, 2013 at 10:29 AM,

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Ingo Molnar
* Maarten Lankhorst wrote: > > I think the Nouveau guys need to comment further on this, but > > returning -EFAULT might break existing user-space, and that's not > > allowed, but IIRC the return value of "presumed" is only a hint, and > > if it's incorrect will only trigger future command

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Maarten Lankhorst
Op 24-09-13 09:22, Thomas Hellstrom schreef: > On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: >> Hey, >> >> Op 13-09-13 11:00, Peter Zijlstra schreef: >>> On Fri, Sep 13, 2013 at 10:41:54AM +0200, Daniel Vetter wrote: On Fri, Sep 13, 2013 at 10:29 AM, Peter Zijlstra wrote: > On

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: On Fri, Sep 13, 2013 at 10:41:54AM +0200, Daniel Vetter wrote: On Fri, Sep 13, 2013 at 10:29 AM, Peter Zijlstra wrote: On Fri, Sep 13, 2013 at 09:46:03AM +0200, Thomas Hellstrom wrote: if

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: On Fri, Sep 13, 2013 at 10:41:54AM +0200, Daniel Vetter wrote: On Fri, Sep 13, 2013 at 10:29 AM, Peter Zijlstra pet...@infradead.org wrote: On Fri, Sep 13, 2013 at 09:46:03AM +0200, Thomas

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Maarten Lankhorst
Op 24-09-13 09:22, Thomas Hellstrom schreef: On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: On Fri, Sep 13, 2013 at 10:41:54AM +0200, Daniel Vetter wrote: On Fri, Sep 13, 2013 at 10:29 AM, Peter Zijlstra pet...@infradead.org wrote: On Fri,

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Ingo Molnar
* Maarten Lankhorst maarten.lankho...@canonical.com wrote: I think the Nouveau guys need to comment further on this, but returning -EFAULT might break existing user-space, and that's not allowed, but IIRC the return value of presumed is only a hint, and if it's incorrect will only

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom schreef: On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: On Fri, Sep 13, 2013 at 10:41:54AM +0200, Daniel Vetter wrote: On Fri, Sep 13, 2013 at 10:29 AM,

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Daniel Vetter
On Tue, Sep 24, 2013 at 11:03:37AM +0200, Thomas Hellstrom wrote: On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom schreef: On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: On Fri, Sep 13, 2013 at

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Maarten Lankhorst
Op 24-09-13 11:03, Thomas Hellstrom schreef: On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom schreef: On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: On Fri, Sep 13, 2013 at 10:41:54AM +0200, Daniel Vetter

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Maarten Lankhorst
Op 24-09-13 11:36, Daniel Vetter schreef: On Tue, Sep 24, 2013 at 11:03:37AM +0200, Thomas Hellstrom wrote: On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom schreef: On 09/23/2013 05:33 PM, Maarten Lankhorst wrote: Hey, Op 13-09-13 11:00, Peter Zijlstra

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/24/2013 12:11 PM, Maarten Lankhorst wrote: Op 24-09-13 11:36, Daniel Vetter schreef: On Tue, Sep 24, 2013 at 11:03:37AM +0200, Thomas Hellstrom wrote: On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom schreef: On 09/23/2013 05:33 PM, Maarten Lankhorst

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Maarten Lankhorst
Op 24-09-13 12:33, Thomas Hellstrom schreef: On 09/24/2013 12:11 PM, Maarten Lankhorst wrote: Op 24-09-13 11:36, Daniel Vetter schreef: On Tue, Sep 24, 2013 at 11:03:37AM +0200, Thomas Hellstrom wrote: On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/24/2013 01:32 PM, Maarten Lankhorst wrote: Op 24-09-13 12:33, Thomas Hellstrom schreef: On 09/24/2013 12:11 PM, Maarten Lankhorst wrote: It seems userspace only updates offset and domain in nouveau. If it fails to update it would result in the same affect as when the buffer gets moved

Re: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-24 Thread Thomas Hellstrom
On 09/24/2013 11:43 AM, Maarten Lankhorst wrote: Op 24-09-13 11:03, Thomas Hellstrom schreef: On 09/24/2013 09:34 AM, Maarten Lankhorst wrote: Op 24-09-13 09:22, Thomas Hellstrom schreef: Actually, it's not the locking order bo:reserve - mmap_sem that triggers the lockdep warning, right? but

[RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-23 Thread Maarten Lankhorst
Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: > On Fri, Sep 13, 2013 at 10:41:54AM +0200, Daniel Vetter wrote: >> On Fri, Sep 13, 2013 at 10:29 AM, Peter Zijlstra >> wrote: >>> On Fri, Sep 13, 2013 at 09:46:03AM +0200, Thomas Hellstrom wrote: >> if (!bo_tryreserve()) { >> up_read

[RFC PATCH] drm/nouveau: fix nested locking in mmap handler

2013-09-23 Thread Maarten Lankhorst
Hey, Op 13-09-13 11:00, Peter Zijlstra schreef: On Fri, Sep 13, 2013 at 10:41:54AM +0200, Daniel Vetter wrote: On Fri, Sep 13, 2013 at 10:29 AM, Peter Zijlstra pet...@infradead.org wrote: On Fri, Sep 13, 2013 at 09:46:03AM +0200, Thomas Hellstrom wrote: if (!bo_tryreserve()) { up_read