From: Erik Gilling Date: Tue, 16 Oct 2012 00:51:01 +0000 (-0700) Subject: sync: update new fence status with sync_fence_signal_pt X-Git-Tag: firefly_0821_release~7555 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2211c1043768596555603eceefd4bd6e7aba97ab;p=firefly-linux-kernel-4.4.55.git 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. Change-Id: Ic8e292a323db26c6f04cb4757d920278b3125ff6 Signed-off-by: Erik Gilling --- diff --git a/drivers/base/sync.c b/drivers/base/sync.c index f05b708b6c85..b35344da4529 100644 --- a/drivers/base/sync.c +++ b/drivers/base/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); @@ -456,7 +462,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: