Re: [Freedreno] [PATCH 13/14] drm/msm: Drop struct_mutex in shrinker path

2020-10-05 Thread Rob Clark
On Mon, Oct 5, 2020 at 5:44 PM Hillf Danton wrote: > > > On Mon, 5 Oct 2020 18:17:01 Kristian H. Kristensen wrote: > > On Mon, Oct 5, 2020 at 4:02 PM Daniel Vetter wrote: > > > > > > On Mon, Oct 05, 2020 at 05:24:19PM +0800, Hillf Danton wrote: > > > > > > > > On Sun, 4 Oct 2020 12:21:45 > > >

Re: [Freedreno] [PATCH 00/14] drm/msm: de-struct_mutex-ification

2020-10-05 Thread Rob Clark
On Mon, Oct 5, 2020 at 11:20 AM Daniel Vetter wrote: > > On Mon, Oct 5, 2020 at 6:24 PM Kristian Høgsberg wrote: > > > > On Sun, Oct 4, 2020 at 9:21 PM Rob Clark wrote: > > > > > > From: Rob Clark > > > > > > This doesn't remove *all* the struct_mutex, but it covers the worst > > > of it, ie.

Re: [Freedreno] [PATCH] drm/msm/dp: fixes wrong connection state caused by failure of link train

2020-10-05 Thread Stephen Boyd
Quoting khs...@codeaurora.org (2020-10-05 11:02:10) > >> + dp_del_event(dp_display, EV_DISCONNECT_PENDING_TIMEOUT); > >> + > >> dp_display_disable(dp_display, 0); > >> > >> rc = dp_display_unprepare(dp); > >> if (rc) > >> DRM_ERROR("DP display

Re: [Freedreno] [PATCH 13/14] drm/msm: Drop struct_mutex in shrinker path

2020-10-05 Thread Hillf Danton
On Mon, 5 Oct 2020 18:17:01 Kristian H. Kristensen wrote: > On Mon, Oct 5, 2020 at 4:02 PM Daniel Vetter wrote: > > > > On Mon, Oct 05, 2020 at 05:24:19PM +0800, Hillf Danton wrote: > > > > > > On Sun, 4 Oct 2020 12:21:45 > > > > From: Rob Clark > > > > > > > > Now that the inactive_list is

Re: [Freedreno] [PATCH 00/14] drm/msm: de-struct_mutex-ification

2020-10-05 Thread Daniel Vetter
On Mon, Oct 5, 2020 at 6:24 PM Kristian Høgsberg wrote: > > On Sun, Oct 4, 2020 at 9:21 PM Rob Clark wrote: > > > > From: Rob Clark > > > > This doesn't remove *all* the struct_mutex, but it covers the worst > > of it, ie. shrinker/madvise/free/retire. The submit path still uses > >

Re: [Freedreno] [PATCH 13/14] drm/msm: Drop struct_mutex in shrinker path

2020-10-05 Thread Daniel Vetter
On Mon, Oct 5, 2020 at 6:49 PM Rob Clark wrote: > > On Mon, Oct 5, 2020 at 7:02 AM Daniel Vetter wrote: > > > > On Mon, Oct 05, 2020 at 05:24:19PM +0800, Hillf Danton wrote: > > > > > > On Sun, 4 Oct 2020 12:21:45 > > > > From: Rob Clark > > > > > > > > Now that the inactive_list is protected

Re: [Freedreno] [PATCH] drm/msm/dp: fixes wrong connection state caused by failure of link train

2020-10-05 Thread khsieh
On 2020-10-02 19:12, Stephen Boyd wrote: Quoting Kuogee Hsieh (2020-10-02 15:09:19) Connection state is set incorrectly happen at either failure of link train or cable plugged in while suspended. This patch fixes these problems. This patch also replace ST_SUSPEND_PENDING with ST_DISPLAY_OFF.

Re: [Freedreno] [PATCH 13/14] drm/msm: Drop struct_mutex in shrinker path

2020-10-05 Thread Rob Clark
On Mon, Oct 5, 2020 at 7:02 AM Daniel Vetter wrote: > > On Mon, Oct 05, 2020 at 05:24:19PM +0800, Hillf Danton wrote: > > > > On Sun, 4 Oct 2020 12:21:45 > > > From: Rob Clark > > > > > > Now that the inactive_list is protected by mm_lock, and everything > > > else on per-obj basis is protected

Re: [Freedreno] [PATCH 07/14] drm/msm: Refcount submits

2020-10-05 Thread Rob Clark
On Mon, Oct 5, 2020 at 6:56 AM Daniel Vetter wrote: > > On Sun, Oct 04, 2020 at 12:21:39PM -0700, Rob Clark wrote: > > From: Rob Clark > > > > Before we remove dev->struct_mutex from the retire path, we have to deal > > with the situation of a submit retiring before the submit ioctl returns. > >

Re: [Freedreno] [PATCH 00/14] drm/msm: de-struct_mutex-ification

2020-10-05 Thread Kristian Høgsberg
On Sun, Oct 4, 2020 at 9:21 PM Rob Clark wrote: > > From: Rob Clark > > This doesn't remove *all* the struct_mutex, but it covers the worst > of it, ie. shrinker/madvise/free/retire. The submit path still uses > struct_mutex, but it still needs *something* serialize a portion of > the submit

Re: [Freedreno] [PATCH 13/14] drm/msm: Drop struct_mutex in shrinker path

2020-10-05 Thread Kristian Høgsberg
On Mon, Oct 5, 2020 at 4:02 PM Daniel Vetter wrote: > > On Mon, Oct 05, 2020 at 05:24:19PM +0800, Hillf Danton wrote: > > > > On Sun, 4 Oct 2020 12:21:45 > > > From: Rob Clark > > > > > > Now that the inactive_list is protected by mm_lock, and everything > > > else on per-obj basis is protected

Re: [Freedreno] [PATCH 13/14] drm/msm: Drop struct_mutex in shrinker path

2020-10-05 Thread Hillf Danton
On Sun, 4 Oct 2020 12:21:45 > From: Rob Clark > > Now that the inactive_list is protected by mm_lock, and everything > else on per-obj basis is protected by obj->lock, we no longer depend > on struct_mutex. > > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/msm/msm_gem.c | 1 -

Re: [Freedreno] [PATCH 2/3] drm/msm: add DRM_MSM_GEM_SYNC_CACHE for non-coherent cache maintenance

2020-10-05 Thread Jonathan Marek
On 10/5/20 4:29 AM, Christoph Hellwig wrote: On Fri, Oct 02, 2020 at 08:46:35AM -0400, Jonathan Marek wrote: +void msm_gem_sync_cache(struct drm_gem_object *obj, uint32_t flags, + size_t range_start, size_t range_end) +{ + struct msm_gem_object *msm_obj = to_msm_bo(obj); + +

Re: [Freedreno] [PATCH 09/14] drm/msm: Drop struct_mutex from the retire path

2020-10-05 Thread Jordan Crouse
On Sun, Oct 04, 2020 at 12:21:41PM -0700, Rob Clark wrote: > From: Rob Clark > > Now that we are not relying on dev->struct_mutex to protect the > ring->submits lists, drop the struct_mutex lock. Reviewed-by: Jordan Crouse > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/msm/msm_gpu.c |

Re: [Freedreno] [PATCH 08/14] drm/msm: Remove obj->gpu

2020-10-05 Thread Jordan Crouse
On Sun, Oct 04, 2020 at 12:21:40PM -0700, Rob Clark wrote: > From: Rob Clark > > It cannot be atomically updated with obj->active_count, and the only > purpose is a useless WARN_ON() (which becomes a buggy WARN_ON() once > retire_submits() is not serialized with incoming submits via >

Re: [Freedreno] [PATCH 07/14] drm/msm: Refcount submits

2020-10-05 Thread Jordan Crouse
On Sun, Oct 04, 2020 at 12:21:39PM -0700, Rob Clark wrote: > From: Rob Clark > > Before we remove dev->struct_mutex from the retire path, we have to deal > with the situation of a submit retiring before the submit ioctl returns. > > To deal with this, ring->submits will hold a reference to the

Re: [Freedreno] [PATCH 06/14] drm/msm: Protect ring->submits with it's own lock

2020-10-05 Thread Jordan Crouse
On Sun, Oct 04, 2020 at 12:21:38PM -0700, Rob Clark wrote: > From: Rob Clark > > One less place to rely on dev->struct_mutex. > Reviewed-by: Jordan Crouse > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/msm/msm_gem_submit.c | 2 ++ > drivers/gpu/drm/msm/msm_gpu.c| 37

Re: [Freedreno] [PATCH 05/14] drm/msm: Document and rename preempt_lock

2020-10-05 Thread Jordan Crouse
On Sun, Oct 04, 2020 at 12:21:37PM -0700, Rob Clark wrote: > From: Rob Clark > > Before adding another lock, give ring->lock a more descriptive name. Reviewed-by: Jordan Crouse > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 4 ++-- >

Re: [Freedreno] [PATCH 04/14] drm/msm: Add priv->mm_lock to protect active/inactive lists

2020-10-05 Thread Jordan Crouse
On Sun, Oct 04, 2020 at 12:21:36PM -0700, Rob Clark wrote: > From: Rob Clark > > Rather than relying on the big dev->struct_mutex hammer, introduce a > more specific lock for protecting the bo lists. Most excellent. Reviewed-by: Jordan Crouse > Signed-off-by: Rob Clark > --- >

Re: [Freedreno] [PATCH 03/14] drm/msm: Move update_fences()

2020-10-05 Thread Jordan Crouse
On Sun, Oct 04, 2020 at 12:21:35PM -0700, Rob Clark wrote: > From: Rob Clark > > Small cleanup, update_fences() is used in the hangcheck path, but also > in the normal retire path. Reviewed-by: Jordan Crouse > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/msm/msm_gpu.c | 28

Re: [Freedreno] [PATCH 02/14] drm/msm: Drop chatty trace

2020-10-05 Thread Jordan Crouse
On Sun, Oct 04, 2020 at 12:21:34PM -0700, Rob Clark wrote: > From: Rob Clark > > It is somewhat redundant with the gpu tracepoints, and anyways not too > useful to justify spamming the log when debug traces are enabled. Reviewed-by: Jordan Crouse > Signed-off-by: Rob Clark > --- >

Re: [Freedreno] [PATCH 13/14] drm/msm: Drop struct_mutex in shrinker path

2020-10-05 Thread Daniel Vetter
On Mon, Oct 05, 2020 at 05:24:19PM +0800, Hillf Danton wrote: > > On Sun, 4 Oct 2020 12:21:45 > > From: Rob Clark > > > > Now that the inactive_list is protected by mm_lock, and everything > > else on per-obj basis is protected by obj->lock, we no longer depend > > on struct_mutex. > > > >

Re: [Freedreno] [PATCH 07/14] drm/msm: Refcount submits

2020-10-05 Thread Daniel Vetter
On Sun, Oct 04, 2020 at 12:21:39PM -0700, Rob Clark wrote: > From: Rob Clark > > Before we remove dev->struct_mutex from the retire path, we have to deal > with the situation of a submit retiring before the submit ioctl returns. > > To deal with this, ring->submits will hold a reference to the

Re: [Freedreno] [PATCH 2/3] drm/msm: add DRM_MSM_GEM_SYNC_CACHE for non-coherent cache maintenance

2020-10-05 Thread Christoph Hellwig
On Fri, Oct 02, 2020 at 08:46:35AM -0400, Jonathan Marek wrote: > > > +void msm_gem_sync_cache(struct drm_gem_object *obj, uint32_t flags, > > > + size_t range_start, size_t range_end) > > > +{ > > > + struct msm_gem_object *msm_obj = to_msm_bo(obj); > > > + > > > + /* TODO: sync only the

Re: [Freedreno] [PATCH V2 3/8] drm/msm: Unconditionally call dev_pm_opp_of_remove_table()

2020-10-05 Thread Viresh Kumar
On 28-08-20, 11:37, Viresh Kumar wrote: > dev_pm_opp_of_remove_table() doesn't report any errors when it fails to > find the OPP table with error -ENODEV (i.e. OPP table not present for > the device). And we can call dev_pm_opp_of_remove_table() > unconditionally here. > > While at it, also