lkml.org 
[lkml]   [2012]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dma-buf: add reference counting for exporter module
Hi Laurent,

On 08/08/2012 03:35 PM, Laurent Pinchart wrote:
> Hi Tomasz,
>
> Thanks for the patch.
>
> On Wednesday 08 August 2012 12:17:41 Tomasz Stanislawski wrote:
>> This patch adds reference counting on a module that exports dma-buf and
>> implements its operations. This prevents the module from being unloaded
>> while DMABUF file is in use.
>>
>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
>> ---
>> Documentation/dma-buf-sharing.txt | 3 ++-
>> drivers/base/dma-buf.c | 10 +++++++++-
>> drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | 1 +
>> drivers/gpu/drm/i915/i915_gem_dmabuf.c | 1 +
>> drivers/gpu/drm/nouveau/nouveau_prime.c | 1 +
>> drivers/gpu/drm/radeon/radeon_prime.c | 1 +
>> drivers/staging/omapdrm/omap_gem_dmabuf.c | 1 +
>> include/linux/dma-buf.h | 2 ++
>> 8 files changed, 18 insertions(+), 2 deletions(-)
>>
[snip]

>> @@ -96,6 +98,7 @@ struct dma_buf *dma_buf_export(void *priv, const struct
>> dma_buf_ops *ops, struct file *file;
>>
>> if (WARN_ON(!priv || !ops
>> + || !ops->owner

Thank you for spotting this.
I didn'y know that try_get_module returned true is module was NULL.

BTW. Is it worth to add ".owner = THIS_MODULE," to all dma_buf
exporters in this patch?

Regards,
Tomasz Stanislawski

>
> THIS_MODULE is defined as ((struct module *)0) when the driver is built-in,
> this check should thus be removed.
>
>> || !ops->map_dma_buf
>> || !ops->unmap_dma_buf
>> || !ops->release
>>



\
 
 \ /
  Last update: 2012-08-08 16:22    [W:0.068 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site