From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH] dma-fence: fix dma_fence_get_rcu_safe Date: Thu, 21 Sep 2017 09:00:34 +0200 Message-ID: <7f14fc7c-2d56-598b-5049-0155df8327e4@amd.com> References: <1504531653-13779-1-git-send-email-deathsimple@vodafone.de> <150453243791.23157.6907537389223890207@mail.alporthouse.com> <67fe7e05-7743-40c8-558b-41b08eb986e9@amd.com> <150512037119.16759.472484663447331384@mail.alporthouse.com> <3c412ee3-854a-292a-e036-7c5fd7888979@amd.com> <150512178199.16759.73667469529688@mail.alporthouse.com> <5ff4b100-b580-a93d-aa5e-c66173ac091d@amd.com> <150512410278.16759.10537429613477592631@mail.alporthouse.com> <79e447f8-f2e3-57e3-b5fe-503e5feb2f82@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-media-owner@vger.kernel.org To: Daniel Vetter Cc: Chris Wilson , Daniel Vetter , Sumit Semwal , "linux-media@vger.kernel.org" , dri-devel , "linaro-mm-sig@lists.linaro.org" , Maarten Lankhorst , Gustavo Padovan , Joonas Lahtinen , Tvrtko Ursulin List-Id: dri-devel@lists.freedesktop.org Am 20.09.2017 um 20:20 schrieb Daniel Vetter: > On Mon, Sep 11, 2017 at 01:06:32PM +0200, Christian König wrote: >> Am 11.09.2017 um 12:01 schrieb Chris Wilson: >>> [SNIP] >>>> Yeah, but that is illegal with a fence objects. >>>> >>>> When anybody allocates fences this way it breaks at least >>>> reservation_object_get_fences_rcu(), >>>> reservation_object_wait_timeout_rcu() and >>>> reservation_object_test_signaled_single(). >>> Many, many months ago I sent patches to fix them all. >> Found those after a bit a searching. Yeah, those patches where proposed more >> than a year ago, but never pushed upstream. >> >> Not sure if we really should go this way. dma_fence objects are shared >> between drivers and since we can't judge if it's the correct fence based on >> a criteria in the object (only the read counter which is outside) all >> drivers need to be correct for this. >> >> I would rather go the way and change dma_fence_release() to wrap >> fence->ops->release into call_rcu() to keep the whole RCU handling outside >> of the individual drivers. > Hm, I entirely dropped the ball on this, I kinda assumed that we managed > to get some agreement on this between i915 and dma_fence. Adding a pile > more people. For the meantime I've send a v2 of this patch to fix at least the buggy return of NULL when we fail to grab the RCU reference but keeping the extra checking for now. Can I get an rb on this please so that we fix at least the bug at hand? Thanks, Christian. > > Joonas, Tvrtko, I guess we need to fix this one way or the other. > -Daniel