mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
dma-buf/sw-sync: Fix locking around sync_timeline lists
The sync_pt were not adding themselves atomically to the timeline lists, corruption imminent. Only a single list is required to track the unsignaled sync_pt, so reduce it and rename the lock more appropriately along with using idiomatic names to distinguish a list from links along it. v2: Prevent spinlock recursion on free during create (next patch) and fixup crossref in kerneldoc Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: Sean Paul <seanpaul@chromium.org> Cc: Gustavo Padovan <gustavo@padovan.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170629210532.5617-1-chris@chris-wilson.co.uk
This commit is contained in:
parent
3b52ce44e7
commit
d3862e44da
3 changed files with 31 additions and 47 deletions
|
@ -119,13 +119,12 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
|
|||
|
||||
seq_printf(s, "%s: %d\n", obj->name, obj->value);
|
||||
|
||||
spin_lock_irq(&obj->child_list_lock);
|
||||
list_for_each(pos, &obj->child_list_head) {
|
||||
struct sync_pt *pt =
|
||||
container_of(pos, struct sync_pt, child_list);
|
||||
spin_lock_irq(&obj->lock);
|
||||
list_for_each(pos, &obj->pt_list) {
|
||||
struct sync_pt *pt = container_of(pos, struct sync_pt, link);
|
||||
sync_print_fence(s, &pt->base, false);
|
||||
}
|
||||
spin_unlock_irq(&obj->child_list_lock);
|
||||
spin_unlock_irq(&obj->lock);
|
||||
}
|
||||
|
||||
static void sync_print_sync_file(struct seq_file *s,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue