aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/dma-buf.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-03-18 19:34:25 -0400
committerSumit Semwal <sumit.semwal@ti.com>2012-03-26 02:02:50 -0400
commit6b607e3a658fee490bdabfdeb739a3eb498b1bff (patch)
treea10ad6f713586f9dc7584fe54110d1c44f87b1d5 /drivers/base/dma-buf.c
parentf9a24d1ac9cb82baf5ec5efdb6580a9ce0bd5bfc (diff)
dma-buf: don't hold the mutex around map/unmap calls
The mutex protects the attachment list and hence needs to be held around the callbakc to the exporters (optional) attach/detach functions. Holding the mutex around the map/unmap calls doesn't protect any dma_buf state. Exporters need to properly protect any of their own state anyway (to protect against calls from their own interfaces). So this only makes the locking messier (and lockdep easier to anger). Therefore let's just drop this. v2: Rebased on top of latest dma-buf-next git. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Rob Clark <rob.clark@linaro.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Diffstat (limited to 'drivers/base/dma-buf.c')
-rw-r--r--drivers/base/dma-buf.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index 3c8c0232ce43..5641b9c8d50c 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -258,9 +258,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
258 if (WARN_ON(!attach || !attach->dmabuf)) 258 if (WARN_ON(!attach || !attach->dmabuf))
259 return ERR_PTR(-EINVAL); 259 return ERR_PTR(-EINVAL);
260 260
261 mutex_lock(&attach->dmabuf->lock);
262 sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction); 261 sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction);
263 mutex_unlock(&attach->dmabuf->lock);
264 262
265 return sg_table; 263 return sg_table;
266} 264}
@@ -282,10 +280,7 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
282 if (WARN_ON(!attach || !attach->dmabuf || !sg_table)) 280 if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
283 return; 281 return;
284 282
285 mutex_lock(&attach->dmabuf->lock);
286 attach->dmabuf->ops->unmap_dma_buf(attach, sg_table, 283 attach->dmabuf->ops->unmap_dma_buf(attach, sg_table,
287 direction); 284 direction);
288 mutex_unlock(&attach->dmabuf->lock);
289
290} 285}
291EXPORT_SYMBOL_GPL(dma_buf_unmap_attachment); 286EXPORT_SYMBOL_GPL(dma_buf_unmap_attachment);