diff options
author | Erik Gilling <konkers@android.com> | 2013-03-01 00:43:19 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-04 09:46:54 (GMT) |
commit | eeb2f571639feedcfce3f1718b0c3fd85d796812 (patch) | |
tree | ce9e610b96dc94c354e757d8a0368361ae2119fb /drivers/staging/android/sync.c | |
parent | c679212dbfd060513e156133326122bf9f496579 (diff) | |
download | linux-fsl-qoriq-eeb2f571639feedcfce3f1718b0c3fd85d796812.tar.xz |
staging: sync: Update new fence status with sync_fence_signal_pt
If a fence's pt is signaled before sync_fence_create is called, the fence
will never transition into the signaled state. This also address a tiny
race if a merged fence's pt after sync_fence_get_status checks it's status
and before fence->status is updated.
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rob Clark <robclark@gmail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: dri-devel@lists.freedesktop.org
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Erik Gilling <konkers@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/sync.c')
-rw-r--r-- | drivers/staging/android/sync.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index 2394189..889ca6e 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -295,6 +295,12 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) list_add(&pt->pt_list, &fence->pt_list_head); sync_pt_activate(pt); + /* + * signal the fence in case pt was activated before + * sync_pt_activate(pt) was called + */ + sync_fence_signal_pt(pt); + return fence; } EXPORT_SYMBOL(sync_fence_create); @@ -457,7 +463,13 @@ struct sync_fence *sync_fence_merge(const char *name, if (err < 0) goto err; - fence->status = sync_fence_get_status(fence); + /* + * signal the fence in case one of it's pts were activated before + * they were activated + */ + sync_fence_signal_pt(list_first_entry(&fence->pt_list_head, + struct sync_pt, + pt_list)); return fence; err: |