<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/base/dma-buf.c, branch linux-3.13.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>dma-buf: Expose buffer size to userspace (v2)</title>
<updated>2013-09-10T06:06:45+00:00</updated>
<author>
<name>Christopher James Halse Rogers</name>
<email>christopher.halse.rogers@canonical.com</email>
</author>
<published>2013-09-10T06:06:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=19e8697ba45e7bcdb04f2adf6110fbf4882863e5'/>
<id>19e8697ba45e7bcdb04f2adf6110fbf4882863e5</id>
<content type='text'>
Each dma-buf has an associated size and it's reasonable for userspace
to want to know what it is.

Since userspace already has an fd, expose the size using the
size = lseek(fd, SEEK_END, 0); lseek(fd, SEEK_CUR, 0);
idiom.

v2: Added Daniel's sugeested documentation, with minor fixups

Signed-off-by: Christopher James Halse Rogers &lt;christopher.halse.rogers@canonical.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Tested-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Each dma-buf has an associated size and it's reasonable for userspace
to want to know what it is.

Since userspace already has an fd, expose the size using the
size = lseek(fd, SEEK_END, 0); lseek(fd, SEEK_CUR, 0);
idiom.

v2: Added Daniel's sugeested documentation, with minor fixups

Signed-off-by: Christopher James Halse Rogers &lt;christopher.halse.rogers@canonical.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Tested-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-buf: Check return value of anon_inode_getfile</title>
<updated>2013-09-10T05:59:21+00:00</updated>
<author>
<name>Tuomas Tynkkynen</name>
<email>ttynkkynen@nvidia.com</email>
</author>
<published>2013-08-27T13:30:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9022e24e8946400d53719a761815069c3183e2bd'/>
<id>9022e24e8946400d53719a761815069c3183e2bd</id>
<content type='text'>
anon_inode_getfile might fail, so check its return value.

Signed-off-by: Tuomas Tynkkynen &lt;ttynkkynen@nvidia.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
anon_inode_getfile might fail, so check its return value.

Signed-off-by: Tuomas Tynkkynen &lt;ttynkkynen@nvidia.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-buf: Replace PTR_RET with PTR_ERR_OR_ZERO</title>
<updated>2013-07-16T06:36:01+00:00</updated>
<author>
<name>Sachin Kamat</name>
<email>sachin.kamat@linaro.org</email>
</author>
<published>2013-07-15T10:21:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=28ce42013c55339a35c669e534fc1200f42253d7'/>
<id>28ce42013c55339a35c669e534fc1200f42253d7</id>
<content type='text'>
PTR_RET is now deprecated. Use PTR_ERR_OR_ZERO instead.

Signed-off-by: Sachin Kamat &lt;sachin.kamat@linaro.org&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PTR_RET is now deprecated. Use PTR_ERR_OR_ZERO instead.

Signed-off-by: Sachin Kamat &lt;sachin.kamat@linaro.org&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[media] dma-buf: Cocci spatch "ptr_ret.spatch"</title>
<updated>2013-06-08T23:00:29+00:00</updated>
<author>
<name>Thomas Meyer</name>
<email>thomas@m3y3r.de</email>
</author>
<published>2013-06-01T08:53:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=703e60655ca520c5380d8c83a9db0d5e9b906856'/>
<id>703e60655ca520c5380d8c83a9db0d5e9b906856</id>
<content type='text'>
Signed-off-by: Thomas Meyer &lt;thomas@m3y3r.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thomas Meyer &lt;thomas@m3y3r.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-buf: Add debugfs support</title>
<updated>2013-05-01T11:06:22+00:00</updated>
<author>
<name>Sumit Semwal</name>
<email>sumit.semwal@linaro.org</email>
</author>
<published>2013-04-04T06:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b89e35636bc75b72d15a1af6d49798802aff77d5'/>
<id>b89e35636bc75b72d15a1af6d49798802aff77d5</id>
<content type='text'>
Add debugfs support to make it easier to print debug information
about the dma-buf buffers.

Cc: Dave Airlie &lt;airlied@redhat.com&gt;
 [minor fixes on init and warning fix]
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
 [remove double unlock in fail case]
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add debugfs support to make it easier to print debug information
about the dma-buf buffers.

Cc: Dave Airlie &lt;airlied@redhat.com&gt;
 [minor fixes on init and warning fix]
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
 [remove double unlock in fail case]
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-buf: replace dma_buf_export() with dma_buf_export_named()</title>
<updated>2013-05-01T11:05:36+00:00</updated>
<author>
<name>Sumit Semwal</name>
<email>sumit.semwal@linaro.org</email>
</author>
<published>2013-03-22T12:52:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=78df969550e7187f4dcd70b737217dcbc8e9a06a'/>
<id>78df969550e7187f4dcd70b737217dcbc8e9a06a</id>
<content type='text'>
For debugging purposes, it is useful to have a name-string added
while exporting buffers. Hence, dma_buf_export() is replaced with
dma_buf_export_named(), which additionally takes 'exp_name' as a
parameter.

For backward compatibility, and for lazy exporters who don't wish to
name themselves, a #define dma_buf_export() is also made available,
which adds a __FILE__ instead of 'exp_name'.

Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
  [Thanks for the idea!]
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For debugging purposes, it is useful to have a name-string added
while exporting buffers. Hence, dma_buf_export() is replaced with
dma_buf_export_named(), which additionally takes 'exp_name' as a
parameter.

For backward compatibility, and for lazy exporters who don't wish to
name themselves, a #define dma_buf_export() is also made available,
which adds a __FILE__ instead of 'exp_name'.

Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
  [Thanks for the idea!]
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>CHROMIUM: dma-buf: restore args on failure of dma_buf_mmap</title>
<updated>2013-02-27T09:44:02+00:00</updated>
<author>
<name>John Sheu</name>
<email>sheu@google.com</email>
</author>
<published>2013-02-12T01:50:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=495c10cc1c0c359871d5bef32dd173252fc17995'/>
<id>495c10cc1c0c359871d5bef32dd173252fc17995</id>
<content type='text'>
Callers to dma_buf_mmap expect to fput() the vma struct's vm_file
themselves on failure.  Not restoring the struct's data on failure
causes a double-decrement of the vm_file's refcount.

Signed-off-by: John Sheu &lt;sheu@google.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Callers to dma_buf_mmap expect to fput() the vma struct's vm_file
themselves on failure.  Not restoring the struct's data on failure
causes a double-decrement of the vm_file's refcount.

Signed-off-by: John Sheu &lt;sheu@google.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-buf: implement vmap refcounting in the interface logic</title>
<updated>2013-02-27T09:43:36+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2012-12-20T13:14:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f00b4dad9d9eb001a04cf72e8351a2a1b9e99322'/>
<id>f00b4dad9d9eb001a04cf72e8351a2a1b9e99322</id>
<content type='text'>
All drivers which implement this need to have some sort of refcount to
allow concurrent vmap usage. Hence implement this in the dma-buf core.

To protect against concurrent calls we need a lock, which potentially
causes new funny locking inversions. But this shouldn't be a problem
for exporters with statically allocated backing storage, and more
dynamic drivers have decent issues already anyway.

Inspired by some refactoring patches from Aaron Plattner, who
implemented the same idea, but only for drm/prime drivers.

v2: Check in dma_buf_release that no dangling vmaps are left.
Suggested by Aaron Plattner. We might want to do similar checks for
attachments, but that's for another patch. Also fix up ERR_PTR return
for vmap.

v3: Check whether the passed-in vmap address matches with the cached
one for vunmap. Eventually we might want to remove that parameter -
compared to the kmap functions there's no need for the vaddr for
unmapping.  Suggested by Chris Wilson.

v4: Fix a brown-paper-bag bug spotted by Aaron Plattner.

Cc: Aaron Plattner &lt;aplattner@nvidia.com&gt;
Reviewed-by: Aaron Plattner &lt;aplattner@nvidia.com&gt;
Tested-by: Aaron Plattner &lt;aplattner@nvidia.com&gt;
Reviewed-by: Rob Clark &lt;rob@ti.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All drivers which implement this need to have some sort of refcount to
allow concurrent vmap usage. Hence implement this in the dma-buf core.

To protect against concurrent calls we need a lock, which potentially
causes new funny locking inversions. But this shouldn't be a problem
for exporters with statically allocated backing storage, and more
dynamic drivers have decent issues already anyway.

Inspired by some refactoring patches from Aaron Plattner, who
implemented the same idea, but only for drm/prime drivers.

v2: Check in dma_buf_release that no dangling vmaps are left.
Suggested by Aaron Plattner. We might want to do similar checks for
attachments, but that's for another patch. Also fix up ERR_PTR return
for vmap.

v3: Check whether the passed-in vmap address matches with the cached
one for vunmap. Eventually we might want to remove that parameter -
compared to the kmap functions there's no need for the vaddr for
unmapping.  Suggested by Chris Wilson.

v4: Fix a brown-paper-bag bug spotted by Aaron Plattner.

Cc: Aaron Plattner &lt;aplattner@nvidia.com&gt;
Reviewed-by: Aaron Plattner &lt;aplattner@nvidia.com&gt;
Tested-by: Aaron Plattner &lt;aplattner@nvidia.com&gt;
Reviewed-by: Rob Clark &lt;rob@ti.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma_buf: Cleanup dma_buf_fd</title>
<updated>2013-01-17T20:57:07+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@alien8.de</email>
</author>
<published>2012-12-11T15:05:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f5e097f0465e874ac76e8b6ae355b6faa83973a1'/>
<id>f5e097f0465e874ac76e8b6ae355b6faa83973a1</id>
<content type='text'>
Remove redundant 'error' variable.

Signed-off-by: Borislav Petkov &lt;bp@alien8.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove redundant 'error' variable.

Signed-off-by: Borislav Petkov &lt;bp@alien8.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-buf: might_sleep() in dma_buf_unmap_attachment()</title>
<updated>2012-12-20T06:35:05+00:00</updated>
<author>
<name>Rob Clark</name>
<email>rob@ti.com</email>
</author>
<published>2012-09-28T07:29:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b6fa0cd62c5b9d47f8e5d42cb2876677a5ed701e'/>
<id>b6fa0cd62c5b9d47f8e5d42cb2876677a5ed701e</id>
<content type='text'>
We never really clarified if unmap could be done in atomic context.
But since mapping might require sleeping, this implies mutex in use
to synchronize mapping/unmapping, so unmap could sleep as well.  Add
a might_sleep() to clarify this.

Signed-off-by: Rob Clark &lt;rob@ti.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@canonical.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We never really clarified if unmap could be done in atomic context.
But since mapping might require sleeping, this implies mutex in use
to synchronize mapping/unmapping, so unmap could sleep as well.  Add
a might_sleep() to clarify this.

Signed-off-by: Rob Clark &lt;rob@ti.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@canonical.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
