public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Stanislawski <t.stanislaws@samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	devel@driverdev.osuosl.org, Pawel Osciak <pawel@osciak.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jerome Glisse <jglisse@redhat.com>,
	Vinod Koul <vinod.koul@intel.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Rob Landley <rob@landley.net>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Alex Deucher <alexander.deucher@amd.com>, Rob Clark <rob@ti.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] dma-buf: add reference counting for exporter module
Date: Wed, 08 Aug 2012 15:53:10 +0200	[thread overview]
Message-ID: <50226F46.3080800@samsung.com> (raw)
In-Reply-To: <1404275.atroogfRqe@avalon>

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
>>


  reply	other threads:[~2012-08-08 13:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 10:17 [PATCH] dma-buf: add reference counting for exporter module Tomasz Stanislawski
2012-08-08 13:35 ` Laurent Pinchart
2012-08-08 13:53   ` Tomasz Stanislawski [this message]
2012-08-08 14:06     ` Daniel Vetter
2012-08-09  5:32       ` Sumit Semwal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50226F46.3080800@samsung.com \
    --to=t.stanislaws@samsung.com \
    --cc=alexander.deucher@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jglisse@redhat.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.com \
    --cc=rob@landley.net \
    --cc=rob@ti.com \
    --cc=sumit.semwal@linaro.org \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox