From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: linaro-mm-sig@lists.linaro.org,
LKML <linux-kernel@vger.kernel.org>,
DRI Development <dri-devel@lists.freedesktop.org>,
linux-media@vger.kernel.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, Dave Airlie <airlied@gmail.com>
Subject: [PATCH] dma-buf: document fd flags and O_CLOEXEC requirement
Date: Mon, 19 Mar 2012 16:41:55 +0100 [thread overview]
Message-ID: <1332171715-1484-1-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <CAPM=9twSZJyYcNwDwaC5eSy7fXNaRBGTZZ6F2K3D8AeQdYtgww@mail.gmail.com>
Otherwise subsystems will get this wrong and end up with a second
export ioctl with the flag and O_CLOEXEC support added.
v2: Fixup the function name and caution exporters to limit the flags
to only O_CLOEXEC. Noted by Dave Airlie.
Cc: Dave Airlie <airlied@gmail.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
Documentation/dma-buf-sharing.txt | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Documentation/dma-buf-sharing.txt b/Documentation/dma-buf-sharing.txt
index 9f3aeef..a6d4c37 100644
--- a/Documentation/dma-buf-sharing.txt
+++ b/Documentation/dma-buf-sharing.txt
@@ -319,6 +319,12 @@ Miscellaneous notes
- Any exporters or users of the dma-buf buffer sharing framework must have
a 'select DMA_SHARED_BUFFER' in their respective Kconfigs.
+- To avoid the wrath of userspace library writers exporting subsystems must have
+ a flag parameter in the ioctl that creates the dma-buf fd which needs to
+ support at least the O_CLOEXEC fd flag. This needs to be passed in the flag
+ parameter of dma_buf_fd. Without any other reasons applying it is recommended
+ that exporters limit the flags passed to dma_buf_fd to only O_CLOEXEC.
+
References:
[1] struct dma_buf_ops in include/linux/dma-buf.h
[2] All interfaces mentioned above defined in include/linux/dma-buf.h
--
1.7.7.5
next prev parent reply other threads:[~2012-03-19 15:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-18 23:34 [PATCH 1/4] dma-buf: don't hold the mutex around map/unmap calls Daniel Vetter
2012-03-18 23:34 ` [PATCH 2/4] dma-buf: add support for kernel cpu access Daniel Vetter
2012-03-19 2:00 ` Rob Clark
2012-03-19 23:02 ` [PATCH] " Daniel Vetter
2012-03-22 6:03 ` [Linaro-mm-sig] " Sumit Semwal
2012-03-18 23:34 ` [PATCH 3/4] dma_buf: Add documentation for the new cpu access support Daniel Vetter
2012-03-19 1:54 ` Rob Clark
2012-03-22 6:04 ` [Linaro-mm-sig] " Sumit Semwal
2012-03-18 23:34 ` [PATCH 4/4] dma-buf: document fd flags and O_CLOEXEC requirement Daniel Vetter
2012-03-19 10:51 ` [Linaro-mm-sig] " Dave Airlie
2012-03-19 15:41 ` Daniel Vetter [this message]
2012-03-19 15:44 ` [PATCH] " Ville Syrjälä
2012-03-22 6:03 ` [Linaro-mm-sig] [PATCH 1/4] dma-buf: don't hold the mutex around map/unmap calls Sumit Semwal
2012-03-19 21:42 [PATCH] dma-buf: document fd flags and O_CLOEXEC requirement Rob Clark
2012-03-22 6:05 ` 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=1332171715-1484-1-git-send-email-daniel.vetter@ffwll.ch \
--to=daniel.vetter@ffwll.ch \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/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
all inboxes | Powered by JetHome®