From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D42ACC4363A for ; Fri, 23 Oct 2020 12:38:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E2C4208C3 for ; Fri, 23 Oct 2020 12:38:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="RkCvgzq5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E2C4208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B5EB46F630; Fri, 23 Oct 2020 12:38:56 +0000 (UTC) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 391EB6F63C for ; Fri, 23 Oct 2020 12:38:56 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id h5so1633778wrv.7 for ; Fri, 23 Oct 2020 05:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ygIUgxo0dh1fuykJKpg3w3uVxDyWun73vgGJ+UyorVM=; b=RkCvgzq5Wl4TKO2Csa1YBhuATycNpqqIEFZXgImCY20g+qVFLmMzuStdXaKDKKfZ54 EWrbA2C0M4vPN5amconmnxSHjvh1YQDDGsWPbhmeyTLcTrvYFwJPsyufHGl0mX5Zj02H oQmqVMcoAoB1DljW1+yo84XiwYn1e+7ah5mpY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ygIUgxo0dh1fuykJKpg3w3uVxDyWun73vgGJ+UyorVM=; b=QMgt0sSZ8hyFHqmF0ZsvrjKHQKZeD3kyOhpuY5V1/35F3+YRvi/reYzIunSDneRnH0 PYzH0aHQJ3BNjZtBQTjHFBpJ6krdTqeE3BUhHB1zfV/34bZ0QPXGbMFBe0YOAuE8Zzc1 ITQQtU94H1Vn/EeUbSil/NEOhO9vywYqLP4VMRH2uPe5YSrv3mwt8mEOTjtWce1N8LyB 27BqprDRcUDhfxSSrUnhIEBRmhxWU8aLCrFvQmkUqRQDOhEROwAls/ovpdfzFU9PvU3C JgK44NnME+uO9tiBqxY6zzUyH95WHe6KwXMhWx7xEyi8aQPO/YrPRAnku52fBiAjSSs9 2QSQ== X-Gm-Message-State: AOAM532KSF+UTXdfL/YLcmiwo4haawvEa9fsJMs+U4CcbcTjU3LBeNNI /AYz+dJbGBxsg3iACOX5DftwyQ== X-Google-Smtp-Source: ABdhPJyyrNZS7i3TIK8i5QX5lqL5cGVtaMaql3xV3Pv00BOmYVhRchbZFDh/At5+TrbySPjoE6TYZg== X-Received: by 2002:a5d:60c4:: with SMTP id x4mr2565075wrt.175.1603456734866; Fri, 23 Oct 2020 05:38:54 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l8sm3076401wrn.28.2020.10.23.05.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 05:38:53 -0700 (PDT) Date: Fri, 23 Oct 2020 14:38:51 +0200 From: Daniel Vetter To: Ben Skeggs Subject: Re: [Nouveau] [PATCH] drm/nouveau: Drop mutex_lock_nested for atomic Message-ID: <20201023123851.GD401619@phenom.ffwll.local> References: <20200802181849.1586281-1-daniel.vetter@ffwll.ch> <579702ca-4b4e-0b05-1b93-25b99554d464@linux.intel.com> <20200930093735.GT438822@phenom.ffwll.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.7.0-1-amd64 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maarten Lankhorst , Nouveau Dev , DRI Development , Ben Skeggs , Daniel Vetter , Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Oct 01, 2020 at 08:46:59AM +1000, Ben Skeggs wrote: > On Wed, 30 Sep 2020 at 19:37, Daniel Vetter wrote: > > > > On Wed, Sep 30, 2020 at 10:45:05AM +1000, Ben Skeggs wrote: > > > On Wed, 30 Sep 2020 at 00:52, Daniel Vetter wrote: > > > > > > > > On Thu, Sep 17, 2020 at 3:15 PM Daniel Vetter wrote: > > > > > > > > > > Ben, did you have a chance to look at this? > > > > > > > > Ping > > > > -Daniel > > > > > > > > > On Mon, Aug 3, 2020 at 1:22 PM Maarten Lankhorst > > > > > wrote: > > > > > > > > > > > > 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@lists.freedesktop.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 > > > Acked-by: Ben Skeggs > > > > Can you pull this in through your tree and maybe give it a spin just to > > make sure? I don't really have nouveau hardware here. > Yeah, I can do that easily enough. Hi Ben, I'm still hanging on this one, doesn't seem to have made it into drm-next. Got lost or still somewhere in a queue? Thanks, Daniel > > Ben. > > > > > Also it's entirely stand-alone, I was simply reviewing all the > > mutex_lock_nested we have in drm, and this one stuck out as probably not > > necessary anymore, at least with atomic. > > > > I guess I can also just stuff it into drm-misc-next and if it blows up, > > figure out what to do then :-) > > -Daniel > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Daniel Vetter > > > > > Software Engineer, Intel Corporation > > > > > http://blog.ffwll.ch > > > > > > > > > > > > > > > > -- > > > > Daniel Vetter > > > > Software Engineer, Intel Corporation > > > > http://blog.ffwll.ch > > > > _______________________________________________ > > > > Nouveau mailing list > > > > Nouveau@lists.freedesktop.org > > > > https://lists.freedesktop.org/mailman/listinfo/nouveau > > > > -- > > Daniel Vetter > > Software Engineer, Intel Corporation > > http://blog.ffwll.ch -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel