diff options
author | Inki Dae <inki.dae@samsung.com> | 2014-11-27 20:09:08 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-27 04:44:45 -0800 |
commit | 6cacffa8e7643777d854b272d6789edfe9048138 (patch) | |
tree | 2fd935b9e79638b2d920fadab4c5f1f1d7e94515 | |
parent | ff43841d1fb266469f73ca7dc6d7a51d4b18bbbe (diff) | |
download | linux-3.10-accepted/tizen/mobile/20141201.013959.tar.gz linux-3.10-accepted/tizen/mobile/20141201.013959.tar.bz2 linux-3.10-accepted/tizen/mobile/20141201.013959.zip |
dma-buf/dmabuf-sync: fix referece droppingsubmit/tizen/20141127.130559accepted/tizen/mobile/20141201.013959accepted/tizen/common/20141127.143546
Cancel fence free worker if there is no any task or dma device.
And do not drop a reference of dmabuf at fence free worker,
which is over-dropping.
Change-Id: Ib7378d4efc68a8f7ee7a161296f6a9c0e78f77a7
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/dma-buf/dmabuf-sync.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/dma-buf/dmabuf-sync.c b/drivers/dma-buf/dmabuf-sync.c index d654669afc9..94eb5ad9d6e 100644 --- a/drivers/dma-buf/dmabuf-sync.c +++ b/drivers/dma-buf/dmabuf-sync.c @@ -497,8 +497,6 @@ static void fence_free_worker_handler(unsigned long data) if (atomic_read(&fence_excl->refcount.refcount) > 0) fence_put(fence_excl); } - - dma_buf_put(dmabuf); } static void setup_fence_free_worker(struct dmabuf_sync_object *sobj) @@ -917,8 +915,11 @@ int dmabuf_sync_signal_all(struct dmabuf_sync *sync) * if any task then a reference of this fence will be dropped * by that the task calls dmabuf_sync_update() after waked up. */ - if (list_empty(&fence->cb_list)) + if (list_empty(&fence->cb_list)) { fence_put(fence); + /* Cancel fence free worker if no any task. */ + cancel_fence_free_worker(sobj); + } ret = fence_signal_locked(fence); if (ret) { @@ -970,8 +971,11 @@ static int dmabuf_sync_signal_fence(struct fence *fence) * if any task then a reference of this fence will be dropped * by that the task calls dmabuf_sync_update() after waked up. */ - if (list_empty(&fence->cb_list)) + if (list_empty(&fence->cb_list)) { fence_put(fence); + /* Cancel fence free worker if no any task. */ + cancel_fence_free_worker(sync->single_sobj); + } ret = fence_signal_locked(fence); if (ret) |