From: Maarten Lankhorst Subject: Re: [PATCH] drm/nouveau: Drop mutex_lock_nested for atomic Date: Mon, 3 Aug 2020 13:22:36 +0200 Message-ID: <579702ca-4b4e-0b05-1b93-25b99554d464@linux.intel.com> References: <20200802181849.1586281-1-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20200802181849.1586281-1-daniel.vetter-/w4YWyX8dFk@public.gmane.org> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: Daniel Vetter , DRI Development Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, Daniel Vetter , Ben Skeggs , Maarten Lankhorst List-Id: nouveau.vger.kernel.org Op 02-08-2020 om 20:18 schreef Daniel Vetter: > Purely conjecture, but I think the original locking inversion with the > legacy page flip code between flipping and ttm's bo move function > shoudn't exist anymore with atomic: With atomic the bo pinning and > actual modeset commit is completely separated in the code patsh. > > This annotation was originally added in > > commit 060810d7abaabcab282e062c595871d661561400 > Author: Ben Skeggs > Date: Mon Jul 8 14:15:51 2013 +1000 > > drm/nouveau: fix locking issues in page flipping paths > > due to > > commit b580c9e2b7ba5030a795aa2fb73b796523d65a78 > Author: Maarten Lankhorst > Date: Thu Jun 27 13:48:18 2013 +0200 > > drm/nouveau: make flipping lockdep safe > > Signed-off-by: Daniel Vetter > Cc: Maarten Lankhorst > Cc: Ben Skeggs > Cc: Dave Airlie > Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > --- > I might be totally wrong, so this definitely needs testing :-) > > Cheers, Daniel > --- > drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c > index 7806278dce57..a7b2a9bb0ffe 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_bo.c > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c > @@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, > return ret; > } > > - mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING); > + if (drm_drv_uses_atomic_modeset(drm->dev)) > + mutex_lock(&cli->mutex); > + else > + mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING); > + > ret = nouveau_fence_sync(nouveau_bo(bo), chan, true, intr); > if (ret == 0) { > ret = drm->ttm.move(chan, bo, &bo->mem, new_reg); Well if you're certain it works now. :) Reviewed-by: Maarten Lankhorst