Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Daniel Vetter
On Tue, Feb 20, 2018 at 04:21:58PM +0100, Peter Zijlstra wrote: > On Tue, Feb 20, 2018 at 04:05:49PM +0100, Christian König wrote: > > Am 20.02.2018 um 15:54 schrieb Peter Zijlstra: > > > On Tue, Feb 20, 2018 at 03:34:07PM +0100, Christian König wrote: > > > > > OK, but neither case would in fact n

Re: [PATCH] fix double ;;s in code

2018-02-20 Thread Andrew Morton
On Tue, 20 Feb 2018 10:03:56 +0200 Jani Nikula wrote: > On Mon, 19 Feb 2018, Pavel Machek wrote: > > On Mon 2018-02-19 16:41:35, Daniel Vetter wrote: > >> Yeah, pls split this into one patch per area, with a suitable patch > >> subject prefix. Look at git log of each file to get a feeling for w

Re: [PATCH] locking/ww_mutex: add ww_mutex_is_owned_by function v4

2018-02-20 Thread kbuild test robot
Hi Christian, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.16-rc2 next-20180220] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH] locking/ww_mutex: add ww_mutex_is_owned_by function v4

2018-02-20 Thread kbuild test robot
Hi Christian, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.16-rc2 next-20180220] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH] fix double ;;s in code

2018-02-20 Thread Joe Perches
On Tue, 2018-02-20 at 17:19 +1100, Michael Ellerman wrote: > Daniel Vetter writes: > > On Sun, Feb 18, 2018 at 11:00:56AM +0100, Christophe LEROY wrote: > > > Le 17/02/2018 à 22:19, Pavel Machek a écrit : > > > > > > > > Fix double ;;'s in code. > > > > > > > > Signed-off-by: Pavel Machek > > >

Re: [PATCH] fix double ;;s in code

2018-02-20 Thread Alex Deucher
On Tue, Feb 20, 2018 at 3:03 AM, Jani Nikula wrote: > On Mon, 19 Feb 2018, Pavel Machek wrote: >> On Mon 2018-02-19 16:41:35, Daniel Vetter wrote: >>> Yeah, pls split this into one patch per area, with a suitable patch >>> subject prefix. Look at git log of each file to get a feeling for what's >

Re: [PATCH] locking/ww_mutex: add ww_mutex_is_owned_by function v4

2018-02-20 Thread Daniel Vetter
On Tue, Feb 20, 2018 at 03:49:46PM +0100, Christian König wrote: > amdgpu needs to verify if userspace sends us valid addresses and the simplest > way of doing this is to check if the buffer object is locked with the ticket > of the current submission. > > Clean up the access to the ww_mutex inter

RE: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops

2018-02-20 Thread Li, Samuel
OK, I can do that. Regards, Samuel Li > -Original Message- > From: Daniel Vetter [mailto:daniel.vet...@ffwll.ch] On Behalf Of Daniel > Vetter > Sent: Tuesday, February 20, 2018 11:23 AM > To: Li, Samuel > Cc: Daniel Vetter ; Koenig, Christian > ; amd-gfx@lists.freedesktop.org; dri- > de

Re: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops

2018-02-20 Thread Daniel Vetter
On Tue, Feb 20, 2018 at 03:46:51PM +, Li, Samuel wrote: > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > member 'attach' not described in 'drm_gem_unmap_dma_buf' > > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > > member 'sgt' not described in 'drm

RE: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops

2018-02-20 Thread Li, Samuel
> ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > member 'attach' not described in 'drm_gem_unmap_dma_buf' > ./drivers/gpu/drm/drm_prime.c:342: warning: Function parameter or > member 'sgt' not described in 'drm_gem_unmap_dma_buf' > ./drivers/gpu/drm/drm_prime.c:342: warning: Fu

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 04:05:49PM +0100, Christian König wrote: > Am 20.02.2018 um 15:54 schrieb Peter Zijlstra: > > On Tue, Feb 20, 2018 at 03:34:07PM +0100, Christian König wrote: > > > > OK, but neither case would in fact need the !ctx case right? That's just > > > > there for completeness sake

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 03:34:07PM +0100, Christian König wrote: > > OK, but neither case would in fact need the !ctx case right? That's just > > there for completeness sake? > > Unfortunately not. TTM uses trylock to lock BOs which are about to be > evicted to make room for all the BOs locked wit

Re: [PATCH v2 1/1] drm: add kernel doc for exported gem dmabuf_ops

2018-02-20 Thread Daniel Vetter
On Tue, Jan 30, 2018 at 04:01:23PM +, Li, Samuel wrote: > > Alex helped push this into drm-tip, > https://cgit.freedesktop.org/drm/drm-tip/commit/drivers/gpu/drm?id=f7a71b0cf9e36c1b0edbfe89ce028a01164b864d > > Thanks, > Samuel Li > > > > -Original Message- > > From: Daniel Vetter [m

Re: [PATCH] locking/ww_mutex: add ww_mutex_is_owned_by function v4

2018-02-20 Thread Eric Engestrom
On Tuesday, 2018-02-20 15:49:46 +0100, Christian König wrote: > amdgpu needs to verify if userspace sends us valid addresses and the simplest > way of doing this is to check if the buffer object is locked with the ticket > of the current submission. > > Clean up the access to the ww_mutex internal

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Christian König
Am 20.02.2018 um 15:54 schrieb Peter Zijlstra: On Tue, Feb 20, 2018 at 03:34:07PM +0100, Christian König wrote: OK, but neither case would in fact need the !ctx case right? That's just there for completeness sake? Unfortunately not. TTM uses trylock to lock BOs which are about to be evicted to

[PATCH] locking/ww_mutex: add ww_mutex_is_owned_by function v4

2018-02-20 Thread Christian König
amdgpu needs to verify if userspace sends us valid addresses and the simplest way of doing this is to check if the buffer object is locked with the ticket of the current submission. Clean up the access to the ww_mutex internals by providing a function for this and extend the check to the thread ow

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Christian König
Am 20.02.2018 um 14:57 schrieb Peter Zijlstra: On Tue, Feb 20, 2018 at 02:26:55PM +0100, Christian König wrote: +static inline bool ww_mutex_is_owned_by(struct ww_mutex *lock, + struct ww_acquire_ctx *ctx) +{ + if (ctx) + return likely(RE

Re: amdgpu hangs on boot or shutdown on AMD Raven Ridge CPU (Engineer Sample)

2018-02-20 Thread Alex Deucher
On Tue, Feb 20, 2018 at 2:26 AM, Daniel Drake wrote: > Hi, > >> >>> We are working with new laptops that have the AMD Ravenl Ridge >> >>> chipset with this `/proc/cpuinfo` >> >>> https://gist.github.com/mschiu77/b06dba574e89b9a30cf4c450eaec49bc >> >>> >> >>> With the latest kernel 4.15, th

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 01:58:26PM +0100, Christian König wrote: > amdgpu needs to verify if userspace sends us valid addresses and the simplest > way of doing this is to check if the buffer object is locked with the ticket > of the current submission. > > Clean up the access to the ww_mutex inter

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 02:26:55PM +0100, Christian König wrote: > > > +static inline bool ww_mutex_is_owned_by(struct ww_mutex *lock, > > > + struct ww_acquire_ctx *ctx) > > > +{ > > > + if (ctx) > > > + return likely(READ_ONCE(lock->ctx) == ctx); > > > + el

Re: [PATCH 1/3] locking/ww_mutex: cleanup lock->ctx usage in amdgpu

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 02:08:26PM +0100, Christian König wrote: > Am 20.02.2018 um 13:35 schrieb Peter Zijlstra: > > > +static inline bool ww_mutex_is_owned_by(struct ww_mutex *lock, > > > + struct task_struct *task, > > > + struct ww

Re: [PATCH 1/3] locking/ww_mutex: cleanup lock->ctx usage in amdgpu

2018-02-20 Thread Peter Zijlstra
This really should've been Cc'ed to me. On Thu, Feb 15, 2018 at 03:19:42PM +0100, Christian König wrote: > diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h > index 39fda195bf78..dd580db289e8 100644 > --- a/include/linux/ww_mutex.h > +++ b/include/linux/ww_mutex.h > @@ -358,4 +358,

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Daniel Vetter
On Tue, Feb 20, 2018 at 01:58:26PM +0100, Christian König wrote: > amdgpu needs to verify if userspace sends us valid addresses and the simplest > way of doing this is to check if the buffer object is locked with the ticket > of the current submission. > > Clean up the access to the ww_mutex inter

Re: [PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Christian König
Am 20.02.2018 um 14:12 schrieb Peter Zijlstra: On Tue, Feb 20, 2018 at 01:58:26PM +0100, Christian König wrote: amdgpu needs to verify if userspace sends us valid addresses and the simplest way of doing this is to check if the buffer object is locked with the ticket of the current submission. C

Re: [PATCH 1/3] locking/ww_mutex: cleanup lock->ctx usage in amdgpu

2018-02-20 Thread Christian König
Am 20.02.2018 um 13:35 schrieb Peter Zijlstra: This really should've been Cc'ed to me. On Thu, Feb 15, 2018 at 03:19:42PM +0100, Christian König wrote: diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h index 39fda195bf78..dd580db289e8 100644 --- a/include/linux/ww_mutex.h +++ b/i

[PATCH 4/4] drm/ttm: keep BOs reserved until end of eviction

2018-02-20 Thread Christian König
This avoids problems when BOs are evicted but directly moved back into the domain from other threads. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 37 + 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm

[PATCH 1/4] locking/ww_mutex: add ww_mutex_is_owned_by function v3

2018-02-20 Thread Christian König
amdgpu needs to verify if userspace sends us valid addresses and the simplest way of doing this is to check if the buffer object is locked with the ticket of the current submission. Clean up the access to the ww_mutex internals by providing a function for this and extend the check to the thread ow

[PATCH 3/4] drm/ttm: handle already locked BOs during eviction and swapout.

2018-02-20 Thread Christian König
This solves the problem that when we swapout a BO from a domain we sometimes couldn't make room for it because holding the lock blocks all other BOs with this reservation object. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 33 - 1 file change

[PATCH 2/4] drm/amdgpu: use new ww_mutex_is_owned_by function

2018-02-20 Thread Christian König
Instead of accessing ww_mutex internals directly use the provided function to check if the ww_mutex was indeed locked by the current command submission. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

Re: [PATCH 1/3] locking/ww_mutex: cleanup lock->ctx usage in amdgpu

2018-02-20 Thread Christian König
Am 20.02.2018 um 12:33 schrieb Daniel Vetter: [SNIP] Ah, so the ttm_ctx I've spotted was something entirely different and doesn't contain the ww_acquire_ctx (I didn't check)? I'd assume you have the same ctx passed around to everything in ttm, but if that doesn't exist then we can indeed not anno

Re: [PATCH 1/3] locking/ww_mutex: cleanup lock->ctx usage in amdgpu

2018-02-20 Thread Daniel Vetter
On Tue, Feb 20, 2018 at 10:43:48AM +0100, Christian König wrote: > Am 19.02.2018 um 17:43 schrieb Daniel Vetter: > > On Mon, Feb 19, 2018 at 05:29:46PM +0100, Christian König wrote: > > > [SNIP] > > > Well that is not a problem at all. See we don't nest trylock with normal > > > lock acquiring, cau

[PATCH] drm/amdgpu: Remove duplicate setting of ->need_swiotlb

2018-02-20 Thread Thierry Reding
From: Thierry Reding There's no need to set this before the number of DMA bits has been properly determined. Signed-off-by: Thierry Reding --- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/a

Re: [PATCH] fix double ;;s in code

2018-02-20 Thread Vineet Gupta
On 02/17/2018 01:19 PM, Pavel Machek wrote: Fix double ;;'s in code. Signed-off-by: Pavel Machek diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 9d27331..ec12fe1 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c @@ -373,7 +373,7 @@ static void arc_chk_core_

Re: [PATCH] fix double ;;s in code

2018-02-20 Thread Michael Ellerman
Daniel Vetter writes: > On Sun, Feb 18, 2018 at 11:00:56AM +0100, Christophe LEROY wrote: >> Le 17/02/2018 à 22:19, Pavel Machek a écrit : >> > >> > Fix double ;;'s in code. >> > >> > Signed-off-by: Pavel Machek >> >> A summary of the files modified on top of the patch would help understand >>

Re: [PATCH 1/3] locking/ww_mutex: cleanup lock->ctx usage in amdgpu

2018-02-20 Thread Christian König
Am 19.02.2018 um 17:43 schrieb Daniel Vetter: On Mon, Feb 19, 2018 at 05:29:46PM +0100, Christian König wrote: [SNIP] Well that is not a problem at all. See we don't nest trylock with normal lock acquiring, cause that would indeed bypass the whole deadlock detection. Instead we first use ww_mut

Re: [PATCH] fix double ;;s in code

2018-02-20 Thread Jani Nikula
On Mon, 19 Feb 2018, Pavel Machek wrote: > On Mon 2018-02-19 16:41:35, Daniel Vetter wrote: >> Yeah, pls split this into one patch per area, with a suitable patch >> subject prefix. Look at git log of each file to get a feeling for what's >> the standard in each area. > > Yeah I can spend hour spl