New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 714307 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature
Gfx

Blocked on:
issue 721838



Sign in to add a comment

backport android sync de-stage and dma-buf updates from linux-stable to 4.4 kernel tree

Project Member Reported by dbehr@chromium.org, Apr 21 2017

Issue description

We need to bring all the sync related changes from upstream to 4.4 tree, keep them bisectable, make sure all drivers work including Mali kbase driver.
 
forget passward
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 25 2017

Labels: merge-merged-chromeos-4.4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/96f39157d8c4f8f94ccd2297d319536b50f057a2

commit 96f39157d8c4f8f94ccd2297d319536b50f057a2
Author: Ioana Ciornei <ciorneiioana@gmail.com>
Date: Tue Apr 25 21:03:21 2017

UPSTREAM: staging: android: replace explicit NULL comparison

This patch replaces explicit NULL comparison with !
operator in order to simplify the code

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 375fb53ec1be6df6cfd0ac4932f14f0b7f57a761)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Iad8a6051a82481c44533cf4783679bc65552e1cd
Reviewed-on: https://chromium-review.googlesource.com/484806
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/96f39157d8c4f8f94ccd2297d319536b50f057a2/drivers/staging/android/sync.c
[modify] https://crrev.com/96f39157d8c4f8f94ccd2297d319536b50f057a2/drivers/staging/android/ion/compat_ion.c

Project Member

Comment 3 by bugdroid1@chromium.org, Apr 25 2017

Labels: merge-merged-chromeos-4.4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/dca39b28e2b10f47a28ca35f4dff02502b112ccc

commit dca39b28e2b10f47a28ca35f4dff02502b112ccc
Author: Ioana Ciornei <ciorneiioana@gmail.com>
Date: Tue Apr 25 21:03:22 2017

UPSTREAM: staging: android: properly align function arguments

Fix alingment issues by properly indenting function arguments
in accordance with the kernel coding style.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f8b053e3da56cdfa798ce5d7014860798b04b7bc)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ife6c428f940c5ce7825b8abb716439a8c5c42b18
Reviewed-on: https://chromium-review.googlesource.com/484807
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/dca39b28e2b10f47a28ca35f4dff02502b112ccc/drivers/staging/android/lowmemorykiller.c
[modify] https://crrev.com/dca39b28e2b10f47a28ca35f4dff02502b112ccc/drivers/staging/android/sync.c
[modify] https://crrev.com/dca39b28e2b10f47a28ca35f4dff02502b112ccc/drivers/staging/android/timed_gpio.c

Project Member

Comment 4 by bugdroid1@chromium.org, Apr 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/9e10b936471566d0dcb47a99fa6d9968befed519

commit 9e10b936471566d0dcb47a99fa6d9968befed519
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Apr 25 21:03:23 2017

UPSTREAM: staging/android: add TODO to de-stage android sync framework

 - remove CONFIG_SW_SYNC_USER, it is used only for testing/debugging and
   should not be upstreamed.
 - port CONFIG_SW_SYNC_USER tests interfaces to use debugfs somehow
 - port libsync tests to kselftest
 - clean up and ABI check for security issues
 - move the sync framework to drivers/base/dma-buf

BUG= chromium:714307 
TEST=boot kevin and pyro

Cc: Arve Hjnnevg <arve@android.com>
Cc: Riley Andrews <riandrews@android.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Greg Hackmann <ghackmann@google.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d3ae4fa40088045b500f4d1ce85eb926b6cd2d3e)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I4849f7b3278fd67361ba09a92ba8ea60471c1fc0
Reviewed-on: https://chromium-review.googlesource.com/484808
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/9e10b936471566d0dcb47a99fa6d9968befed519/drivers/staging/android/TODO

Project Member

Comment 5 by bugdroid1@chromium.org, Apr 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/528dd3e24ae5828b1a2e29a47e487f40b71de7ec

commit 528dd3e24ae5828b1a2e29a47e487f40b71de7ec
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Tue Apr 25 21:03:24 2017

UPSTREAM: staging/android/sync: Support sync points created from dma-fences

Debug output assumes all sync points are built on top of Android sync points
and when we start creating them from dma-fences will NULL ptr deref unless
taught about this.

v4: Corrected patch ownership.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: devel@driverdev.osuosl.org
Cc: Riley Andrews <riandrews@android.com>
Cc: Arve Hjnnevg <arve@android.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 73465f1c08258637dc8c49c2c8d1a1233d9861c7)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ib7dc6a73130c1eb95159f50d0611f1d36d977bc0
Reviewed-on: https://chromium-review.googlesource.com/484809
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/528dd3e24ae5828b1a2e29a47e487f40b71de7ec/drivers/staging/android/sync_debug.c

Project Member

Comment 6 by bugdroid1@chromium.org, Apr 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/5fbc4b216401cf60e682373e485944687ee5dad4

commit 5fbc4b216401cf60e682373e485944687ee5dad4
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Tue Apr 25 21:03:25 2017

UPSTREAM: staging/android/sync: add sync_fence_create_dma

This allows users of dma fences to create a android fence.

v2: Added kerneldoc. (Tvrtko Ursulin).

v4: Updated comments from review feedback my Maarten.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: devel@driverdev.osuosl.org
Cc: Riley Andrews <riandrews@android.com>
Cc: Arve Hjnnevg <arve@android.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0f477c6dea709465550aa0922fd0c5b686e6e8eb)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I6eb052e5cb67f6a6bb11154f50488c6db6a28d8d
Reviewed-on: https://chromium-review.googlesource.com/484810
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/5fbc4b216401cf60e682373e485944687ee5dad4/drivers/staging/android/sync.c
[modify] https://crrev.com/5fbc4b216401cf60e682373e485944687ee5dad4/drivers/staging/android/sync.h

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/32809551399e4575148f1dc5b0973e02e7bbfe7e

commit 32809551399e4575148f1dc5b0973e02e7bbfe7e
Author: Bopamo Osaisai <bopamo@gmail.com>
Date: Tue Apr 25 21:03:26 2017

UPSTREAM: Staging: android: Fix brace coding style warning in sync_debug.c

This is a patch to the sync_debug.c file that rectifies a brace warning
that was found with the checkpatch.pl tool

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Bopamo Osaisai <bopamo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit cd572182bd3d82e270d273b241f29d40b4213111)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ic07125771d1de8cfca195d3f6a1e5cab90e62ffd
Reviewed-on: https://chromium-review.googlesource.com/484811
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/32809551399e4575148f1dc5b0973e02e7bbfe7e/drivers/staging/android/sync_debug.c

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/dc9989575ef3999e4e3573b7444449fafeccdc10

commit dc9989575ef3999e4e3573b7444449fafeccdc10
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Apr 25 21:03:28 2017

UPSTREAM: staging/android: fix sync framework documentation

Updates comments about functions and structures.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9b32381ca50f5268edae8eac009a74b55df608d2)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I37d776ed90d570b760e0b64588711e1abdc602b7
Reviewed-on: https://chromium-review.googlesource.com/484812
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/dc9989575ef3999e4e3573b7444449fafeccdc10/drivers/staging/android/sync.h

Cc: dcasta...@chromium.org

Comment 10 by dbehr@chromium.org, Apr 28 2017

Cc: jcliang@chromium.org
Project Member

Comment 11 by bugdroid1@chromium.org, May 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/9764b859a633d6a8958675305bf19f651bda4663

commit 9764b859a633d6a8958675305bf19f651bda4663
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri May 12 10:25:31 2017

BACKPORT: staging/android: sync: remove interfaces that are not used

These interfaces are not used nor have plans to be used in the near
future so remove them for a cleaner solution before de-staging the sync
framework.

Mali kbase driver needs these interfaces, so we make a private copy of them.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3179dd927a9338e01ed0261e0bba080b6b8bdbaa)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I9e9a5bd739a33af6e6bf6ac585febd808ebe88f4
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/487501
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/9764b859a633d6a8958675305bf19f651bda4663/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
[modify] https://crrev.com/9764b859a633d6a8958675305bf19f651bda4663/drivers/staging/android/sync.c
[modify] https://crrev.com/9764b859a633d6a8958675305bf19f651bda4663/drivers/gpu/arm/midgard/mali_kbase_defs.h
[modify] https://crrev.com/9764b859a633d6a8958675305bf19f651bda4663/drivers/staging/android/sync_debug.c
[modify] https://crrev.com/9764b859a633d6a8958675305bf19f651bda4663/drivers/staging/android/sync.h

Project Member

Comment 12 by bugdroid1@chromium.org, May 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/f2cfac113c41eb1f311803bcdf79ce41de86b12b

commit f2cfac113c41eb1f311803bcdf79ce41de86b12b
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri May 12 10:25:32 2017

BACKPORT: staging/android: remove not used sync_timeline ops

.dup and .compare are not used by the sync framework, so remove them
from sw_sync.

Also, remove dup and compare from Mali kbase driver.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 27e3917ab996cfcf68d0261006bd3d116e969402)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ib39863cf544cabbe076f95bd85a70e23171a60ee
Reviewed-on: https://chromium-review.googlesource.com/487502
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/f2cfac113c41eb1f311803bcdf79ce41de86b12b/drivers/staging/android/sync.c
[modify] https://crrev.com/f2cfac113c41eb1f311803bcdf79ce41de86b12b/drivers/gpu/arm/midgard/mali_kbase_sync.c
[modify] https://crrev.com/f2cfac113c41eb1f311803bcdf79ce41de86b12b/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/f2cfac113c41eb1f311803bcdf79ce41de86b12b/drivers/staging/android/sync.h

Project Member

Comment 13 by bugdroid1@chromium.org, May 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/9b2c5b1c2d111b27d579aae7ee1208669406c694

commit 9b2c5b1c2d111b27d579aae7ee1208669406c694
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri May 12 10:25:33 2017

UPSTREAM: staging/android: create a 'sync' dir for debugfs information

Creates the 'sync' dir on debugfs root dir and move the 'sync' file
to sync/info. This is the preparation to add more debug info and control.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8a0044846115e74552b671a7073cffeec14b9316)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ibbfa84761fc4e5e155a68b329e40db05e1267537
Reviewed-on: https://chromium-review.googlesource.com/487503
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/9b2c5b1c2d111b27d579aae7ee1208669406c694/drivers/staging/android/sync_debug.c

Comment 14 by dbehr@chromium.org, May 12 2017

Blockedon: 721838
Project Member

Comment 15 by bugdroid1@chromium.org, May 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/90a0385b6a09c30f37043f2b1f706954311b1ccc

commit 90a0385b6a09c30f37043f2b1f706954311b1ccc
Author: Ricky Liang <jcliang@chromium.org>
Date: Wed May 24 06:59:24 2017

libsync: add include/ to include paths

BUG= chromium:714307 
TEST=emerge-<board> arc-camera3-libsync

Change-Id: I25e20590d43692fe80662dc70a06de22d552dd80
Reviewed-on: https://chromium-review.googlesource.com/492706
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Ricky Liang <jcliang@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>

[modify] https://crrev.com/90a0385b6a09c30f37043f2b1f706954311b1ccc/android/libsync/module.mk

Project Member

Comment 16 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/9721500fd38d21098180ebdcb5e43d9f3dbbcf2a

commit 9721500fd38d21098180ebdcb5e43d9f3dbbcf2a
Author: Gustavo Padovan <gustavo.padovan@collabora.com>
Date: Fri May 26 00:16:03 2017

UPSTREAM: libsync: open new location of sw_sync file

sw_sync file for debug was moved to debugfs. Try to open it and if it
fails try to open /dev/sw_sync.

BUG= chromium:714307 
TEST=boot kevin and pyro

Test: Sync unit tests still passes.
Change-Id: I72261a259a4947e1b04ed5a951a8ecc071035ec0
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/489484
Commit-Ready: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Ricky Liang <jcliang@chromium.org>

[modify] https://crrev.com/9721500fd38d21098180ebdcb5e43d9f3dbbcf2a/android/libsync/src/sync.c

Project Member

Comment 17 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/cheets-scripts/+/46e70dd59f179f21a318200af3cbb3f5b8c1dfc4

commit 46e70dd59f179f21a318200af3cbb3f5b8c1dfc4
Author: Dominik Behr <dbehr@google.com>
Date: Fri May 26 00:16:07 2017

Project Member

Comment 18 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/ead9ee00a9411a414679d9ce2323475123311ce4

commit ead9ee00a9411a414679d9ce2323475123311ce4
Author: Christopher Ferris <cferris@google.com>
Date: Fri May 26 11:17:06 2017

BACKPORT: Update for kernel headers v4.7.2.

The new uapi kernel headers added a new SEGV reason code, so
add it to the tombstone code.

Update sync.c to include the needed data structures itself. Someone
else will be fixing this to work on old versus new kernels.

BUG= chromium:714307 
TEST=boot kevin and pyro

Change-Id: I94253813c88e7e60193ba71e8936b243b53c62ac
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/489485
Reviewed-by: Ricky Liang <jcliang@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>

[modify] https://crrev.com/ead9ee00a9411a414679d9ce2323475123311ce4/android/libsync/src/sync.c

Project Member

Comment 19 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/e79543f3da32cdc315951fb17d099a1982b5c403

commit e79543f3da32cdc315951fb17d099a1982b5c403
Author: Christopher Ferris <cferris@google.com>
Date: Fri May 26 11:17:07 2017

UPSTREAM: Update for kernel headers v4.8.14.

Update sync.c to include the structurs from sw_sync.h. This uapi
header has been deleted.

BUG= chromium:714307 
TEST=boot kevin and pyro

Test: Built mips/arm/arm64/x86/x86_64. Built and booted angler.

Change-Id: Iddcfaf8995759ec91fc291f4b227f913cbc9b15f
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/489486
Reviewed-by: Ricky Liang <jcliang@chromium.org>

[modify] https://crrev.com/e79543f3da32cdc315951fb17d099a1982b5c403/android/libsync/src/sync.c

Project Member

Comment 20 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/06d276cda92e5e09f786d06343ffb462ed78af6a

commit 06d276cda92e5e09f786d06343ffb462ed78af6a
Author: Gustavo Padovan <gustavo.padovan@collabora.com>
Date: Fri May 26 11:17:07 2017

UPSTREAM: libsync: move kernel headers for sync ioctls to sync.h

This patch moves the legacy API to the internal sync.h header
and add documentation to it.

BUG= chromium:714307 
TEST=boot kevin and pyro

Test: Sync unit tests still passes.
Change-Id: Ia00eb5c6430882548aba4c229b24bf87f3831d6f
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/489487
Reviewed-by: Ricky Liang <jcliang@chromium.org>

[modify] https://crrev.com/06d276cda92e5e09f786d06343ffb462ed78af6a/android/libsync/include/sync/sync.h
[modify] https://crrev.com/06d276cda92e5e09f786d06343ffb462ed78af6a/android/libsync/src/sync.c

Project Member

Comment 21 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/389f61e9fcac2da5a80f885e056fc9c406f18a29

commit 389f61e9fcac2da5a80f885e056fc9c406f18a29
Author: Gustavo Padovan <gustavo.padovan@collabora.com>
Date: Fri May 26 11:17:07 2017

UPSTREAM: libsync: add new Sync kernel API

Add the new API to the internal sync.h file. As there is two different
APIs we will need to discovery dynamically which one to use.

v2: Fix Documentation

BUG= chromium:714307 
TEST=boot kevin and pyro

Test: Sync unit tests still passes.
Change-Id: Ibbfb10247f0b7223afc9b7239ae5abc98a60ea2f
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/489488
Reviewed-by: Ricky Liang <jcliang@chromium.org>

[modify] https://crrev.com/389f61e9fcac2da5a80f885e056fc9c406f18a29/android/libsync/include/sync/sync.h

Project Member

Comment 22 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/cd3640df33c67cd0b029a4237df18eb280bf445e

commit cd3640df33c67cd0b029a4237df18eb280bf445e
Author: Gustavo Padovan <gustavo.padovan@collabora.com>
Date: Fri May 26 11:17:07 2017

UPSTREAM: libsync: add support to new Sync API

Change libsync functions in a way that it can run dynamically on both
APIs.

v2: fix whitespace changes and poll return handling

v3: handle error cases on sync_wait()

BUG= chromium:714307 
TEST=boot kevin and pyro

Test: Sync unit tests still passes.
Change-Id: Idcc9de3988c15a7f3412d98626262ab7fc9a618b
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/489489

[modify] https://crrev.com/cd3640df33c67cd0b029a4237df18eb280bf445e/android/libsync/src/sync.c

Project Member

Comment 23 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/4b849d43c50995975382ada12a6e96e5bc31dd12

commit 4b849d43c50995975382ada12a6e96e5bc31dd12
Author: Ricky Liang <jcliang@chromium.org>
Date: Fri May 26 20:01:08 2017

libsync: remove obsolete header files

BUG= chromium:714307 
TEST=emerge-<board> arc-camera3-libsync

Change-Id: Ic8117b600976ec1fbd3ac20236578a8c5a6297ae
Reviewed-on: https://chromium-review.googlesource.com/492707
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Commit-Ready: Ricky Liang <jcliang@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>

[delete] https://crrev.com/48b3f9f623c065668827a2c7801154007ae04a7a/android/include/linux/sync.h
[delete] https://crrev.com/48b3f9f623c065668827a2c7801154007ae04a7a/android/include/linux/sw_sync.h

Project Member

Comment 24 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/8afcbabde77056e690e524a05cbb12d1d51d6f22

commit 8afcbabde77056e690e524a05cbb12d1d51d6f22
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Mon Jun 05 21:49:02 2017

BACKPORT: staging/android: move SW_SYNC_USER to a debugfs file

This remove CONFIG_SW_SYNC_USER and instead compile the sw_sync file into
debugpfs under <debugfs>/sync/sw_sync.

Added compat_ioctl debugfs proxy wrapper in fs/debugfs so 32bit ioctls would
work.

BUG= chromium:714307 
TEST=boot kevin and pyro
CQ-DEPEND=CL:489484

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a44eb74cd413fa62733d7df89942eabaf26176eb)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I5cdbc41f0996f1ef97262b1f7e6f2b3ace38fc72
Reviewed-on: https://chromium-review.googlesource.com/490536
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/8afcbabde77056e690e524a05cbb12d1d51d6f22/fs/debugfs/file.c
[modify] https://crrev.com/8afcbabde77056e690e524a05cbb12d1d51d6f22/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/8afcbabde77056e690e524a05cbb12d1d51d6f22/drivers/staging/android/Kconfig
[modify] https://crrev.com/8afcbabde77056e690e524a05cbb12d1d51d6f22/drivers/staging/android/sync_debug.c

Project Member

Comment 25 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/db922104651936fca9d7eedcc57bf793f884d1ec

commit db922104651936fca9d7eedcc57bf793f884d1ec
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Mon Jun 05 21:49:03 2017

BACKPORT: staging/android: rename sync_fence to sync_file

sync_file has a more close meaning to what a sync_fence really, a struct
that represent a file that can be used by userspace to get information on
a fence, or wait for it to be signaled.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d7fdb0ae9d115fa14ff3a5382c8a62de41c7786a)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I3d4e66fd4a841900af781864a43d310a9ba0b28e
Reviewed-on: https://chromium-review.googlesource.com/510068
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@google.com>

[modify] https://crrev.com/db922104651936fca9d7eedcc57bf793f884d1ec/drivers/staging/android/sync.c
[modify] https://crrev.com/db922104651936fca9d7eedcc57bf793f884d1ec/drivers/staging/android/trace/sync.h
[modify] https://crrev.com/db922104651936fca9d7eedcc57bf793f884d1ec/drivers/gpu/arm/midgard/mali_kbase_sync_user.c
[modify] https://crrev.com/db922104651936fca9d7eedcc57bf793f884d1ec/drivers/gpu/arm/midgard/mali_kbase_defs.h
[modify] https://crrev.com/db922104651936fca9d7eedcc57bf793f884d1ec/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
[modify] https://crrev.com/db922104651936fca9d7eedcc57bf793f884d1ec/drivers/staging/android/uapi/sync.h
[modify] https://crrev.com/db922104651936fca9d7eedcc57bf793f884d1ec/drivers/staging/android/sync.h
[modify] https://crrev.com/db922104651936fca9d7eedcc57bf793f884d1ec/drivers/staging/android/sync_debug.c

Project Member

Comment 26 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/9888a1cfd255c7642395276b986dc0e6cba9442d

commit 9888a1cfd255c7642395276b986dc0e6cba9442d
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Mon Jun 05 21:49:04 2017

BACKPORT: staging/android: rename 'sync_pt' to 'fence' in struct sync_fence_cb

'sync_pt' is actually declared as struct fence so to make the name means
its type we rename it to 'fence'.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c88b26dd8eda48758967c87b4ef89ae8e35f1e71)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I191bfb09c13c796ceec19f284f5f30129700388e
Reviewed-on: https://chromium-review.googlesource.com/510069
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@google.com>

[modify] https://crrev.com/9888a1cfd255c7642395276b986dc0e6cba9442d/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
[modify] https://crrev.com/9888a1cfd255c7642395276b986dc0e6cba9442d/drivers/staging/android/sync.c
[modify] https://crrev.com/9888a1cfd255c7642395276b986dc0e6cba9442d/drivers/staging/android/sync.h
[modify] https://crrev.com/9888a1cfd255c7642395276b986dc0e6cba9442d/drivers/staging/android/sync_debug.c

Project Member

Comment 27 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/1a212fa97fed233765fded2b3975387279cca496

commit 1a212fa97fed233765fded2b3975387279cca496
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Mon Jun 05 21:49:05 2017

BACKPORT: staging/android: remove struct sync_pt

struct sync_pt was just wrapping around struct fence and creating an
extra abstraction layer. The only two members of struct sync_pt, child_list
and active_list, were moved to struct fence in an earlier commit. After
removing those two members struct sync_pt is nothing more than struct
fence, so remove it all and use struct fence directly.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b55b54b5db330e36cd465adb3fbe274ffb1061d3)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ia0f3b358f0e690dd43675a18cbe7417ff2a5ede9
Reviewed-on: https://chromium-review.googlesource.com/510070
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@google.com>

[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/staging/android/sync.c
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/gpu/arm/midgard/mali_kbase_sync.h
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/gpu/arm/midgard/mali_kbase_sync.c
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/gpu/arm/midgard/mali_kbase_sync_user.c
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/staging/android/trace/sync.h
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/staging/android/sw_sync.h
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/include/linux/fence.h
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/staging/android/sync.h
[modify] https://crrev.com/1a212fa97fed233765fded2b3975387279cca496/drivers/staging/android/sync_debug.c

Project Member

Comment 28 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/69085d82c66ae469f0a0f24ad9d787036f5096ee

commit 69085d82c66ae469f0a0f24ad9d787036f5096ee
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Mon Jun 05 21:49:06 2017

UPSTREAM: staging/android: remove unused var from sync_timeline_signal()

signaled_pts is not used in this function.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e6a0cb4819d082b60ce47e432bfcac16fdf93767)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I3b90e1973bce935afaf7c1d54a5caa0eb9760600
Reviewed-on: https://chromium-review.googlesource.com/510071
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/69085d82c66ae469f0a0f24ad9d787036f5096ee/drivers/staging/android/sync.c

Project Member

Comment 29 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/5a6b0c070e3180e1f577f8a6aa002cd4e4455c0b

commit 5a6b0c070e3180e1f577f8a6aa002cd4e4455c0b
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Mon Jun 05 21:49:07 2017

UPSTREAM: staging/android: remove pointless sync_timeline_signal at destroy phase

All changes to timeline value come through the user via
sync_timeline_signal() calls. When sync_timeline_destroy() is called no
changes on timeline->value happens hence call sync_timeline_signal() with
no increment is pointless.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 84288db5ca3fdac8d5a4bc730cc0b20144ddaa46)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I9f29f2b9869d820507c7100fd1b3e15984d55a70
Reviewed-on: https://chromium-review.googlesource.com/510072
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/5a6b0c070e3180e1f577f8a6aa002cd4e4455c0b/drivers/staging/android/sync.c

Project Member

Comment 30 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/6dc7f487efe03323ac866c5672bf8048f87b4451

commit 6dc7f487efe03323ac866c5672bf8048f87b4451
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 06 03:16:27 2017

UPSTREAM: staging/android: remove sync_fence_create_dma()

With the removal of struct sync_pt sync_fence_create_dma() now takes
the same arguments as sync_fence_create() so let's keep only
sync_fence_create().

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d52ef2cef99cc200d828f39d1584e4b190fc2442)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I6bbc759aa50a20158235e9384f01d062ba4b104f
Reviewed-on: https://chromium-review.googlesource.com/510073
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/6dc7f487efe03323ac866c5672bf8048f87b4451/drivers/staging/android/sync.c
[modify] https://crrev.com/6dc7f487efe03323ac866c5672bf8048f87b4451/drivers/staging/android/sync.h

Project Member

Comment 31 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/7e954611f05d5bfbe52584d75a8d08ac66b4b3f0

commit 7e954611f05d5bfbe52584d75a8d08ac66b4b3f0
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 06 03:16:28 2017

UPSTREAM: staging/android: remove SYNC_WAIT ioctl

This ioctl is replicating the work of poll() syscall so let's take the
opportunity that this is still on staging tree and remove the duplication
and force new users to use the poll() standard interface.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 84013bb4651e568d543f4cd3fa65c7931943da73)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: If72156cb77666c2fde75141bb7ad39a7bb6921cd
Reviewed-on: https://chromium-review.googlesource.com/510074
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/7e954611f05d5bfbe52584d75a8d08ac66b4b3f0/drivers/staging/android/sync.c
[modify] https://crrev.com/7e954611f05d5bfbe52584d75a8d08ac66b4b3f0/drivers/staging/android/sync.h
[modify] https://crrev.com/7e954611f05d5bfbe52584d75a8d08ac66b4b3f0/drivers/staging/android/uapi/sync.h
[modify] https://crrev.com/7e954611f05d5bfbe52584d75a8d08ac66b4b3f0/drivers/staging/android/trace/sync.h

Project Member

Comment 32 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/667688397c58220c4afa5612183bff387c7c01b5

commit 667688397c58220c4afa5612183bff387c7c01b5
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 06 03:16:29 2017

UPSTREAM: staging/android: rename sync_pt_info to sync_fence_info

As struct sync_pt doesn't exist anymore it is a good idea remove any
reference to it in the sync_framework. sync_pts were replaced directly by
fences and here we rename it to sync_fence_info to let the fence namespace
clean.

v2: rename fence_info to sync_fence_info (Maarten)

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e1786348e4e5442e82b4b35f8ade6f4d0f434e18)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I85b8fc35bf521c00ba60da0a31a39240c87f06b6
Reviewed-on: https://chromium-review.googlesource.com/510075
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/667688397c58220c4afa5612183bff387c7c01b5/drivers/staging/android/sync.c
[modify] https://crrev.com/667688397c58220c4afa5612183bff387c7c01b5/drivers/staging/android/uapi/sync.h

Project Member

Comment 33 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/6ec4780eecb11fcd123e5066ba23c78f84de33c0

commit 6ec4780eecb11fcd123e5066ba23c78f84de33c0
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 06 03:16:30 2017

UPSTREAM: staging/android: remove driver_data from struct sync_fence_info

It is unclear in what situations driver_data should be used thus better do
not upstream it for now. If a need arises in the future a discussion can
be started to re-add it.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c7434b8436f9fb79855f0a52e4e9665becb77aea)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I5f2970029b01794bdeaa333285ee1dc788c5b140
Reviewed-on: https://chromium-review.googlesource.com/510076
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/6ec4780eecb11fcd123e5066ba23c78f84de33c0/drivers/staging/android/sync.c
[modify] https://crrev.com/6ec4780eecb11fcd123e5066ba23c78f84de33c0/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/6ec4780eecb11fcd123e5066ba23c78f84de33c0/drivers/staging/android/sync.h
[modify] https://crrev.com/6ec4780eecb11fcd123e5066ba23c78f84de33c0/drivers/staging/android/uapi/sync.h

Project Member

Comment 34 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/19db6ce875cae016bd094ffc8ec1ca819feb1383

commit 19db6ce875cae016bd094ffc8ec1ca819feb1383
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 06 03:16:31 2017

UPSTREAM: staging/android: remove len field from struct sync_fence_info

After removing driver_data struct sync_fence_info has now a fixed size,
thus it doesn't need any field to tell its size, it is already known.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 323de43f79c5055af71c2db44f34e060ac15e1df)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ic39595626d7ac8cdc91264f086cfdec914e1962b
Reviewed-on: https://chromium-review.googlesource.com/510077
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/19db6ce875cae016bd094ffc8ec1ca819feb1383/drivers/staging/android/sync.c
[modify] https://crrev.com/19db6ce875cae016bd094ffc8ec1ca819feb1383/drivers/staging/android/uapi/sync.h

Project Member

Comment 35 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/c024290f4cc2b1fa1611bfd128ee59d40418ecd6

commit c024290f4cc2b1fa1611bfd128ee59d40418ecd6
Author: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Tue Jun 06 10:14:28 2017

UPSTREAM: drivers/staging/android: don't use modular references in sync_debug.c

In commit 8a0044846115e74552b671a7073cffeec14b9316 ("staging/android:
create a 'sync' dir for debugfs information"), modular references were
introduced to this file.  However if we look, we find:

drivers/staging/android/Makefile:obj-$(CONFIG_SYNC) += sync.o sync_debug.o

drivers/staging/android/Kconfig:config SYNC
drivers/staging/android/Kconfig:        bool "Synchronization framework"

This file isn't currently buildable as a module, and hence the code
for module_exit is just dead code.  Remove it and the module.h include.

BUG= chromium:714307 
TEST=boot kevin and pyro

Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9c583af90a8ead5032b90492b66dd7117591a528)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I9e2797a15d599d9dff61b40a7d3bcad1e1655602
Reviewed-on: https://chromium-review.googlesource.com/516567
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/c024290f4cc2b1fa1611bfd128ee59d40418ecd6/drivers/staging/android/sync_debug.c

Project Member

Comment 36 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/9af39868e433a397f56f1ac9b9708de71c12907f

commit 9af39868e433a397f56f1ac9b9708de71c12907f
Author: Janani Ravichandran <janani.rvchndrn@gmail.com>
Date: Tue Jun 06 10:14:29 2017

UPSTREAM: staging: android: Remove unneeded else following a return

Remove unnecessary else when there is a return statement in the
corresponding if block.
Coccinelle patch used:

@rule1@
expression e1;
@@

	if (e1) { ... return ...; }
-       else{
	        ...
-            }

@rule2@
expression e2;
statement s1;
@@

	if(e2) { ... return ...; }
-       else
		s1

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5f9001dc4221a3d63e2ad5f6d5aef159c2734704)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I3f252b0c1bff373d80b5f8672bd5871b671b6806
Reviewed-on: https://chromium-review.googlesource.com/516568
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/9af39868e433a397f56f1ac9b9708de71c12907f/drivers/staging/android/sync.c

Project Member

Comment 37 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/acfdf6b50e40c09f5b88cb780ed82638dc970c45

commit acfdf6b50e40c09f5b88cb780ed82638dc970c45
Author: Christian König <christian.koenig@amd.com>
Date: Tue Jun 06 10:14:31 2017

UPSTREAM: dma-buf/fence: fix fence_is_later v2

A fence is never later than itself. This caused a bunch of overhead for AMDGPU.

v2: simplify check as suggested by Michel.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Christian Knig <christian.koenig@amd.com>
Reviewed-by: Michel Dnzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit b47bcb93bbf201e9c5af698945755efeb60c0bc8)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: If549f07e3223fdbd5d3ee8838f505c7dd9174b38
Reviewed-on: https://chromium-review.googlesource.com/516570
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/acfdf6b50e40c09f5b88cb780ed82638dc970c45/include/linux/fence.h

Project Member

Comment 38 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/a252f20c34c036b49813ac682ec1c1140513b242

commit a252f20c34c036b49813ac682ec1c1140513b242
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 06 10:14:32 2017

UPSTREAM: staging/android: refactor SYNC IOCTLs

Change SYNC_IOC_FILE_INFO (former SYNC_IOC_FENCE_INFO) behaviour to avoid
future API breaks and optimize buffer allocation.

Now num_fences can be filled by the caller to inform how many fences it
wants to retrieve from the kernel. If the num_fences passed is greater
than zero info->sync_fence_info should point to a buffer with enough space
to fit all fences.

However if num_fences passed to the kernel is 0, the kernel will reply
with number of fences of the sync_file.

Sending first an ioctl with num_fences = 0 can optimize buffer allocation,
in a first call with num_fences = 0 userspace will receive the actual
number of fences in the num_fences filed.

Then it can allocate a buffer with the correct size on sync_fence_info and
call SYNC_IOC_FILE_INFO again, but now with the actual value of num_fences
in the sync_file.

info->sync_fence_info was converted to __u64 pointer to prevent 32bit
compatibility issues. And a flags member was added.

An example userspace code for the later would be:

	struct sync_file_info *info;
	int err, size, num_fences;

	info = malloc(sizeof(*info));

	info.flags = 0;
	err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
	num_fences = info->num_fences;

	if (num_fences) {
		info.flags = 0;
		size = sizeof(struct sync_fence_info) * num_fences;
		info->num_fences = num_fences;
		info->sync_fence_info = (uint64_t) calloc(num_fences,
							  sizeof(struct sync_fence_info));

		err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
	}

Finally the IOCTLs numbers were changed to avoid any potential old
userspace running the old API to get weird errors. Changing the opcodes
will make them fail right away. This is just a precaution, there no
upstream users of these interfaces yet and the only user is Android, but
we don't expect anyone trying to run android userspace and all it
dependencies on top of upstream kernels.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Greg Hackmann <ghackmann@google.com>
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2d75c88fefb228aedfb135228acb6620db8f0e40)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I988ea7226235d137f7a512ba706e8047dad0de27
Reviewed-on: https://chromium-review.googlesource.com/516571
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/a252f20c34c036b49813ac682ec1c1140513b242/drivers/staging/android/sync.c
[modify] https://crrev.com/a252f20c34c036b49813ac682ec1c1140513b242/drivers/staging/android/uapi/sync.h

Project Member

Comment 39 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/657b2ece3053be0115dfb6ff2345b6c16a2a0708

commit 657b2ece3053be0115dfb6ff2345b6c16a2a0708
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 06 10:14:33 2017

UPSTREAM: staging/android: remove redundant comments on sync_merge_data

struct sync_merge_data already have documentation on top of the
struct definition. No need to duplicate it.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a64d6a68667e61f34b27df294e25da6a45f31ff2)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I88420d49bd5c5e0b0bfeb6cb4380b797f4b6d81a
Reviewed-on: https://chromium-review.googlesource.com/516572
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/657b2ece3053be0115dfb6ff2345b6c16a2a0708/drivers/staging/android/uapi/sync.h

Project Member

Comment 40 by bugdroid1@chromium.org, Jun 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/b471ca86a751459f33aa71619ce9682c56956f95

commit b471ca86a751459f33aa71619ce9682c56956f95
Author: Guenter Roeck <groeck@chromium.org>
Date: Wed Jun 07 23:59:06 2017

FIXUP: BACKPORT: staging/android: rename sync_fence to sync_file

In file included from drivers/gpu/arm/midgard/mali_kbase.h:25:0,
                 from drivers/gpu/arm/midgard/mali_kbase_softjobs.c:20:
drivers/gpu/arm/midgard/mali_kbase_softjobs.c:
		In function 'kbase_process_soft_job':
drivers/gpu/arm/midgard/mali_kbase_softjobs.c:1175:27: error:
		'struct kbase_jd_atom' has no member named 'fence'

'fence' has been renamed to 'sfile'.

BUG= chromium:714307 
TEST=Build image with CONFIG_MALI_DEBUG enabled

Change-Id: I5a7493c2066b5dcf185b1eedba0cdd3efd9d027b
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/527294
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>

[modify] https://crrev.com/b471ca86a751459f33aa71619ce9682c56956f95/drivers/gpu/arm/midgard/mali_kbase_softjobs.c

Project Member

Comment 41 by bugdroid1@chromium.org, Jun 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/a96ad39d877823283ff3e0d79374910d85c81e1e

commit a96ad39d877823283ff3e0d79374910d85c81e1e
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Mon Jun 12 21:16:18 2017

UPSTREAM: staging/android: move sync_file functions comments to sync.c

To keep comments in line with drivers/dma-buf/ move all sync_file comments
to sync.c.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 696f74cf543997732d87956c5a88de6e9bd42605)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I9cc9ce3573ba6090fbe24fdb3e6fb7c20dd8e540
Reviewed-on: https://chromium-review.googlesource.com/516574
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/a96ad39d877823283ff3e0d79374910d85c81e1e/drivers/staging/android/sync.c
[modify] https://crrev.com/a96ad39d877823283ff3e0d79374910d85c81e1e/drivers/staging/android/sync.h

Project Member

Comment 42 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/a0f1def43528fbf522aabfe3cb603324831c068d

commit a0f1def43528fbf522aabfe3cb603324831c068d
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 13 05:33:17 2017

BACKPORT: staging/android: make sync_file_fdget() static

There is no plan in the near future to use this function outside of this
file so keep it as static.

Re-implement sync_file_fdget privately in mali kbase because it needs to
use it.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 10e362c387e45f01cc38f62dec8f0bc3f1d676b5)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: If89950de51724353c30187df2a959b492789dcb4
Reviewed-on: https://chromium-review.googlesource.com/516576
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/a0f1def43528fbf522aabfe3cb603324831c068d/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
[modify] https://crrev.com/a0f1def43528fbf522aabfe3cb603324831c068d/drivers/staging/android/sync.c
[modify] https://crrev.com/a0f1def43528fbf522aabfe3cb603324831c068d/drivers/gpu/arm/midgard/mali_kbase_sync.h
[modify] https://crrev.com/a0f1def43528fbf522aabfe3cb603324831c068d/drivers/staging/android/sync.h
[modify] https://crrev.com/a0f1def43528fbf522aabfe3cb603324831c068d/drivers/gpu/arm/midgard/mali_kbase_sync_user.c

Project Member

Comment 43 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/ff8cf77529f3d2fe554ec5daff05351c8ce4c351

commit ff8cf77529f3d2fe554ec5daff05351c8ce4c351
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 13 05:33:18 2017

BACKPORT: staging/android: remove name arg from sync_file_create()

Simplifies the API to only receive the fence it needs to add to the
sync and create a name for the sync_file based on the fence context and
seqno.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d7c3110c28dee67f6766ae26cac629358233a6b4)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I922563bdc1248e8089a1d1ef43ce9e08131421c5
Reviewed-on: https://chromium-review.googlesource.com/516577
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Sean Paul <seanpaul@google.com>

[modify] https://crrev.com/ff8cf77529f3d2fe554ec5daff05351c8ce4c351/drivers/staging/android/sync.c
[modify] https://crrev.com/ff8cf77529f3d2fe554ec5daff05351c8ce4c351/drivers/gpu/arm/midgard/mali_kbase_sync_user.c
[modify] https://crrev.com/ff8cf77529f3d2fe554ec5daff05351c8ce4c351/drivers/staging/android/sync.h
[modify] https://crrev.com/ff8cf77529f3d2fe554ec5daff05351c8ce4c351/drivers/staging/android/sync_debug.c

Project Member

Comment 44 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/7ede53e87a84ccd69d65e7e86f1c9aede7207264

commit 7ede53e87a84ccd69d65e7e86f1c9aede7207264
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 13 05:33:19 2017

UPSTREAM: staging/android: prepare sync_file for de-staging

Move its functions and structs to their own file. Also moves function's
docs to the .c file.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d4cab38e153d62ecd502645390c0289c1b8337df)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Iddaac10b53b2bce6025171edfc9c62ecc730e5bd
Reviewed-on: https://chromium-review.googlesource.com/516578
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/7ede53e87a84ccd69d65e7e86f1c9aede7207264/drivers/staging/android/sync.c
[modify] https://crrev.com/7ede53e87a84ccd69d65e7e86f1c9aede7207264/drivers/staging/android/Makefile
[add] https://crrev.com/7ede53e87a84ccd69d65e7e86f1c9aede7207264/drivers/staging/android/sync_file.c
[modify] https://crrev.com/7ede53e87a84ccd69d65e7e86f1c9aede7207264/drivers/staging/android/sync.h
[rename] https://crrev.com/7ede53e87a84ccd69d65e7e86f1c9aede7207264/drivers/staging/android/uapi/sync_file.h
[add] https://crrev.com/7ede53e87a84ccd69d65e7e86f1c9aede7207264/drivers/staging/android/sync_file.h
[modify] https://crrev.com/7ede53e87a84ccd69d65e7e86f1c9aede7207264/drivers/staging/android/sync_debug.c

Project Member

Comment 45 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/2957895f9bedfedfcaf936f6832370d831eb441a

commit 2957895f9bedfedfcaf936f6832370d831eb441a
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 13 05:33:20 2017

UPSTREAM: staging/android: improve documentation for sync_file

num_fences was missing a colon mark and sync_file_create() now have
better description.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c240a714a6ad68458c3caf61ab6216184e52b631)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I9bbbee2e930f6a1f72be981075de67b8d3c69bc9
Reviewed-on: https://chromium-review.googlesource.com/516579
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/2957895f9bedfedfcaf936f6832370d831eb441a/drivers/staging/android/sync_file.h
[modify] https://crrev.com/2957895f9bedfedfcaf936f6832370d831eb441a/drivers/staging/android/sync_file.c

Project Member

Comment 46 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/529640aa7e9b5538ab890b40b836f45e4689b0ba

commit 529640aa7e9b5538ab890b40b836f45e4689b0ba
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Tue Jun 13 05:33:21 2017

UPSTREAM: staging/android: style fix: alignment to match the open parenthesis

Fix checks reported by checkpatch.pl.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 92e06213f11a87effad8bdd4d910958b89eec044)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Id44d89fc0b3998955f6932c8b89027aa447d94bd
Reviewed-on: https://chromium-review.googlesource.com/516580
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/529640aa7e9b5538ab890b40b836f45e4689b0ba/drivers/staging/android/sync_file.c

Project Member

Comment 47 by bugdroid1@chromium.org, Jun 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/ddd8ae5424d813a8bd787c321c65f19c12618746

commit ddd8ae5424d813a8bd787c321c65f19c12618746
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Wed Jun 14 04:23:52 2017

UPSTREAM: dma-buf/sync_file: de-stage sync_file headers

Move sync_file headers file to include/ dir.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 460bfc41fd52959311ed0328163f785e023857af)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ie18bd14452d75a0c5e3ddc66ee981889581501dd
Reviewed-on: https://chromium-review.googlesource.com/516581
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[rename] https://crrev.com/ddd8ae5424d813a8bd787c321c65f19c12618746/include/uapi/linux/sync_file.h
[modify] https://crrev.com/ddd8ae5424d813a8bd787c321c65f19c12618746/drivers/staging/android/sync.h
[modify] https://crrev.com/ddd8ae5424d813a8bd787c321c65f19c12618746/drivers/staging/android/sync_file.c
[modify] https://crrev.com/ddd8ae5424d813a8bd787c321c65f19c12618746/drivers/staging/android/sync_debug.c
[rename] https://crrev.com/ddd8ae5424d813a8bd787c321c65f19c12618746/include/linux/sync_file.h

Project Member

Comment 48 by bugdroid1@chromium.org, Jun 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/4a8f36189f874e324ae8ae763f8bebb10a5d745c

commit 4a8f36189f874e324ae8ae763f8bebb10a5d745c
Author: Dominik Behr <dbehr@chromium.org>
Date: Wed Jun 14 04:23:53 2017

CHROMIUM: config: enable SYNC_FILE before destage

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I5c4b0aa46101b63c657123c894e99d6b8997f725
Reviewed-on: https://chromium-review.googlesource.com/522894
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/4a8f36189f874e324ae8ae763f8bebb10a5d745c/chromeos/config/base.config

Project Member

Comment 49 by bugdroid1@chromium.org, Jun 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/f7b0edb58dfe45e8ffc721de6298b777695f791e

commit f7b0edb58dfe45e8ffc721de6298b777695f791e
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Wed Jun 14 04:23:54 2017

UPSTREAM: dma-buf/sync_file: de-stage sync_file

sync_file is useful to connect one or more fences to the file. The file is
used by userspace to track fences between drivers that share DMA bufs.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 62304fb1fc0801925568e191261b650e1546ce8c)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ie2c1efb51d850595b0d715e2ff285e4a2cdf8517
Reviewed-on: https://chromium-review.googlesource.com/522895
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/f7b0edb58dfe45e8ffc721de6298b777695f791e/drivers/staging/android/Makefile
[rename] https://crrev.com/f7b0edb58dfe45e8ffc721de6298b777695f791e/drivers/dma-buf/sync_file.c
[modify] https://crrev.com/f7b0edb58dfe45e8ffc721de6298b777695f791e/drivers/staging/android/Kconfig
[add] https://crrev.com/f7b0edb58dfe45e8ffc721de6298b777695f791e/drivers/dma-buf/Kconfig
[modify] https://crrev.com/f7b0edb58dfe45e8ffc721de6298b777695f791e/drivers/Kconfig
[modify] https://crrev.com/f7b0edb58dfe45e8ffc721de6298b777695f791e/drivers/dma-buf/Makefile

Project Member

Comment 50 by bugdroid1@chromium.org, Jun 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/d390b3afc3be88e761dae341a49b9dd43dd5a5d0

commit d390b3afc3be88e761dae341a49b9dd43dd5a5d0
Author: Luis de Bethencourt <luisbg@osg.samsung.com>
Date: Wed Jun 14 04:23:56 2017

UPSTREAM: fence: add missing descriptions for fence

The members child_list and active_list were added to the fence struct
without descriptions for the Documentation. Adding these.

BUG= chromium:714307 
TEST=boot kevin and pyro

Fixes: b55b54b5db33 ("staging/android: remove struct sync_pt")
Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit 4320c2a22df12f954edd4997f71ca3a4216312b2)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ib9598e3e6adf4454ae7cb5881a9cfb87847b545c
Reviewed-on: https://chromium-review.googlesource.com/522897
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/d390b3afc3be88e761dae341a49b9dd43dd5a5d0/include/linux/fence.h

Project Member

Comment 51 by bugdroid1@chromium.org, Jun 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/c8d01d8362c5831453c61ce2174ad3512f25b25f

commit c8d01d8362c5831453c61ce2174ad3512f25b25f
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Wed Jun 14 21:38:13 2017

BACKPORT: staging/android: store last signaled value on sync timeline

Now fence timeline is aware of the last signaled fence, as it
receives the increment to the current value in sync_timeline_signal().

That allow us to remove .has_signaled() from timeline_ops as we can
directly compare using timeline->value and fence->seqno in sync.c

In mali kbase, remove timeline_has_signaled. Switch mali timeline to
use base timeline value and mali fence to use base fence seqno instead
of value. Call sync_timeline_signal from kbase_sync_fence_signal instead
of kbase_fence_trigger.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 63bb0bc1b19d125c052e3b199421a0ca4d67e021)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I0ecd6e19c941a29b0cdf707156ec31b13a02281c
Reviewed-on: https://chromium-review.googlesource.com/522898
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/c8d01d8362c5831453c61ce2174ad3512f25b25f/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
[modify] https://crrev.com/c8d01d8362c5831453c61ce2174ad3512f25b25f/drivers/gpu/arm/midgard/mali_kbase_sync.c
[modify] https://crrev.com/c8d01d8362c5831453c61ce2174ad3512f25b25f/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/c8d01d8362c5831453c61ce2174ad3512f25b25f/drivers/staging/android/sync.h
[modify] https://crrev.com/c8d01d8362c5831453c61ce2174ad3512f25b25f/drivers/staging/android/sync.c

Project Member

Comment 52 by bugdroid1@chromium.org, Jun 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/06ac70f39e8a7c0bfdf88eb072dc1749b45c856c

commit 06ac70f39e8a7c0bfdf88eb072dc1749b45c856c
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri Jun 16 03:13:55 2017

BACKPORT: staging/android: remove .{fence, timeline}_value_str() from timeline_ops

Now that the value of fence and the timeline are not stored by sw_sync
anymore we can remove this extra abstraction to retrieve this data.

This patch changes both fence_ops (.fence_value_str and
.timeline_value_str) to return the str directly.

It also clean up struct sync_timeline_ops by removing both ops from there.

Remove _value_str functions from mali kbase.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5c1401f83a16b7ee3762c9044ab56ed3f3cdcdcd)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: If9c7e24e11e14d2c251a5995e95a22916d43f40f
Reviewed-on: https://chromium-review.googlesource.com/522899
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/06ac70f39e8a7c0bfdf88eb072dc1749b45c856c/drivers/gpu/arm/midgard/mali_kbase_sync.c
[modify] https://crrev.com/06ac70f39e8a7c0bfdf88eb072dc1749b45c856c/drivers/staging/android/trace/sync.h
[modify] https://crrev.com/06ac70f39e8a7c0bfdf88eb072dc1749b45c856c/drivers/staging/android/sync.c
[modify] https://crrev.com/06ac70f39e8a7c0bfdf88eb072dc1749b45c856c/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/06ac70f39e8a7c0bfdf88eb072dc1749b45c856c/drivers/staging/android/sync.h
[modify] https://crrev.com/06ac70f39e8a7c0bfdf88eb072dc1749b45c856c/drivers/staging/android/sync_debug.c

Project Member

Comment 53 by bugdroid1@chromium.org, Jun 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/a8b4b0b9a87fcf73d59621b3472247c13f3f14b3

commit a8b4b0b9a87fcf73d59621b3472247c13f3f14b3
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Sat Jun 17 08:12:40 2017

BACKPORT: staging/android: remove struct sync_timeline_ops

Move drv_name, the last field of sync_timeline_ops, to sync_timeline
and remove sync_timeline_ops.

struct sync_timeline_ops was just an extra abstraction on top of
fence_ops, and in the last few commits we removed all it ops in favor
of cleaner fence_ops.

Remove timeline_ops from mali kbase. Rework check whether timeline is
created by mali kbase by checking drv name.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ef30afefeaf624c483e56c63e60e0dda8c42a0ef)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I5298bfed3189c5ba9fd94b2d58c22ff3311c861c
Reviewed-on: https://chromium-review.googlesource.com/522900
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/a8b4b0b9a87fcf73d59621b3472247c13f3f14b3/drivers/staging/android/sync.c
[modify] https://crrev.com/a8b4b0b9a87fcf73d59621b3472247c13f3f14b3/drivers/gpu/arm/midgard/mali_kbase_sync.c
[modify] https://crrev.com/a8b4b0b9a87fcf73d59621b3472247c13f3f14b3/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/a8b4b0b9a87fcf73d59621b3472247c13f3f14b3/drivers/staging/android/sync.h
[modify] https://crrev.com/a8b4b0b9a87fcf73d59621b3472247c13f3f14b3/drivers/staging/android/sync_debug.c

Project Member

Comment 54 by bugdroid1@chromium.org, Jun 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/ae9936eb49e4d17587b1d6351ccc2cb8b51780d7

commit ae9936eb49e4d17587b1d6351ccc2cb8b51780d7
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Sat Jun 17 08:12:41 2017

UPSTREAM: staging/android: remove sw_sync_timeline and sw_sync_pt

As we moved value storage to sync_timeline and fence those two structs
became useless and can be removed now.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit dcc280803e8a803643b6d12b2f35df608623c7fd)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I5cd0dacc4142cbd6a6d37263754926726b30b177
Reviewed-on: https://chromium-review.googlesource.com/522901
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/ae9936eb49e4d17587b1d6351ccc2cb8b51780d7/drivers/staging/android/sw_sync.h
[modify] https://crrev.com/ae9936eb49e4d17587b1d6351ccc2cb8b51780d7/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/ae9936eb49e4d17587b1d6351ccc2cb8b51780d7/drivers/staging/android/sync_debug.c

Project Member

Comment 55 by bugdroid1@chromium.org, Jun 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/1c3dce0cfa1282e974820c6783d99ecdb202c1b7

commit 1c3dce0cfa1282e974820c6783d99ecdb202c1b7
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Sun Jun 18 18:51:44 2017

UPSTREAM: staging/android: remove sw_sync.[ch] files

We can glue the sw_sync file operations directly on the sync framework
without the need to pass through sw_sync wrappers.

It only builds sw_sync debugfs file support if CONFIG_SW_SYNC is enabled.

Img-rogue: include sync.h instead of sw_sync.h. Change sw_sync_timeline_inc
to sync_timeline_signal.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d21858fdb3269e98aa62d522efec7ce2865368e6)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I0bc5b49394908e61d893931fe577274ac9d2f249
Reviewed-on: https://chromium-review.googlesource.com/523442
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/1c3dce0cfa1282e974820c6783d99ecdb202c1b7/drivers/gpu/drm/img-rogue/1.7/cache_rangebased.c
[delete] https://crrev.com/ae9936eb49e4d17587b1d6351ccc2cb8b51780d7/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/1c3dce0cfa1282e974820c6783d99ecdb202c1b7/drivers/staging/android/Makefile
[modify] https://crrev.com/1c3dce0cfa1282e974820c6783d99ecdb202c1b7/drivers/gpu/drm/img-rogue/cache_km.c
[delete] https://crrev.com/ae9936eb49e4d17587b1d6351ccc2cb8b51780d7/drivers/staging/android/sw_sync.h
[modify] https://crrev.com/1c3dce0cfa1282e974820c6783d99ecdb202c1b7/drivers/staging/android/sync_debug.c

Project Member

Comment 56 by bugdroid1@chromium.org, Jun 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/d31cc58dfa445065a3517650213d6967b048b3f3

commit d31cc58dfa445065a3517650213d6967b048b3f3
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Sun Jun 18 18:51:45 2017

BACKPORT: staging/android: rename android_fence to timeline_fence

We are moving out of staging/android so rename it to a name that is not
related to android anymore.

Account for android_fence_disable_signaling op added by us.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4be6e00cd34210d5b3d37ddb7bf46137cf5a99b1)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ief1aa78ec3abf2e767365835145ea24acabb2e75
Reviewed-on: https://chromium-review.googlesource.com/523443
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/d31cc58dfa445065a3517650213d6967b048b3f3/drivers/staging/android/sync.c

Project Member

Comment 57 by bugdroid1@chromium.org, Jun 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/fc54f593ceb28cf348c281dd65ce346bb1412b77

commit fc54f593ceb28cf348c281dd65ce346bb1412b77
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Sun Jun 18 18:51:47 2017

UPSTREAM: staging/android: remove unnecessary check for fence

When we call sync_print_fence() fence is always valid.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 724812d6a66e3a1524f7eb78b900bc0624b6d7dc)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I18f67e48c3a044fecf51d94a28058c667fdbda07
Reviewed-on: https://chromium-review.googlesource.com/523444
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/fc54f593ceb28cf348c281dd65ce346bb1412b77/drivers/staging/android/sync_debug.c

Project Member

Comment 58 by bugdroid1@chromium.org, Jun 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/af76d6a7846e32191979d65fe3c07257fb8cd259

commit af76d6a7846e32191979d65fe3c07257fb8cd259
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Sun Jun 18 18:51:48 2017

BACKPORT: staging/android: remove size arg of sync_timeline_create()

After we removed sw_sync_timeline this arg has not been really used by
anyone, all its users pass the size of struct sync_timeline there.

So simplify this function but not requiring the size anymore.

In mali kbase use wrapper structure around sync_timeline struct stored
in fd.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 62627c8f61e09a6204cd77de30df9a83ff158812)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I468dc7afe56485ded222248afbc7523030ec61b5
Reviewed-on: https://chromium-review.googlesource.com/523445
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/af76d6a7846e32191979d65fe3c07257fb8cd259/drivers/gpu/arm/midgard/mali_kbase_sync.h
[modify] https://crrev.com/af76d6a7846e32191979d65fe3c07257fb8cd259/drivers/gpu/arm/midgard/mali_kbase_sync.c
[modify] https://crrev.com/af76d6a7846e32191979d65fe3c07257fb8cd259/drivers/gpu/arm/midgard/mali_kbase_sync_user.c
[modify] https://crrev.com/af76d6a7846e32191979d65fe3c07257fb8cd259/drivers/staging/android/sync.c
[modify] https://crrev.com/af76d6a7846e32191979d65fe3c07257fb8cd259/drivers/staging/android/sync.h
[modify] https://crrev.com/af76d6a7846e32191979d65fe3c07257fb8cd259/drivers/staging/android/sync_debug.c

Project Member

Comment 59 by bugdroid1@chromium.org, Jun 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/6addb52fb6808679c654f1b14d2fbfa93d7f5df6

commit 6addb52fb6808679c654f1b14d2fbfa93d7f5df6
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Sun Jun 18 18:51:49 2017

BACKPORT: staging/android: bring struct sync_pt back

Move the list_head members from sync_pt to struct fence was a mistake,
they will not be used by struct fence as planned before, so here we create
sync_pt again to bring the list heads back.

Fix timeline_fence_disable_signaling.

In mali kbase switch to use sync_pt instead of fence.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0431b9065f28ecf6c320fefebe0241620049984f)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ibe1593e51bab9fd8368307af68d50d69f8d2e39d
Reviewed-on: https://chromium-review.googlesource.com/526403
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/6addb52fb6808679c654f1b14d2fbfa93d7f5df6/drivers/staging/android/sync.c
[modify] https://crrev.com/6addb52fb6808679c654f1b14d2fbfa93d7f5df6/drivers/gpu/arm/midgard/mali_kbase_sync.c
[modify] https://crrev.com/6addb52fb6808679c654f1b14d2fbfa93d7f5df6/include/linux/fence.h
[modify] https://crrev.com/6addb52fb6808679c654f1b14d2fbfa93d7f5df6/drivers/staging/android/sync.h
[modify] https://crrev.com/6addb52fb6808679c654f1b14d2fbfa93d7f5df6/drivers/staging/android/sync_debug.c

Project Member

Comment 60 by bugdroid1@chromium.org, Jun 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/f0d8154592fc0d88dd2744e12037040abcdaca2c

commit f0d8154592fc0d88dd2744e12037040abcdaca2c
Author: Guenter Roeck <groeck@chromium.org>
Date: Tue Jun 20 22:28:48 2017

CHROMIUM: Update MALI_MIDGARD dependencies

ToT as well as the tail of currently pending patch series fails to build
MALI_MIDGARD as module. Trying to do so results in the following errors.

ERROR: "sync_pt_create" [drivers/gpu/arm/midgard/mali_kbase.ko] undefined!
ERROR: "sync_timeline_put" [drivers/gpu/arm/midgard/mali_kbase.ko] undefined!
ERROR: "sync_timeline_create" [drivers/gpu/arm/midgard/mali_kbase.ko] undefined!
ERROR: "fence_to_sync_pt" [drivers/gpu/arm/midgard/mali_kbase.ko] undefined!

Instead of trying to chase its module build errors, mark MALI_MIDGARD as bool
to clarify that it is not expected to be buildable as module.

Also, mark its dependencies on DRM and THERMAL.

BUG= chromium:714307 
TEST=Test various build configuration options

Change-Id: I99df896dbd8c674bcf98cc41e0cae50cef49cd6f
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/539955
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>

[modify] https://crrev.com/f0d8154592fc0d88dd2744e12037040abcdaca2c/drivers/gpu/arm/midgard/Kconfig

Project Member

Comment 61 by bugdroid1@chromium.org, Jun 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/f0d8154592fc0d88dd2744e12037040abcdaca2c

commit f0d8154592fc0d88dd2744e12037040abcdaca2c
Author: Guenter Roeck <groeck@chromium.org>
Date: Tue Jun 20 22:28:48 2017

CHROMIUM: Update MALI_MIDGARD dependencies

ToT as well as the tail of currently pending patch series fails to build
MALI_MIDGARD as module. Trying to do so results in the following errors.

ERROR: "sync_pt_create" [drivers/gpu/arm/midgard/mali_kbase.ko] undefined!
ERROR: "sync_timeline_put" [drivers/gpu/arm/midgard/mali_kbase.ko] undefined!
ERROR: "sync_timeline_create" [drivers/gpu/arm/midgard/mali_kbase.ko] undefined!
ERROR: "fence_to_sync_pt" [drivers/gpu/arm/midgard/mali_kbase.ko] undefined!

Instead of trying to chase its module build errors, mark MALI_MIDGARD as bool
to clarify that it is not expected to be buildable as module.

Also, mark its dependencies on DRM and THERMAL.

BUG= chromium:714307 
TEST=Test various build configuration options

Change-Id: I99df896dbd8c674bcf98cc41e0cae50cef49cd6f
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/539955
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>

[modify] https://crrev.com/f0d8154592fc0d88dd2744e12037040abcdaca2c/drivers/gpu/arm/midgard/Kconfig

Project Member

Comment 62 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/55e8a5e4af7a011d58f730fea9e1ac640a3cb358

commit 55e8a5e4af7a011d58f730fea9e1ac640a3cb358
Author: Christian König <christian.koenig@amd.com>
Date: Thu Jun 22 06:37:56 2017

BACKPORT: dma-buf/fence: make fence context 64 bit v2

Fence contexts are created on the fly (for example) by the GPU scheduler used
in the amdgpu driver as a result of an userspace request. Because of this
userspace could in theory force a wrap around of the 32bit context number
if it doesn't behave well.

Avoid this by increasing the context number to 64bits. This way even when
userspace manages to allocate a billion contexts per second it takes more
than 500 years for the context number to wrap around.

v2: fix printf formats as well.

Fix Mali kbase and drm sync helper which use fence context.
Fix warning in sync_file. It will make next commit empty but we need to build
without warnings.
Fix img-rogue to use 64 bit fence context.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Christian Knig <christian.koenig@amd.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1464786612-5010-2-git-send-email-deathsimple@vodafone.de
(cherry picked from commit 76bf0db5543976ef50362db7071da367cb118532)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

UPSTREAM: dma-buf/sync_file: fix build warning with context format type

Christian Knig changed fence context to a u64 type, so we need to
update all users accordingly.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1464968791-4564-1-git-send-email-gustavo@padovan.org
(cherry picked from commit 041916a770155c84cb29de3601e626a7ac7a3219)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ib4abd5e3d73bfc8f26b296a8b6c87a2cc3f36ec3
Reviewed-on: https://chromium-review.googlesource.com/527906
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>

[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/dma-buf/fence.c
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/gpu/arm/midgard/mali_kbase_defs.h
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/gpu/drm/amd/amdgpu/amdgpu.h
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/gpu/drm/radeon/radeon.h
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/gpu/drm/nouveau/nouveau_fence.h
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/gpu/drm/qxl/qxl_release.c
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/gpu/drm/drm_sync_helper.c
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/gpu/drm/img-rogue/1.7/pvr_fence.h
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/staging/android/sync_debug.h
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/include/linux/fence.h
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/include/drm/drm_sync_helper.h
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/dma-buf/sync_file.c
[modify] https://crrev.com/55e8a5e4af7a011d58f730fea9e1ac640a3cb358/drivers/gpu/drm/img-rogue/1.7/pvr_fence.c

Project Member

Comment 63 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/f42fcf3ce950e7c64b53b1c443df6c6424b29cea

commit f42fcf3ce950e7c64b53b1c443df6c6424b29cea
Author: Mathias Krause <minipli@googlemail.com>
Date: Thu Jun 22 06:37:58 2017

UPSTREAM: dma-buf: propagate errors from dma_buf_describe() on debugfs read

The callback function dma_buf_describe() returns an int not void so the
function pointer cast in dma_buf_show() is wrong. dma_buf_describe() can
also fail when acquiring the mutex gets interrupted so always returning
0 in dma_buf_show() is wrong, too.

Fix both issues by avoiding the indirection via dma_buf_show() and call
dma_buf_describe() directly. Rename it to dma_buf_debug_show() to get it
in line with the other functions.

This type mismatch was caught by the PaX RAP plugin.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Brad Spengler <spender@grsecurity.net>
Cc: PaX Team <pageexec@freemail.hu>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit eb0b947e3bf59d263f5bc7c080ce40333b515004)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ie62491f893edbd3bb3123a5730ea3ad5bce9e066
Reviewed-on: https://chromium-review.googlesource.com/527908
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/f42fcf3ce950e7c64b53b1c443df6c6424b29cea/drivers/dma-buf/dma-buf.c

Project Member

Comment 64 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/0f35e8c1bcfbf419aa0050edf27bd50a54f08872

commit 0f35e8c1bcfbf419aa0050edf27bd50a54f08872
Author: Mathias Krause <minipli@googlemail.com>
Date: Thu Jun 22 06:37:59 2017

UPSTREAM: dma-buf: remove dma_buf directory on bufinfo file creation errors

Change the error handling in dma_buf_init_debugfs() to remove the
"dma_buf" directory if creating the "bufinfo" file fails. No need to
have an empty debugfs directory around.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit b7479990435713b00870df3c1d98ff66f6ef1ba2)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I4e8836bb534cc9a77591e1da54dc189f841b3464
Reviewed-on: https://chromium-review.googlesource.com/527909
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/0f35e8c1bcfbf419aa0050edf27bd50a54f08872/drivers/dma-buf/dma-buf.c

Project Member

Comment 65 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/87e3d6a293250aae705e005320b72eb4c7b13e12

commit 87e3d6a293250aae705e005320b72eb4c7b13e12
Author: Mathias Krause <minipli@googlemail.com>
Date: Thu Jun 22 06:38:00 2017

UPSTREAM: dma-buf: remove dma_buf_debugfs_create_file()

There is only a single user of dma_buf_debugfs_create_file() and that
one got the function pointer cast wrong. With that one fixed, there is
no need to have a wrapper for debugfs_create_file(), just call it
directly.

With no users left, we can remove dma_buf_debugfs_create_file().

While at it, simplify the error handling in dma_buf_init_debugfs()
slightly.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1466339491-12639-2-git-send-email-minipli@googlemail.com
(cherry picked from commit bd3e22088f41a16b4c362622c91243f9f4fd7dcb)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I5fe958223736c024984afc404cdf83c2b12d2dce
Reviewed-on: https://chromium-review.googlesource.com/527910
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/87e3d6a293250aae705e005320b72eb4c7b13e12/include/linux/dma-buf.h
[modify] https://crrev.com/87e3d6a293250aae705e005320b72eb4c7b13e12/drivers/dma-buf/dma-buf.c

Project Member

Comment 66 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/571e2e9820019c86898b835d11d82158c3122928

commit 571e2e9820019c86898b835d11d82158c3122928
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Thu Jun 22 06:38:02 2017

UPSTREAM: dma-buf/sync_file: improve Kconfig description for Sync Files

We've got a complaint saying that the description was quite obtuse and
indeed it was. This patch tries to improve it.

BUG= chromium:714307 
TEST=boot kevin and pyro

Cc: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit 31954660a7a613cd01e6ab1e90e7fea6ca6ffc74)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ie22d0dae7f239ae7f0fa5f74fdda3e44ce5f9bb8
Reviewed-on: https://chromium-review.googlesource.com/527911
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/571e2e9820019c86898b835d11d82158c3122928/drivers/dma-buf/Kconfig

Project Member

Comment 67 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/203bbf0cb7da2f208e5529f4d2239eb54dbe946a

commit 203bbf0cb7da2f208e5529f4d2239eb54dbe946a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Jun 22 06:38:03 2017

UPSTREAM: dma-buf: Release module reference on creation failure

If we fail to create the anon file, we need to remember to release the
module reference on the owner.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1468840582-21469-1-git-send-email-chris@chris-wilson.co.uk
(cherry picked from commit a026df4c5fa6bae8eb03b58be720b911494e3da5)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Iaa42f8b16b03e3711cc86be28176397377c616d3
Reviewed-on: https://chromium-review.googlesource.com/528012
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/203bbf0cb7da2f208e5529f4d2239eb54dbe946a/drivers/dma-buf/dma-buf.c

Project Member

Comment 68 by bugdroid1@chromium.org, Jun 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/9da7af76590a395377c6c191b29941d505d7e012

commit 9da7af76590a395377c6c191b29941d505d7e012
Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Date: Fri Jun 23 00:03:38 2017

BACKPORT: tree-wide: replace config_enabled() with IS_ENABLED()

The use of config_enabled() against config options is ambiguous.  In
practical terms, config_enabled() is equivalent to IS_BUILTIN(), but the
author might have used it for the meaning of IS_ENABLED().  Using
IS_ENABLED(), IS_BUILTIN(), IS_MODULE() etc.  makes the intention
clearer.

This commit replaces config_enabled() with IS_ENABLED() where possible.
This commit is only touching bool config options.

I noticed two cases where config_enabled() is used against a tristate
option:

 - config_enabled(CONFIG_HWMON)
  [ drivers/net/wireless/ath/ath10k/thermal.c ]

 - config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)
  [ drivers/gpu/drm/gma500/opregion.c ]

I did not touch them because they should be converted to IS_BUILTIN()
in order to keep the logic, but I was not sure it was the authors'
intention.

Since we only care about sync stuff, this commit has been limited to only
fence.h in backport.

BUG= chromium:714307 
TEST=boot kevin and pyro

Link: http://lkml.kernel.org/r/1465215656-20569-1-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Stas Sergeev <stsp@list.ru>
Cc: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Joshua Kinard <kumba@gentoo.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: yu-cheng yu <yu-cheng.yu@intel.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Will Drewry <wad@chromium.org>
Cc: Nikolay Martynov <mar.kolya@gmail.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: Rafal Milecki <zajec5@gmail.com>
Cc: James Cowgill <James.Cowgill@imgtec.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Alex Smith <alex.smith@imgtec.com>
Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Mikko Rapeli <mikko.rapeli@iki.fi>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Tony Wu <tung7970@gmail.com>
Cc: Huaitong Han <huaitong.han@intel.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andrea Gelmini <andrea.gelmini@gelma.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Rabin Vincent <rabin@rab.in>
Cc: "Maciej W. Rozycki" <macro@imgtec.com>
Cc: David Daney <david.daney@cavium.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 97f2645f358b411ba2afb22e5966753f0ad92916)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I3bdffe207bc0f758ddabc4f3b46cce4ec389ca87
Reviewed-on: https://chromium-review.googlesource.com/530082
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/9da7af76590a395377c6c191b29941d505d7e012/include/linux/fence.h

Project Member

Comment 69 by bugdroid1@chromium.org, Jun 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/dcd55f8a2c8815c46bf8a71861c63662e4940b0e

commit dcd55f8a2c8815c46bf8a71861c63662e4940b0e
Author: Randy Dunlap <rdunlap@infradead.org>
Date: Fri Jun 23 00:03:39 2017

UPSTREAM: include/linux: fix excess fence.h kernel-doc notation

Fix excess fields in kernel-doc notation in <linux/fence.h>
after some struct fields were removed.

Fixes these kernel-doc warnings:
..//include/linux/fence.h:85: warning: Excess struct/union/enum/typedef member 'child_list' description in 'fence'
..//include/linux/fence.h:85: warning: Excess struct/union/enum/typedef member 'active_list' description in 'fence'

Fixes: 0431b9065f28 ("staging/android: bring struct sync_pt back")

BUG= chromium:714307 
TEST=boot kevin and pyro

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c0678b2d6648ab65b68703044709e367799ba9f9)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I8f7ddb2567787b8344f7bcf2f523e801a12184fa
Reviewed-on: https://chromium-review.googlesource.com/530083
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/dcd55f8a2c8815c46bf8a71861c63662e4940b0e/include/linux/fence.h

Project Member

Comment 70 by bugdroid1@chromium.org, Jun 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/1f8df4d3c41d7966f554cc276691ec622cf457dc

commit 1f8df4d3c41d7966f554cc276691ec622cf457dc
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri Jun 23 00:03:40 2017

UPSTREAM: staging/android: do not let userspace trigger WARN_ON

Closing the timeline without waiting all fences to signal is not
a critical failure, it is just bad usage from userspace so avoid
calling WARN_ON in this case.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a4ebee657c9be3afd35530cd4478b0fa514706d7)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ie858937628174185d2b1a820119e74b134946b15
Reviewed-on: https://chromium-review.googlesource.com/530504
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/1f8df4d3c41d7966f554cc276691ec622cf457dc/drivers/staging/android/sw_sync.c

Project Member

Comment 71 by bugdroid1@chromium.org, Jun 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/67c4c7e8dcd70197a31922e4afc3327524878fc5

commit 67c4c7e8dcd70197a31922e4afc3327524878fc5
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri Jun 23 00:03:42 2017

UPSTREAM: staging/android: move trace/sync.h to sync_trace.h

The common behaviour for trace headers is to have them in the same folder
they are used, instead of creating a special trace/ directory.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a04f915eba944d41773146bb6c004212b29a6ace)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I9f2e76edd8763f4fbe78f46282e5ae4ceca06ca4
Reviewed-on: https://chromium-review.googlesource.com/530505
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/67c4c7e8dcd70197a31922e4afc3327524878fc5/drivers/staging/android/sw_sync.c
[rename] https://crrev.com/67c4c7e8dcd70197a31922e4afc3327524878fc5/drivers/staging/android/sync_trace.h

Project Member

Comment 72 by bugdroid1@chromium.org, Jun 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/5a75be6318f13199380c4534960ed2fdeedd30c9

commit 5a75be6318f13199380c4534960ed2fdeedd30c9
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri Jun 23 00:03:43 2017

UPSTREAM: staging/android: prepare sw_sync files for de-staging

remove file paths in the comments and add short description about each
file.

v2: remove file paths instead of just change them.

v3: improve header description as sugggested by Eric

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e912c881f13523fa696f5a7233ee3fffc66fa6a3)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Iba64c1fc57bae902b87e05bca6b5fc738bfa1930
Reviewed-on: https://chromium-review.googlesource.com/530506
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/5a75be6318f13199380c4534960ed2fdeedd30c9/drivers/staging/android/sw_sync.c
[modify] https://crrev.com/5a75be6318f13199380c4534960ed2fdeedd30c9/drivers/staging/android/sync_debug.h
[modify] https://crrev.com/5a75be6318f13199380c4534960ed2fdeedd30c9/drivers/staging/android/sync_debug.c

Project Member

Comment 73 by bugdroid1@chromium.org, Jun 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/2a64298836142eb623bb1342221cc073e37d7f92

commit 2a64298836142eb623bb1342221cc073e37d7f92
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri Jun 23 00:03:44 2017

UPSTREAM: staging/android: add Doc for SW_SYNC ioctl interface

This interface is hidden from kernel headers and it is intended for use
only for testing. So testers would have to add the ioctl information
internally. This is to prevent misuse of this feature.

v2: take in Eric suggestions for the Documentation

v3: really take in Eric suggestions

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit fc0c9a03b57efb769a74fa8b33d68d90153b5950)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I29c4e6970ca7f177dd054beb257e97a98d2f887c
Reviewed-on: https://chromium-review.googlesource.com/530507
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/2a64298836142eb623bb1342221cc073e37d7f92/drivers/staging/android/sw_sync.c

Project Member

Comment 74 by bugdroid1@chromium.org, Jun 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/f4ebea1479350a5b7aae643ab11867e807c88544

commit f4ebea1479350a5b7aae643ab11867e807c88544
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Sat Jun 24 05:56:41 2017

UPSTREAM: dma-buf/fence-array: add fence_is_array()

Add helper to check if fence is array.

v2: Comments from Chris Wilson
	- remove ternary if from ops comparison
	- add EXPORT_SYMBOL(fence_array_ops)

BUG= chromium:714307 
TEST=boot kevin and pyro

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christian Knig <christian.koenig@amd.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Christian Knig <christian.koenig@amd.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit e1aaf311dbe82221910cc0e0809c988de210cc3c)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I342a877a59075f58eb09fdafd3304e17c5a73325
Reviewed-on: https://chromium-review.googlesource.com/530508
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/f4ebea1479350a5b7aae643ab11867e807c88544/include/linux/fence-array.h
[modify] https://crrev.com/f4ebea1479350a5b7aae643ab11867e807c88544/drivers/dma-buf/fence-array.c

Project Member

Comment 75 by bugdroid1@chromium.org, Jun 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/0f7f6da93f971d90296329b85c1caabf5adce9ef

commit 0f7f6da93f971d90296329b85c1caabf5adce9ef
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Sat Jun 24 05:56:42 2017

UPSTREAM: dma-buf/sync_file: refactor fence storage in struct sync_file

Create sync_file->fence to abstract the type of fence we are using for
each sync_file. If only one fence is present we use a normal struct fence
but if there is more fences to be added to the sync_file a fence_array
is created.

This change cleans up sync_file a bit. We don't need to have sync_file_cb
array anymore. Instead, as we always have  one fence, only one fence
callback is registered per sync_file.

v2: Comments from Chris Wilson and Christian Knig
	- Not using fence_ops anymore
	- fence_is_array() was created to differentiate fence from fence_array
	- fence_array_teardown() is now exported and used under fence_is_array()
	- struct sync_file lost num_fences member

v3: Comments from Chris Wilson and Christian Knig
	- struct sync_file lost status member in favor of fence_is_signaled()
	- drop use of fence_array_teardown()
	- use sizeof(*fence) to allocate only an array on fence pointers

v4: Comments from Chris Wilson
	- use sizeof(*fence) to reallocate array
	- fix typo in comments
	- protect num_fences sum against overflows
	- use array->base instead of casting the to struct fence

v5: fixes checkpatch warnings

v6: fix case where all fences are signaled.

In Mali kbase, support new sync_file internals. Also get rid of mali_sync_pt
struct and store fence result in base fence status field.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Christian Knig <christian.koenig@amd.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit a02b9dc90d844cc7df7b63264e7920cc425052d9)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

dma-buf/sync_file: Increment refcount of fence when all are signaled.

When we merge several fences, if all of them are signaled already, we
still keep one of them. So instead of using add_fence(), which will not
increase the refcount of signaled fences, we should explicitly call
fence_get() for the fence we are keeping.

This patch fixes a kernel panic that can be triggered by creating a fence
that is expired (or increasing the timeline until it expires), then
creating a merged fence out of it, and deleting the merged fence. This
will make the original expired fence's refcount go to zero.

This patch has to be squashe with the previous one or the kernel will
crash when using fences.

Testcase: igt/sw_sync/sync_expired_merge
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1473966865-4508-1-git-send-email-rafael.antognolli@intel.com
(cherry picked from commit 7cec540a724654b6b046200c117bb98ea1bc5d04)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I8200f777ddebf40769391bf967a69c681a9c7a9f
Reviewed-on: https://chromium-review.googlesource.com/530509
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/0f7f6da93f971d90296329b85c1caabf5adce9ef/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
[modify] https://crrev.com/0f7f6da93f971d90296329b85c1caabf5adce9ef/drivers/gpu/arm/midgard/mali_kbase_sync.c
[modify] https://crrev.com/0f7f6da93f971d90296329b85c1caabf5adce9ef/drivers/dma-buf/sync_file.c
[modify] https://crrev.com/0f7f6da93f971d90296329b85c1caabf5adce9ef/drivers/staging/android/sync_debug.c
[modify] https://crrev.com/0f7f6da93f971d90296329b85c1caabf5adce9ef/include/linux/sync_file.h

Project Member

Comment 76 by bugdroid1@chromium.org, Jun 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/029c928640f63f97d4671d10c6e38b006a999df5

commit 029c928640f63f97d4671d10c6e38b006a999df5
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Mon Jun 26 07:17:43 2017

BACKPORT: dma-buf/sw_sync: de-stage SW_SYNC

SW_SYNC allows to run tests on the sync_file framework via debugfs on

<debugfs>/sync/sw_sync

Opening and closing the file triggers creation and release of a sync
timeline. To create fences on this timeline the SW_SYNC_IOC_CREATE_FENCE
ioctl should be used. To increment the timeline value use SW_SYNC_IOC_INC.

Also it exports Sync information on

<debugfs>/sync/info

Small conflicts in Makefile and Kconfig.
Fix include path in Mali kbase Kbuild.
Fix include path in img-rogue.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 35538d7822e86cb38015c21bb708a433f8814af0)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I6f187beb98e538de14bb52405829d212f826b377
Reviewed-on: https://chromium-review.googlesource.com/530510
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[rename] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/dma-buf/sync_trace.h
[modify] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/gpu/arm/midgard/Kbuild
[rename] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/dma-buf/sync_debug.h
[modify] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/gpu/drm/img-rogue/1.7/cache_rangebased.c
[rename] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/dma-buf/sync_debug.c
[modify] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/staging/android/Makefile
[rename] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/dma-buf/sw_sync.c
[modify] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/gpu/drm/img-rogue/cache_km.c
[modify] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/dma-buf/Kconfig
[modify] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/staging/android/Kconfig
[modify] https://crrev.com/029c928640f63f97d4671d10c6e38b006a999df5/drivers/dma-buf/Makefile

Project Member

Comment 77 by bugdroid1@chromium.org, Jun 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/071a49c374162629fdad8490d6b60e819d3e6997

commit 071a49c374162629fdad8490d6b60e819d3e6997
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Mon Jun 26 12:16:41 2017

BACKPORT: dma-buf/sync_file: add sync_file_get_fence()

Creates a function that given an sync file descriptor returns a
fence containing all fences in the sync_file.

v2: Comments by Daniel Vetter
	- Adapt to new version of fence_collection_init()
	- Hold a reference for the fence we return

v3:
	- Adapt to use fput() directly
	- rename to sync_file_get_fence() as we always return one fence

v4: Adapt to use fence_array

v5: set fence through fence_get()

Use sync_file_get_fence() in Mali kbase and remove now unneeded
copy of sync_file_fdget().

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Christian Knig <christian.koenig@amd.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
(cherry picked from commit 972526a4093243fdaf77dd7c6f8b11fba5b15864)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ibbf9e4fc6ee130e543cae0c26d1cf0834fb5dbb9
Reviewed-on: https://chromium-review.googlesource.com/530511
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/071a49c374162629fdad8490d6b60e819d3e6997/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
[modify] https://crrev.com/071a49c374162629fdad8490d6b60e819d3e6997/drivers/gpu/arm/midgard/mali_kbase_sync.h
[modify] https://crrev.com/071a49c374162629fdad8490d6b60e819d3e6997/drivers/dma-buf/sync_file.c
[modify] https://crrev.com/071a49c374162629fdad8490d6b60e819d3e6997/drivers/gpu/arm/midgard/mali_kbase_sync_user.c
[modify] https://crrev.com/071a49c374162629fdad8490d6b60e819d3e6997/include/linux/sync_file.h

Project Member

Comment 78 by bugdroid1@chromium.org, Jun 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/8c6ce6c455f8ece1723123a70219f98313bbd2c5

commit 8c6ce6c455f8ece1723123a70219f98313bbd2c5
Author: Dominik Behr <dbehr@chromium.org>
Date: Thu Jun 29 19:20:15 2017

REVERTME: dma-buf/sw_sync: fix userspace incrementing timeline by 0x7FFFFFFF

Detect and fix userspace trying to increment timeline by 0x7FFFFFFF and
instead set timeline value to highest fence seqno on timeline.

We should revert this change after user space fixes it's behavior.

BUG= chromium:714307 
TEST=boot kevin and pyro

Change-Id: I5969b09defc7693c2ad82601e2d78c553483b4ab
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/552844
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/8c6ce6c455f8ece1723123a70219f98313bbd2c5/drivers/dma-buf/sw_sync.c

Project Member

Comment 79 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/8148d7b85c7cfb84de8b4c5ffa9a4b736681b9c6

commit 8148d7b85c7cfb84de8b4c5ffa9a4b736681b9c6
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri Jun 30 13:10:01 2017

BACKPORT: dma-buf/sync_file: only enable fence signalling on poll()

Signalling doesn't need to be enabled at sync_file creation, it is only
required if userspace waiting the fence to signal through poll().

Thus we delay fence_add_callback() until poll is called. It only adds the
callback the first time poll() is called. This avoid re-adding the same
callback multiple times.

v2: rebase and update to work with new fence support for sync_file

v3: use atomic operation to set enabled and protect fence_add_callback()

v4: use user bit from fence flags (comment from Chris Wilson)

v5: use ternary if on poll return (comment from Chris Wilson)

In Mali kbase, for async wait, instead of using waitqueue callback
use fence callback. It is simpler, and enable sw signaling when we
need to wait.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
  [sumits: remove unused var status]
Link: http://patchwork.freedesktop.org/patch/msgid/1470404378-27961-1-git-send-email-gustavo@padovan.org
(cherry picked from commit e24165537312723e2900831dd6e7415b8d85278c)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I35ef5f0bb69c3dcab8ea8820a4b73bb74cb91e64
Reviewed-on: https://chromium-review.googlesource.com/534601
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/8148d7b85c7cfb84de8b4c5ffa9a4b736681b9c6/drivers/gpu/arm/midgard/mali_kbase_softjobs.c
[modify] https://crrev.com/8148d7b85c7cfb84de8b4c5ffa9a4b736681b9c6/drivers/gpu/arm/midgard/mali_kbase_defs.h
[modify] https://crrev.com/8148d7b85c7cfb84de8b4c5ffa9a4b736681b9c6/drivers/dma-buf/sync_file.c
[modify] https://crrev.com/8148d7b85c7cfb84de8b4c5ffa9a4b736681b9c6/include/linux/sync_file.h

Project Member

Comment 80 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/258e5032ae17d8609505770222c5cc557cc02b62

commit 258e5032ae17d8609505770222c5cc557cc02b62
Author: Sumit Semwal <sumit.semwal@linaro.org>
Date: Fri Jun 30 13:10:02 2017

UPSTREAM: dma-buf/fence: kerneldoc: remove spurious section header

Commit e941759c74a44d6ac2eed21bb0a38b21fe4559e2 ("fence: dma-buf
cross-device synchronization (v18)") had a spurious kerneldoc section
header that caused Sphinx to complain. Fix it.

Fixes: e941759c74a4 ("fence: dma-buf cross-device synchronization (v18)")

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1470912480-32304-3-git-send-email-sumit.semwal@linaro.org
(cherry picked from commit 3590d50e2313644cd192ff55e83df76dea232319)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I51d5873e462b56ae438309b889e056a0f7ead003
Reviewed-on: https://chromium-review.googlesource.com/534602
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/258e5032ae17d8609505770222c5cc557cc02b62/include/linux/fence.h

Project Member

Comment 81 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/a387b142697f7bff404901b669fe5353e401034c

commit a387b142697f7bff404901b669fe5353e401034c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jun 30 13:10:03 2017

UPSTREAM: dma-buf: Wait on the reservation object when sync'ing before CPU access

Rendering operations to the dma-buf are tracked implicitly via the
reservation_object (dmabuf->resv). This is used to allow poll() to
wait upon outstanding rendering (or just query the current status of
rendering). The dma-buf sync ioctl allows userspace to prepare the
dma-buf for CPU access, which should include waiting upon rendering.
(Some drivers may need to do more work to ensure that the dma-buf mmap
is coherent as well as complete.)

v2: Always wait upon the reservation object implicitly. We choose to do
it after the native handler in case it can do so more efficiently.

BUG= chromium:714307 
TEST=boot kevin and pyro

Testcase: igt/prime_vgem
Testcase: igt/gem_concurrent_blit # *vgem*
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1471275738-31994-1-git-send-email-chris@chris-wilson.co.uk
(cherry picked from commit ae4e46b14bd7a12fb7908425846be7ceb0853bbc)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I0a72851b7c249be503acecf07f52a83539a6d150
Reviewed-on: https://chromium-review.googlesource.com/534603
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/a387b142697f7bff404901b669fe5353e401034c/drivers/dma-buf/dma-buf.c

Project Member

Comment 82 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/9273e46ec4a86f4f7a736d1c08d06b0b359a534e

commit 9273e46ec4a86f4f7a736d1c08d06b0b359a534e
Author: Randy Dunlap <rdunlap@infradead.org>
Date: Fri Jun 30 13:10:04 2017

UPSTREAM: dma-buf: fix kernel-doc warning and typos

Fix dma-buf kernel-doc warning and 2 minor typos in
fence_array_create().

Fixes this warning:
..//drivers/dma-buf/fence-array.c:124: warning: No description found for
parameter 'signal_on_any'

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/224865a5-947d-9a28-c60a-18fa86bc9329@infradead.org
(cherry picked from commit 68acb6afb6f56d8ab92352993425b5472cf79a78)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I832b260fb1137330180eec202e4620cc1088e303
Reviewed-on: https://chromium-review.googlesource.com/534604
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/9273e46ec4a86f4f7a736d1c08d06b0b359a534e/drivers/dma-buf/fence-array.c

Project Member

Comment 83 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/ebf552d6eae7f6e4d7ab1d60010861bf2ac4806d

commit ebf552d6eae7f6e4d7ab1d60010861bf2ac4806d
Author: Rob Clark <robdclark@gmail.com>
Date: Fri Jun 30 13:10:05 2017

UPSTREAM: reservation: fix small comment typo

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Rob Clark <robdclark@gmail.com>
[danvet: Mark up as function for proper cross-linking.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1471640134-30888-1-git-send-email-robdclark@gmail.com
(cherry picked from commit f5bef0b85e5d1586bb2f34035917d5e4c475cea2)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Idbead0fe7a778dd18b1b94b9f53cacd2c127777b
Reviewed-on: https://chromium-review.googlesource.com/534605
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/ebf552d6eae7f6e4d7ab1d60010861bf2ac4806d/drivers/dma-buf/reservation.c

Project Member

Comment 84 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/bc6eecab59e46dac171fba5bf93f958d6109749d

commit bc6eecab59e46dac171fba5bf93f958d6109749d
Author: Emilio López <emilio.lopez@collabora.co.uk>
Date: Fri Jun 30 13:10:07 2017

UPSTREAM: dma-buf/sync_file: fix documentation error

The ioctl name and description on the documentation block don't
match the ioctl being defined. This was probably overlooked while
renaming the ioctls during the sync file destaging. This patch
provides a more accurate description of what the ioctl actually does.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Emilio Lpez <emilio.lopez@collabora.co.uk>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160919042120.6280-1-emilio.lopez@collabora.co.uk
(cherry picked from commit 823d1bc1082970fc02f8172859c789933ed84bc5)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I78ebfc2720a2d7171cac428d8077655e9b628ddf
Reviewed-on: https://chromium-review.googlesource.com/534606
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/bc6eecab59e46dac171fba5bf93f958d6109749d/include/uapi/linux/sync_file.h

Project Member

Comment 85 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/30933f17830899f8118b39fa20b14716635ffbfa

commit 30933f17830899f8118b39fa20b14716635ffbfa
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri Jun 30 13:10:08 2017

UPSTREAM: dma-buf/sync_file: free fences array in num_fences is 1

When merging sync_files there is a case when we can end up with only one
fence in the merged sync_file: when all fences belong to the same
timeline.

So for this case a fence_array is not created instead we just assigned the
fence to sync_file->fence. Then we do not use the fences array anymore nor
does free it.

This patch frees the array.

BUG= chromium:714307 
TEST=boot kevin and pyro

Reported-by:  Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474442419-6040-1-git-send-email-gustavo@padovan.org
(cherry picked from commit c654dd07522e88bacc546c9ccd81b3ee72838ccf)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ie306f5e10959b053ef803100379244d5df67bb5c
Reviewed-on: https://chromium-review.googlesource.com/534607
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/30933f17830899f8118b39fa20b14716635ffbfa/drivers/dma-buf/sync_file.c

Project Member

Comment 86 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/d99a121c95720ee02b5ee94086b3be596a3eb977

commit d99a121c95720ee02b5ee94086b3be596a3eb977
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jun 30 23:02:35 2017

UPSTREAM: dma-buf: Introduce fence_get_rcu_safe()

This variant of fence_get_rcu() takes an RCU protected pointer to a
fence and carefully returns a reference to the fence ensuring that it is
not reallocated as it does. This is required when mixing fences and
SLAB_DESTROY_BY_RCU - although it serves a more pedagogical function atm

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160829070834.22296-6-chris@chris-wilson.co.uk
(cherry picked from commit 4be0542073a33cc063b6a8f8fb367536e234e7aa)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I7d04d272b05136a392c28a11116dd32cde4a81e2
Reviewed-on: https://chromium-review.googlesource.com/534608
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/d99a121c95720ee02b5ee94086b3be596a3eb977/include/linux/fence.h

Project Member

Comment 87 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/23f15e9a224fe9b46a07fce45a11e94ba0e21e49

commit 23f15e9a224fe9b46a07fce45a11e94ba0e21e49
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jun 30 23:02:36 2017

UPSTREAM: dma-buf: Restart reservation_object_get_fences_rcu() after writes

In order to be completely generic, we have to double check the read
seqlock after acquiring a reference to the fence. If the driver is
allocating fences from a SLAB_DESTROY_BY_RCU, or similar freelist, then
within an RCU grace period a fence may be freed and reallocated. The RCU
read side critical section does not prevent this reallocation, instead
we have to inspect the reservation's seqlock to double check if the
fences have been reassigned as we were acquiring our reference.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Christian Knig <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160829070834.22296-7-chris@chris-wilson.co.uk
(cherry picked from commit fedf54132d2410c3949036e3f611ab8dd9dbe89e)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I8489ac99888efc0fa11cf634171b58455c5308a1
Reviewed-on: https://chromium-review.googlesource.com/534609
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/23f15e9a224fe9b46a07fce45a11e94ba0e21e49/drivers/dma-buf/reservation.c

Project Member

Comment 88 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/6171d4187ac01fe717ebcb9f0915285bd0eb0ca0

commit 6171d4187ac01fe717ebcb9f0915285bd0eb0ca0
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jun 30 23:02:37 2017

UPSTREAM: dma-buf: Restart reservation_object_wait_timeout_rcu() after writes

In order to be completely generic, we have to double check the read
seqlock after acquiring a reference to the fence. If the driver is
allocating fences from a SLAB_DESTROY_BY_RCU, or similar freelist, then
within an RCU grace period a fence may be freed and reallocated. The RCU
read side critical section does not prevent this reallocation, instead
we have to inspect the reservation's seqlock to double check if the
fences have been reassigned as we were acquiring our reference.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Christian Knig <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160829070834.22296-8-chris@chris-wilson.co.uk
(cherry picked from commit 1cec20f0ea0e3bc617aed47e0936f17386c131f9)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Ic5697a15da39e11233940012bfc152ad976afccf
Reviewed-on: https://chromium-review.googlesource.com/534610
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/6171d4187ac01fe717ebcb9f0915285bd0eb0ca0/drivers/dma-buf/reservation.c

Project Member

Comment 89 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/667d1aabc242371d2eabaee2827e260fb7b9144c

commit 667d1aabc242371d2eabaee2827e260fb7b9144c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jun 30 23:02:39 2017

UPSTREAM: dma-buf: Restart reservation_object_test_signaled_rcu() after writes

In order to be completely generic, we have to double check the read
seqlock after acquiring a reference to the fence. If the driver is
allocating fences from a SLAB_DESTROY_BY_RCU, or similar freelist, then
within an RCU grace period a fence may be freed and reallocated. The RCU
read side critical section does not prevent this reallocation, instead
we have to inspect the reservation's seqlock to double check if the
fences have been reassigned as we were acquiring our reference.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Christian Knig <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160829070834.22296-9-chris@chris-wilson.co.uk
(cherry picked from commit b68d8379c28ddfe74b78be9414082f281332d86c)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: Iff261f60fd4544580e422c142bad7a76911a648e
Reviewed-on: https://chromium-review.googlesource.com/534611
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/667d1aabc242371d2eabaee2827e260fb7b9144c/drivers/dma-buf/reservation.c

Project Member

Comment 90 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/d78ee5539dce659e47e8a99f2b4c27d3edbb88a5

commit d78ee5539dce659e47e8a99f2b4c27d3edbb88a5
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date: Fri Jun 30 23:02:40 2017

UPSTREAM: dma-buf/sync_file: hold reference to fence when creating sync_file

fence referencing was out of balance. It was not taking any ref to the
fence at creating time, but it was putting a reference when freeing the
sync file.

This patch fixes the balancing issue by getting a reference for the fence
when creating the sync_file.

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1476899313-22241-1-git-send-email-gustavo@padovan.org
(cherry picked from commit 30cd85dd6edc86ea8d8589efb813f1fad41ef233)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I34e71639932d70e900e817c95289b9caced619cb
Reviewed-on: https://chromium-review.googlesource.com/534612
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>

[modify] https://crrev.com/d78ee5539dce659e47e8a99f2b4c27d3edbb88a5/drivers/dma-buf/sync_file.c

Project Member

Comment 91 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/6effbb9d926670b246e7b8d5084aade32b1fdfc3

commit 6effbb9d926670b246e7b8d5084aade32b1fdfc3
Author: Rob Clark <robdclark@gmail.com>
Date: Fri Jun 30 23:02:41 2017

UPSTREAM: dma-buf/fence: add an lockdep_assert_held()

BUG= chromium:714307 
TEST=boot kevin and pyro

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1477339030-32657-1-git-send-email-robdclark@gmail.com
(cherry picked from commit 78010cd9736ec571796f4404524ed575b81238b9)
Signed-off-by: Dominik Behr <dbehr@chromium.org>

Change-Id: I8b779410d9f8517cfab7d541c2f0a8205631c53c
Reviewed-on: https://chromium-review.googlesource.com/534913
Commit-Ready: Dominik Behr <dbehr@chromium.org>
Tested-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/6effbb9d926670b246e7b8d5084aade32b1fdfc3/drivers/dma-buf/fence.c

Status: Fixed (was: Started)

Comment 93 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Comment 94 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)

Sign in to add a comment