Message ID | 20180122193239.7674-1-christian.koenig@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Could you please make sure to add Cc: stable@vger.kernel.org for this? This is causing crashing of wayland sessions on Fedora so we should definitely get this into stable. Other then that: Tested-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> On Mon, 2018-01-22 at 20:32 +0100, Christian König wrote: > We need to set shared_count even if we already have a fence to wait for. > > Signed-off-by: Christian König <christian.koenig@amd.com> > --- > drivers/dma-buf/reservation.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c > index 461afa9febd4..649c0cebf5b1 100644 > --- a/drivers/dma-buf/reservation.c > +++ b/drivers/dma-buf/reservation.c > @@ -506,14 +506,14 @@ long reservation_object_wait_timeout_rcu(struct > reservation_object *obj, > fence = NULL; > } > > - if (!fence && wait_all) { > + if (wait_all) { > struct reservation_object_list *fobj = > rcu_dereference(obj- > >fence); > > if (fobj) > shared_count = fobj->shared_count; > > - for (i = 0; i < shared_count; ++i) { > + for (i = 0; !fence && i < shared_count; ++i) { > struct dma_fence *lfence = rcu_dereference(fobj- > >shared[i]); > > if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
Quoting Christian König (2018-01-22 19:32:39)
> We need to set shared_count even if we already have a fence to wait for.
You mean for the
if (ret > 0 && wait_all && (i + 1 < shared_count)
clause.
In the case of having the exclusive fence, i=0 (erm, once), but
shared_count may still be just 1 and so we still fail to wait for the
shared fence in addition to the exclusive fence.
-Chris
Am 22.01.2018 um 20:42 schrieb Lyude Paul: > Could you please make sure to add Cc: stable@vger.kernel.org for this? Sure, just pushed into our upstream branch. Alex can you pick that up for your next drm-fixes pull request? Sorry for the noise, Christian. > This is > causing crashing of wayland sessions on Fedora so we should definitely get > this into stable. > > Other then that: > > Tested-by: Lyude Paul <lyude@redhat.com> > Reviewed-by: Lyude Paul <lyude@redhat.com> > > On Mon, 2018-01-22 at 20:32 +0100, Christian König wrote: >> We need to set shared_count even if we already have a fence to wait for. >> >> Signed-off-by: Christian König <christian.koenig@amd.com> >> --- >> drivers/dma-buf/reservation.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c >> index 461afa9febd4..649c0cebf5b1 100644 >> --- a/drivers/dma-buf/reservation.c >> +++ b/drivers/dma-buf/reservation.c >> @@ -506,14 +506,14 @@ long reservation_object_wait_timeout_rcu(struct >> reservation_object *obj, >> fence = NULL; >> } >> >> - if (!fence && wait_all) { >> + if (wait_all) { >> struct reservation_object_list *fobj = >> rcu_dereference(obj- >>> fence); >> >> if (fobj) >> shared_count = fobj->shared_count; >> >> - for (i = 0; i < shared_count; ++i) { >> + for (i = 0; !fence && i < shared_count; ++i) { >> struct dma_fence *lfence = rcu_dereference(fobj- >>> shared[i]); >> >> if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
Am 22.01.2018 um 20:47 schrieb Chris Wilson: > Quoting Christian König (2018-01-22 19:32:39) >> We need to set shared_count even if we already have a fence to wait for. > You mean for the > > if (ret > 0 && wait_all && (i + 1 < shared_count) > > clause. > > In the case of having the exclusive fence, i=0 (erm, once), but > shared_count may still be just 1 and so we still fail to wait for the > shared fence in addition to the exclusive fence. Ah, crap. Good point. V2 is on the list, please take a look. Thanks, Christian. > -Chris
diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c index 461afa9febd4..649c0cebf5b1 100644 --- a/drivers/dma-buf/reservation.c +++ b/drivers/dma-buf/reservation.c @@ -506,14 +506,14 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj, fence = NULL; } - if (!fence && wait_all) { + if (wait_all) { struct reservation_object_list *fobj = rcu_dereference(obj->fence); if (fobj) shared_count = fobj->shared_count; - for (i = 0; i < shared_count; ++i) { + for (i = 0; !fence && i < shared_count; ++i) { struct dma_fence *lfence = rcu_dereference(fobj->shared[i]); if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
We need to set shared_count even if we already have a fence to wait for. Signed-off-by: Christian König <christian.koenig@amd.com> --- drivers/dma-buf/reservation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)