<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/staging/android/sync.c, branch v3.16</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-05-25T18:09:14Z</updated>
<entry>
<title>staging: android: describe use of memory barrier on sync.c</title>
<updated>2014-05-25T18:09:14Z</updated>
<author>
<name>Niv Yehezkel</name>
<email>executerx@gmail.com</email>
</author>
<published>2014-05-24T14:28:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=296066093b5f5ccf30a9c3b2047eb6a8875a88f0'/>
<id>urn:sha1:296066093b5f5ccf30a9c3b2047eb6a8875a88f0</id>
<content type='text'>
Added comments describing the purpose of using write memory
barrier in the context of sync_timeline_destory.

Signed-off-by: Niv Yehezkel &lt;executerx@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: android: fix missing a blank line after declarations</title>
<updated>2014-05-03T23:46:30Z</updated>
<author>
<name>Seunghun Lee</name>
<email>waydi1@gmail.com</email>
</author>
<published>2014-04-30T16:30:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=10f62861b4a2f22cbd6412b3c42c76f0bdfbd648'/>
<id>urn:sha1:10f62861b4a2f22cbd6412b3c42c76f0bdfbd648</id>
<content type='text'>
This patch fixes "Missing a blank line after declarations" warnings.

Signed-off-by: Seunghun Lee &lt;waydi1@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: android: sync: Signal pt before sync_timeline object gets destroyed</title>
<updated>2014-02-07T17:36:27Z</updated>
<author>
<name>Prakash Kamliya</name>
<email>pkamliya@codeaurora.org</email>
</author>
<published>2014-02-05T00:08:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac5b705b22642208764aa784ccc47f093d0212b5'/>
<id>urn:sha1:ac5b705b22642208764aa784ccc47f093d0212b5</id>
<content type='text'>
There is a race condition

Assume we have *one* sync_fence object, with *one* sync_pt
which belongs to *one* sync_timeline, given this condition,
sync_timeline-&gt;kref will have two counts, one for sync_timeline
(implicit) and another for sync_pt.

Assume following is the situation on CPU

Theead-1 : (Thread which calls sync_timeline_destroy())
  -&gt; (some function calls)
   -&gt; sync_timeline_destory()
    -&gt; sync_timeline_signal() (CPU is inside this
function after putting reference to sync_timeline)

At this time Thread-2 comes and does following

Thread-2 : (fclose on fence fd)
&gt; sync_fence_release() -&gt; because of fclose() on fence object
 -&gt; sync_fence_free()
  -&gt; sync_pt_free()
   -&gt; kref_put(&amp;pt-&gt;parent-&gt;kref, sync_timeline_free);
    -&gt; sync_timeline_free() (CPU is inside this because
this time kref will be zero after _put)

Thread-2 will free sync_timeline object before Thread-1
has finished its work inside sync_timeline_signal.

With this change we signals all sync_pt before putting
reference to sync_timeline object.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Prakash Kamliya &lt;pkamliya@codeaurora.org&gt;
[jstultz: minor commit subject tweak]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: sync: Fix a race condition between release_obj and print_obj</title>
<updated>2014-02-07T17:03:16Z</updated>
<author>
<name>Alistair Strachan</name>
<email>alistair.strachan@imgtec.com</email>
</author>
<published>2014-02-05T00:08:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5cf045f54d31894ec59ee741e01fa258be2ba0fb'/>
<id>urn:sha1:5cf045f54d31894ec59ee741e01fa258be2ba0fb</id>
<content type='text'>
Before this change, a timeline would only be removed from the timeline
list *after* the sync driver had its release_obj() called. However, the
driver's release_obj() may free resources needed by print_obj().

Although the timeline list is locked when print_obj() is called, it is
not locked when release_obj() is called. If one CPU was in print_obj()
when another was in release_obj(), the print_obj() may make unsafe
accesses.

It is not actually necessary to hold the timeline list lock when calling
release_obj() if the call is made after the timeline is unlinked from
the list, since there is no possibility another thread could be in --
or enter -- print_obj() for that timeline.

This change moves the release_obj() call to after the timeline is
unlinked, preventing the above race from occurring.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Alistair Strachan &lt;alistair.strachan@imgtec.com&gt;
[jstultz: minor commit subject tweak]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>android/sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd()</title>
<updated>2013-08-16T00:27:30Z</updated>
<author>
<name>Yann Droneaud</name>
<email>ydroneaud@opteya.com</email>
</author>
<published>2013-08-15T13:10:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c6cd3b39048c8bbb83c5cd936f4dffc847321c6'/>
<id>urn:sha1:9c6cd3b39048c8bbb83c5cd936f4dffc847321c6</id>
<content type='text'>
Macro get_unused_fd() is used to allocate a file descriptor with
default flags. Those default flags (0) can be "unsafe":
O_CLOEXEC must be used by default to not leak file descriptor
across exec().

Instead of macro get_unused_fd(), functions anon_inode_getfd()
or get_unused_fd_flags() should be used with flags given by userspace.
If not possible, flags should be set to O_CLOEXEC to provide userspace
with a default safe behavor.

In a further patch, get_unused_fd() will be removed so that
new code start using anon_inode_getfd() or get_unused_fd_flags()
with correct flags.

This patch replaces calls to get_unused_fd() with call to
get_unused_fd_flags(O_CLOEXEC) following advice from Erik Gilling.

Signed-off-by: Yann Droneaud &lt;ydroneaud@opteya.com&gt;
Cc: Erik Gilling &lt;konkers@android.com&gt;
Cc: Colin Cross &lt;ccross@google.com&gt;
Link: http://lkml.kernel.org/r/CACSP8SjXGMk2_kX_+RgzqqQwqKernvF1Wt3K5tw991W5dfAnCA@mail.gmail.com
Link: http://lkml.kernel.org/r/cover.1376327678.git.ydroneaud@opteya.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: android: sync: fix up a sparse warning</title>
<updated>2013-06-04T22:59:23Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-06-04T22:59:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cd0c1d70f69a8ac51634ef878ce6610044ee166c'/>
<id>urn:sha1:cd0c1d70f69a8ac51634ef878ce6610044ee166c</id>
<content type='text'>
Fix up a sparse warning about sync_dump that was reported.

Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Cc: Erik Gilling &lt;konkers@android.com&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: android: Replace seq_printf with seq_puts</title>
<updated>2013-05-12T15:36:02Z</updated>
<author>
<name>Hema Prathaban</name>
<email>hemaklnce@gmail.com</email>
</author>
<published>2013-05-08T18:59:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0eacf2959a2879dce29d35568d78fcfeea54d86'/>
<id>urn:sha1:a0eacf2959a2879dce29d35568d78fcfeea54d86</id>
<content type='text'>
Fixes the following checkpatch warning:
WARNING: Prefer seq_puts to seq_printf

Signed-off-by: Hema Prathaban &lt;hemaklnce@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: android: Remove unnecessary braces</title>
<updated>2013-05-12T15:36:01Z</updated>
<author>
<name>Hema Prathaban</name>
<email>hemaklnce@gmail.com</email>
</author>
<published>2013-05-08T18:57:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d03f6bbaa42c2c5466350718f804537384902d5d'/>
<id>urn:sha1:d03f6bbaa42c2c5466350718f804537384902d5d</id>
<content type='text'>
Fixes the following checkpatch warning:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Hema Prathaban &lt;hemaklnce@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: sync: Add compat_ioctl handlers to sync drivers</title>
<updated>2013-03-29T19:35:28Z</updated>
<author>
<name>Dmitry Pervushin</name>
<email>dmitry.pervushin@linaro.org</email>
</author>
<published>2013-03-29T17:50:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c37b95eeefee32a765a9bbbfeaece48a361b2d23'/>
<id>urn:sha1:c37b95eeefee32a765a9bbbfeaece48a361b2d23</id>
<content type='text'>
The sync drivers are missing compat_ioctl handlers, so this
patch adds them.

The same change has been submitted to AOSP:
        https://android-review.googlesource.com/#/c/54901/
        Change-Id: If1a1ecc3952b321c8d64c6a8b050104859efc4b1

Cc: Erik Gilling &lt;konkers@android.com&gt;
Cc: Dmitry Pervushin &lt;dmitry.pervushin@linaro.org&gt;
Cc: Bernhard Rosenkränzer &lt;Bernhard.Rosenkranzer@linaro.org&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Dmitry Pervushin &lt;dmitry.pervushin@linaro.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: sync: fix return value check in sync_fence_alloc()</title>
<updated>2013-03-11T17:14:35Z</updated>
<author>
<name>Wei Yongjun</name>
<email>yongjun_wei@trendmicro.com.cn</email>
</author>
<published>2013-03-11T13:45:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59691367be00806a3ab1c6a125ced6ed87e91356'/>
<id>urn:sha1:59691367be00806a3ab1c6a125ced6ed87e91356</id>
<content type='text'>
In case of error, the function anon_inode_getfile() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
