<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/staging/android, branch v3.14</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>staging: binder: Fix death notifications</title>
<updated>2014-02-21T20:30:54+00:00</updated>
<author>
<name>Arve Hjønnevåg</name>
<email>arve@android.com</email>
</author>
<published>2014-02-17T21:58:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e194fd8a5d8e0a7eeed239a8534460724b62fe2d'/>
<id>e194fd8a5d8e0a7eeed239a8534460724b62fe2d</id>
<content type='text'>
The change (008fa749e0fe5b2fffd20b7fe4891bb80d072c6a) that moved the
node release code to a separate function broke death notifications in
some cases. When it encountered a reference without a death
notification request, it would skip looking at the remaining
references, and therefore fail to send death notifications for them.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.10
Signed-off-by: Arve Hjønnevåg &lt;arve@android.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Jeremy Compostella &lt;jeremy.compostella@intel.com&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>
The change (008fa749e0fe5b2fffd20b7fe4891bb80d072c6a) that moved the
node release code to a separate function broke death notifications in
some cases. When it encountered a reference without a death
notification request, it would skip looking at the remaining
references, and therefore fail to send death notifications for them.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.10
Signed-off-by: Arve Hjønnevåg &lt;arve@android.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Jeremy Compostella &lt;jeremy.compostella@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpu: ion: dereferencing an ERR_PTR</title>
<updated>2014-02-07T19:08:46+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2014-01-22T14:20:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=54de9af9f0d7a91e898b6e02199be16dc26a4870'/>
<id>54de9af9f0d7a91e898b6e02199be16dc26a4870</id>
<content type='text'>
We dereference "heap-&gt;task" before checking if it's an ERR_PTR.

Fixes: ea313b5f88ed ('gpu: ion: Also shrink memory cached in the deferred free list')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&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>
We dereference "heap-&gt;task" before checking if it's an ERR_PTR.

Fixes: ea313b5f88ed ('gpu: ion: Also shrink memory cached in the deferred free list')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: android: ion: dummy: fix an error code</title>
<updated>2014-02-07T19:08:46+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2014-01-20T10:30:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=630127f36784e59e995c206c37825a36a34d346c'/>
<id>630127f36784e59e995c206c37825a36a34d346c</id>
<content type='text'>
We should be returning -ENOMEM here instead of zero.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&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>
We should be returning -ENOMEM here instead of zero.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: android: sync: Signal pt before sync_timeline object gets destroyed</title>
<updated>2014-02-07T17:36:27+00:00</updated>
<author>
<name>Prakash Kamliya</name>
<email>pkamliya@codeaurora.org</email>
</author>
<published>2014-02-05T00:08:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ac5b705b22642208764aa784ccc47f093d0212b5'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: ion: Fix build warning</title>
<updated>2014-02-07T17:03:16+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2014-02-05T00:08:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a33b2fc5a9a131eb0a82846f55d7775b28cb2fcb'/>
<id>a33b2fc5a9a131eb0a82846f55d7775b28cb2fcb</id>
<content type='text'>
Add #include &lt;linux/device.h&gt; to fix the following warning seen
with gcc 4.7.3:

In file included from drivers/staging/android/ion/ion_heap.c:26:0:
drivers/staging/android/ion/ion_priv.h:358:21: warning: ‘struct device’ declared inside parameter list [enabled by default]
drivers/staging/android/ion/ion_priv.h:358:21: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&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>
Add #include &lt;linux/device.h&gt; to fix the following warning seen
with gcc 4.7.3:

In file included from drivers/staging/android/ion/ion_heap.c:26:0:
drivers/staging/android/ion/ion_priv.h:358:21: warning: ‘struct device’ declared inside parameter list [enabled by default]
drivers/staging/android/ion/ion_priv.h:358:21: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: ion: Fix ION_IOC_FREE compat ioctl</title>
<updated>2014-02-07T17:03:16+00:00</updated>
<author>
<name>Laura Abbott</name>
<email>lauraa@codeaurora.org</email>
</author>
<published>2014-02-05T00:08:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8666a87611fbd8597111c96e93a2f075664ee392'/>
<id>8666a87611fbd8597111c96e93a2f075664ee392</id>
<content type='text'>
The compat ioctl for ION_IOC_FREE currently passes allocation data
instead of the free data. Correct this.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Laura Abbott &lt;lauraa@codeaurora.org&gt;
[jstultz: Folded in a small build fix]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&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>
The compat ioctl for ION_IOC_FREE currently passes allocation data
instead of the free data. Correct this.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Laura Abbott &lt;lauraa@codeaurora.org&gt;
[jstultz: Folded in a small build fix]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: ion: Fix overflow and list bugs in system heap</title>
<updated>2014-02-07T17:03:16+00:00</updated>
<author>
<name>Colin Cross</name>
<email>ccross@android.com</email>
</author>
<published>2014-02-05T00:08:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c9e8440eca61298ecccbb27f53036124a7a3c6c8'/>
<id>c9e8440eca61298ecccbb27f53036124a7a3c6c8</id>
<content type='text'>
Fix a few bugs in ion_system_heap:

Initialize the list node in the info block.

Don't store size_remaining in a signed long, allocating &gt;2GB
could overflow, resulting in a call to sg_alloc_table with
nents=0 which panics.  alloc_largest_available will never
return a block larger than size_remanining, so it can never
go negative.

Limit a single allocation to half of all memory.  Prevents a
large allocation from taking down the whole system.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Colin Cross &lt;ccross@android.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a few bugs in ion_system_heap:

Initialize the list node in the info block.

Don't store size_remaining in a signed long, allocating &gt;2GB
could overflow, resulting in a call to sg_alloc_table with
nents=0 which panics.  alloc_largest_available will never
return a block larger than size_remanining, so it can never
go negative.

Limit a single allocation to half of all memory.  Prevents a
large allocation from taking down the whole system.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Colin Cross &lt;ccross@android.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;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: ashmem: Avoid deadlock between read and mmap calls</title>
<updated>2014-02-07T17:03:16+00:00</updated>
<author>
<name>Todd Poynor</name>
<email>toddpoynor@google.com</email>
</author>
<published>2014-02-05T00:08:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=077f6db9731673753ca41a5c3acbb5ead142658a'/>
<id>077f6db9731673753ca41a5c3acbb5ead142658a</id>
<content type='text'>
Avoid holding ashmem_mutex across code that can page fault.  Page faults
grab the mmap_sem for the process, which are also held by mmap calls
prior to calling ashmem_mmap, which locks ashmem_mutex.  The reversed
order of locking between the two can deadlock.

The calls that can page fault are read() and the ASHMEM_SET_NAME and
ASHMEM_GET_NAME ioctls.  Move the code that accesses userspace pages
outside the ashmem_mutex.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Todd Poynor &lt;toddpoynor@google.com&gt;
[jstultz: minor commit message tweaks]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&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>
Avoid holding ashmem_mutex across code that can page fault.  Page faults
grab the mmap_sem for the process, which are also held by mmap calls
prior to calling ashmem_mmap, which locks ashmem_mutex.  The reversed
order of locking between the two can deadlock.

The calls that can page fault are read() and the ASHMEM_SET_NAME and
ASHMEM_GET_NAME ioctls.  Move the code that accesses userspace pages
outside the ashmem_mutex.

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Todd Poynor &lt;toddpoynor@google.com&gt;
[jstultz: minor commit message tweaks]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: sync: Fix a race condition between release_obj and print_obj</title>
<updated>2014-02-07T17:03:16+00:00</updated>
<author>
<name>Alistair Strachan</name>
<email>alistair.strachan@imgtec.com</email>
</author>
<published>2014-02-05T00:08:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5cf045f54d31894ec59ee741e01fa258be2ba0fb'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: sw_sync: Add stubs for kernels without CONFIG_SW_SYNC</title>
<updated>2014-02-07T17:03:16+00:00</updated>
<author>
<name>Greg Hackmann</name>
<email>ghackmann@google.com</email>
</author>
<published>2014-02-05T00:08:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bbd9ae8a05e05a608ff9158cf3b95be7b857a6fa'/>
<id>bbd9ae8a05e05a608ff9158cf3b95be7b857a6fa</id>
<content type='text'>
Add stubs for kernels without CONFIG_SW_SYNC

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Greg Hackmann &lt;ghackmann@google.com&gt;
[jstultz: resolved minor conflict, tweaked commit message]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&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>
Add stubs for kernels without CONFIG_SW_SYNC

Cc: Colin Cross &lt;ccross@android.com&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Signed-off-by: Greg Hackmann &lt;ghackmann@google.com&gt;
[jstultz: resolved minor conflict, tweaked commit message]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
