20 months agoBluetooth: Properly check L2CAP config option output buffer length l4t/l4t-r24.2.2 tegra-l4t-r24.2.2
Ben Seri [Wed, 13 Sep 2017 08:34:32 +0000]
Bluetooth: Properly check L2CAP config option output buffer length

Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.

Bug 1989825

Change-Id: Id158ece2176c4ac339a7232dfde8c47ce2241122
Cc: stable@vger.kernel.org
Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1558940
(cherry picked from commit bb6128ed7d464d6dd7ffd3b0619827fca7419f02)
Reviewed-on: https://git-master.nvidia.com/r/1564089

22 months agomm: larger stack guard gap, between vmas
Sri Krishna chowdary [Fri, 23 Jun 2017 06:26:03 +0000]
mm: larger stack guard gap, between vmas

commit 1be7107fbe18eed3e319a6c3e83c78254b693acb upstream.

Stack guard page is a useful feature to reduce a risk of stack smashing
into a different mapping. We have been using a single page gap which
is sufficient to prevent having stack adjacent to a different mapping.
But this seems to be insufficient in the light of the stack usage in
userspace. E.g. glibc uses as large as 64kB alloca() in many commonly
used functions. Others use constructs liks gid_t buffer[NGROUPS_MAX]
which is 256kB or stack strings with MAX_ARG_STRLEN.

This will become especially dangerous for suid binaries and the default
no limit for the stack size limit because those applications can be
tricked to consume a large portion of the stack and a single glibc call
could jump over the guard page. These attacks are not theoretical,
unfortunatelly.

Make those attacks less probable by increasing the stack guard gap
to 1MB (on systems with 4k pages; but make it depend on the page size
because systems with larger base pages might cap stack allocations in
the PAGE_SIZE units) which should cover larger alloca() and VLA stack
allocations. It is obviously not a full fix because the problem is
somehow inherent, but it should reduce attack space a lot.

One could argue that the gap size should be configurable from userspace,
but that can be done later when somebody finds that the new 1MB is wrong
for some special case applications.  For now, add a kernel command line
option (stack_guard_gap) to specify the stack gap size (in page units).

Implementation wise, first delete all the old code for stack guard page:
because although we could get away with accounting one extra page in a
stack vma, accounting a larger gap can break userspace - case in point,
a program run with "ulimit -S -v 20000" failed when the 1MB gap was
counted for RLIMIT_AS; similar problems could come with RLIMIT_MLOCK
and strict non-overcommit mode.

Instead of keeping gap inside the stack vma, maintain the stack guard
gap as a gap between vmas: using vm_start_gap() in place of vm_start
(or vm_end_gap() in place of vm_end if VM_GROWSUP) in just those few
places which need to respect the gap - mainly arch_get_unmapped_area(),
and and the vma tree's subtree_gap support for that.

Bug 1946430

Change-Id: I9a66aabc34b687996fb971e01bb0ef30a3d4de7d
Original-patch-by: Oleg Nesterov <oleg@redhat.com>
Original-patch-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Tested-by: Helge Deller <deller@gmx.de> # parisc
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[wt: backport to 4.11: adjust context]
[wt: backport to 4.9: adjust context ; kernel doc was not in admin-guide]
[wt: backport to 4.4: adjust context ; drop ppc hugetlb_radix changes]
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1509433
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>

22 months agovideo: tegra: dsi: Set max limit for reading panel
Pavan Kunapuli [Thu, 16 Mar 2017 14:02:06 +0000]
video: tegra: dsi: Set max limit for reading panel

In the debugfs support for reading panel registers, max payload
needs to be limited to the buff array size to avoid stack corruption.

Bug 1873360

Change-Id: Ibee7bd81027d2669297942c09b905f1dd3bb09ee
Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Signed-off-by: sakets <sakets@nvidia.com>
Reviewed-on: https://git-master/r/1505449
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

23 months agovideo: tegra: nvmap: fix information leak in pin/unpin
Sri Krishna chowdary [Fri, 3 Mar 2017 05:14:08 +0000]
video: tegra: nvmap: fix information leak in pin/unpin

When the NVMAP_IOC_PIN_MULT_32 and NVMAP_IOC_UNPIN_MULT_32 are
called it is possible that the op.addr is not initialized. This
can cause write to some random address thus causing corruption.

This patch fixes Google Bug 31668540

bug 1832092

Change-Id: I4d12d1a6c777131ba1fa2a753ea640861f8e82a6
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1314406
(cherry picked from commit da0c43534bb61e2e0849e297d389517d5e4ed168)
Reviewed-on: http://git-master/r/1504672
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>

23 months agogpu: nvgpu: Remove IOCTL FREE_OBJ_CTX
Terje Bergstrom [Tue, 8 Nov 2016 22:29:14 +0000]
gpu: nvgpu: Remove IOCTL FREE_OBJ_CTX

We have never used the IOCTL FREE_OBJ_CTX. Using it leads to context
being only partially available, and can lead to use-after-free.

Bug 1834225
Bug 1885775

Change-Id: I9d2b632ab79760f8186d02e0f35861b3a6aae649
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1250004
Reviewed-on: http://git-master/r/1258422
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit 9d4ed1b513b675c700cf1aa519663570ca188278 in
rel-24)
Reviewed-on: http://git-master/r/1489613
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>

23 months agovideo: tegra: nvmap: fix nvmap create handle vulnerability
skadamati [Thu, 15 Dec 2016 11:23:22 +0000]
video: tegra: nvmap: fix nvmap create handle vulnerability

Handle the race condition between malicious fd close and
copy_to_user error, which can create use after free condition.
This is fixed by deferring the fd install, which eliminates
the race that leads to use after free condition.
Fixing Google Bug 32160775.

Bug 1835857
Bug 200260161
Bug 1849492
Bug 1825283
CVE-2016-8424 (A-31606947)

Change-Id: I337807e4360661beced8f9e1155c47b66607b8df
Reviewed-on: http://git-master/r/1248391
(cherry picked from commit c26f2a34c189bef2d99740a420b2ab4023d912c0)
Reviewed-on: http://git-master/r/1273324
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1285852
(cherry picked from commit b1513dff2b4bd35d1b400645642bce8dcf3c96c7)
Reviewed-on: http://git-master/r/1504680
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

23 months agovideo: tegra: host: Prevent the race between channel open and close
Gagan Grover [Fri, 4 Nov 2016 11:09:33 +0000]
video: tegra: host: Prevent the race between channel open and close

Moved fd_install() at the end of the channel_open ioctl. So, the fd
can't be used until open ioctl completes.

Bug 1832094

Change-Id: Ib33d43bf5164418a38f98677d4e3295f3d1c1450
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1248180
(cherry picked from commit e6a41d5c0049c2878543006b67b7ee2b2bbda2ab)
Reviewed-on: http://git-master/r/1504683
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

23 months agovideo: tegra: nvmap: Fix NULL pointer dereference
Sri Krishna chowdary [Wed, 14 Dec 2016 06:28:30 +0000]
video: tegra: nvmap: Fix NULL pointer dereference

Consider the following case:
1. NVMAP_IOC_CREATE on IOVMM gives a valid fd to user space
2. user space does not call NVMAP_IOC_ALLOC.
3. user space calls a client driver IOCTL which calls dma_buf_map_attachment
4. call to dma_buf_map_attachment propagates till__nvmap_sg_table
   which has heap_pgalloc as true and tries to access pages[]
   which has all NULL.
5. Similarly, a dma_buf_kmap() can result in __nvmap_kmap() being called
   which again results in NULL dereference if pages[] is accessed.

A valid __nvmap_sg_table should occur only when h->alloc is true.
So, add check for it.

bug 1838597
bug 1883708

Change-Id: I400d9d8a94ff1003db207fc9c252b9256d796f60
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1270827
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit 928dc0a9fdc3f2f507dbc08ed4d54d0292fd4d9e in
rel-24)
Reviewed-on: http://git-master/r/1489493
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>

23 months agohid: i2c-hid: fix write in i2c_set_hid_set_report
Debarshi Dutta [Mon, 15 May 2017 05:16:48 +0000]
hid: i2c-hid: fix write in i2c_set_hid_set_report

Even though hid_hw_* checks that passed in data_len, it is not enough.
If data_len exceeds the BUFSIZE, the function returns.

Bug 1885135

Change-Id: Ie931852abdc1b25ac69ae0bc2c63bbcac82c1ca4
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: http://git-master/r/1481617
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>

23 months agoarm64: tegra: jetson_cv: clear DSR bit in EMC_DYN_SELF_REF_CONTROL
Shreshtha SAHU [Mon, 22 May 2017 08:03:55 +0000]
arm64: tegra: jetson_cv: clear DSR bit in EMC_DYN_SELF_REF_CONTROL

Bug 1915944
Bug 200306741

Change-Id: If8bed3a3fd0c1331c64a35e2a440f1f6c1062dfa
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1486906
Reviewed-by: Martin Chi <mchi@nvidia.com>
Tested-by: Martin Chi <mchi@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

23 months agoarm64: dt: emc: t210: Add nvidia,poll_thresh_freq
Shreshtha SAHU [Mon, 22 May 2017 07:28:34 +0000]
arm64: dt: emc: t210: Add nvidia,poll_thresh_freq

Set "nvidia,poll_thresh_freq" property to 408000.
This fixes the issue of DRAM refresh not getting
triggered hence DRAM refresh rate was not getting
updated with increasing or decreasing temperature.

Bug 200306741

Change-Id: Iaaf988e65aef80c6ff08e2390850c3343de3cc64
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1486905
Reviewed-by: Martin Chi <mchi@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

23 months agotegra210-emc: Get max temperature of two DDR die
Shreshtha SAHU [Mon, 22 May 2017 07:21:35 +0000]
tegra210-emc: Get max temperature of two DDR die

DDR temperature is polled to decide the refresh rate
of DDR during high temperatures. In case of two die
solution, each die can have different temperature.

Hence take max temperature of two DDR die to detemine
DDR refresh speed next action.

Bug 1915944
Bug 200306741

Change-Id: Ica25bad6a9348d15c21f5260b4329762137c7e83
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1486904
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Martin Chi <mchi@nvidia.com>
Tested-by: Martin Chi <mchi@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

23 months agoARM64: tegra21: lower threshold of dram throttle
Shreshtha SAHU [Mon, 22 May 2017 07:15:51 +0000]
ARM64: tegra21: lower threshold of dram throttle

Accroding to the tests, when temperature of Tboard reaches to ~74C,
EMC will swicthes to 2x refresh, so lower the threshold of dram
throttle to make sure it's able to switch to 2x refresh in time.

Bug 1915944
Bug 200306741

Change-Id: If7956f6d6bed86bedeafd25bd6626d7e1cfe0994
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1486903
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Martin Chi <mchi@nvidia.com>
Tested-by: Martin Chi <mchi@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

23 months agovideo: tegra: nvmap: Fix security issue in NVMAP_IOC_PARAM
Gagan Grover [Thu, 24 Nov 2016 11:28:49 +0000]
video: tegra: nvmap: Fix security issue in NVMAP_IOC_PARAM

Initialized the uninitialized variables and handled return status
from nvmap_get_handle_param.

Bug 1820242
Bug 1884311

Change-Id: I2390c859d2b2af39eaff44749ca64e60920fe944
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1259560
(cherry picked from commit cc94ffd0b3b2c2075cb870ead1e6e8994d902a56)
Reviewed-on: http://git-master/r/1489710
GVS: Gerrit_Virtual_Submit
Tested-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agomedia: tegra: nvavp: Fix UAF issue.
Jitendra Kumar [Thu, 27 Oct 2016 08:35:00 +0000]
media: tegra: nvavp: Fix UAF issue.

Use locking to protect generated fd, so that it can't be
freed before channel open completes. Also add null value checks
in release call.

CVE-2016-8449 (A-31798848)
Bug 1830023
Bug 1849492

Change-Id: Ie6e2b29c7132fdfdff6b0bfa75440bd43afffd5f
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1285817
(cherry picked from commit 2ff0fdedfd65f269359d6540df4662e958681aa7)
Reviewed-on: http://git-master/r/1299505
(cherry picked from commit ea1af2ce5a746bda36205357c9e0adaf527026bb)
Reviewed-on: http://git-master/r/1489467
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit

2 years agogpu: nvgpu: serialize debug session IOCTLs
Deepak Nibade [Mon, 23 Jan 2017 11:32:07 +0000]
gpu: nvgpu: serialize debug session IOCTLs

Hold debug_s->ioctl_lock for all debug session IOCTLs to prevent
multi-threaded user space IOCTL calls.
Debug session IOCTL calls are not thread-safe and hence this
serialization is required.

Bug 1832267
Bug 1832095
Bug 1849492
Bug 1883499

Change-Id: I847ac951601d4f0093546b592bdb8c8f00185317
Reviewed-on: http://git-master/r/1286436
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1292432
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit d4629278161f2dc3c74e0f13c6ca08038355dd22 in
rel-24)
Reviewed-on: http://git-master/r/1487009
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>

2 years agovideo: tegra: nvmap: Check if handle holds a buffer before map
Sri Krishna chowdary [Tue, 15 Nov 2016 05:53:30 +0000]
video: tegra: nvmap: Check if handle holds a buffer before map

Consider the following case:
1. NVMAP_IOC_CREATE gives a valid fd to user space
2. user space calls NVMAP_IOC_ALLOC and it fails. So, all
of the handle's allocation fields are zero.
3. Subsequent dma_buf_vmap, mmap on fd leads to __nvmap_mmap
call.
4. handle is valid but h->alloc, h->carveout, h->heap_pgalloc,
h->vaddr all are 0.
5. We check for h->heap_pgalloc which is false, so proceed and
dereference h->carveout leading to NULL pointer exception.

A valid __nvmap_mmap should occur only when h->alloc is true.
So, add check for it.

bug 1837468

Change-Id: I9be9d94f9b74c25b9b588fb1a16a74e96161ceda
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1253236
(cherry picked from commit c5da78cf3d0c19f1e04501a4b3f64a5acacd0ff3)
Reviewed-on: http://git-master/r/1311817
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>

2 years agotegra-cryptodev:check valid SHA message length
Konduri Praveen [Wed, 3 May 2017 05:11:36 +0000]
tegra-cryptodev:check valid SHA message length

SHA message length is provided from user space
through IOCTL call. If this length is not valid,
then it can lead to panic due to buffer overflow.

Fix by checking message length for SHA before
copying from user space.

Bug 1883640

Change-Id: I08e7a6037251822b7e8a3e1b7f00f71dc0495aba
Signed-off-by: Konduri Praveen <kondurip@nvidia.com>
Reviewed-on: http://git-master/r/1474442
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agofbcon: unblank console during mode_switch
Naveen Kumar S [Thu, 29 Sep 2016 12:24:29 +0000]
fbcon: unblank console during mode_switch

VT stays blank if a graphical application (e.g.: X server) powers down
DC before switching to VT. This happens because the powerdown info
is not transmitted to VT, and it assumes itself to be in unblanked state.
To avoid such a scenario, unblank console during a switch from a different
mode.

bug 1826852
bug 200223878
bug 200271418

Change-Id: Iaeb322c1e9197ca33be05b1d4a6a8f3051f5967d
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/1229223
(cherry picked from commit ef2b7d41eee03582b41097ef8e3ec68c99c12638)
Reviewed-on: http://git-master/r/1327327
Tested-by: Nine Feng <nfeng@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

2 years agodriver: media: tegra: fix v4l2 issue for 12bit
esen chen [Fri, 17 Mar 2017 08:52:29 +0000]
driver: media: tegra: fix v4l2 issue for 12bit

Fix v4l2 capture issue for 12bit sensor

Bug 200247041

Change-Id: I68daeaa1a66fa8d3554e1cf4f17ba0818e8b8c49
Signed-off-by: Esen Chen <esenc@nvidia.com>
Reviewed-on: http://git-master/r/1250786
(cherry picked from commit 280b810dbf3a441c6415242f15327de198d974a)
Reviewed-on: http://git-master/r/1322929
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

2 years agovideo: tegra: host: Fix overflow issue allocation
Mikko Perttunen [Fri, 27 Jan 2017 07:32:20 +0000]
video: tegra: host: Fix overflow issue allocation

Change kmalloc to kmalloc_array to prevent overflow issues
caused by large values supplied by user.

Based on "video: tegra: host: Fix overflow issues in allocation"
in nvhost/.

Coverity ID 27942
Bug 1856419

Change-Id: I5e96d0ec184543782dfe8814ad7e856b3b71221c
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: http://git-master/r/1295060
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>

2 years agoDT: Jetson: Remove unused usb-vbus3 DT node
Suresh Mangipudi [Tue, 4 Apr 2017 12:04:39 +0000]
DT: Jetson: Remove unused usb-vbus3 DT node

Removing the usb-vbus3 DT node which is not being used.
USB1 is sourcing vbus from usb-vbus3 DT node, removal of
this node result in regulator get failure.
Hence adding a dummy vbus source for USB1.

Bug 200294630

Based on change 83838c9d37522e903e668edc4cec6870614086f5

Change-Id: Ida623c30dbd22ed2757c5612bbb47e146380bd20
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/1454823
GVS: Gerrit_Virtual_Submit
Reviewed-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years ago[media] uvcvideo: fix null pointer dereference
Henry Lin [Wed, 23 Nov 2016 11:51:34 +0000]
[media] uvcvideo: fix null pointer dereference

stream->urb_num needs to set to 0 while freeing urbs to avoid null
pointer dereference afterwards.

Bug 200237870

Change-Id: Ib26f7b23f34db049790e7a5b31a8bde181b74d99
Signed-off-by: Henry Lin <henryl@nvidia.com>
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/1258903
(cherry picked from commit 5531411014e4b1239a597a1511c736d1bfb31cb0)
Reviewed-on: http://git-master/r/1281107
GVS: Gerrit_Virtual_Submit

2 years ago[media] uvcvideo: improve urb buffer allocation
Henry Lin [Wed, 21 Sep 2016 16:02:03 +0000]
[media] uvcvideo: improve urb buffer allocation

Some UVC device (e.g. StereoLabs ZED camera) may have strict timing
requirement for transferring video payload. This change improves URB
buffer allocation for UVC device with bulk VideoStreaming interface. The
criteria for buffer allocation are:
- Let an URB able to receive a complete UVC payload
- Prepare and submit URBs for a complete video frame

If system memory is large enough, URB buffers will consume memory size
up to a complete video frame.

Bug 1674178

Change-Id: If5f366582ee1c1cb559e890176d74484634dccef
Signed-off-by: Henry Lin <henryl@nvidia.com>
Signed-off0by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/1225266
(cherry picked from commit 4797f84301fe6ff42313c688e72e4f7c0d52b2e6)
Reviewed-on: http://git-master/r/1239557
(cherry picked from commit 3d96f9a8e9f50e08a8306b94378c08dcdfa83abc)
Reviewed-on: http://git-master/r/1281090
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>

2 years agoarm: dts: Remove support for IMX208 sensor
Vincent Chung [Thu, 24 Nov 2016 01:24:43 +0000]
arm: dts: Remove support for IMX208 sensor

Remove support for the IMX208 sensor in all T124 target branches due
to a security vulnerability reported for the Pixel C.

This Gerrit removes the DeviceTree and configuration references.

boot.img size not changed.

Bug 1825317

Change-Id: I04c7a8cad07f31ea5aa4a33389838f2ce2a8f31f
Signed-off-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-on: http://git-master/r/1259194
(cherry picked from commit ca610513f9ff266ca475fdd7689100661a25054f)
Reviewed-on: http://git-master/r/1260885
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>

2 years agodrivers: media: Remove support for IMX208 sensor
Vincent Chung [Tue, 22 Nov 2016 02:33:03 +0000]
drivers: media: Remove support for IMX208 sensor

Remove support for the IMX208 sensor in all T124 target branches due
to a security vulnerability reported for the Pixel C.

This Gerrit removes the IMX208 driver.

Bug 1825317

Change-Id: I5a5b140526c9aabe3f57d60cd750176579f18391
Signed-off-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-on: http://git-master/r/1259195
(cherry picked from commit 7dca6a9ec76c83aabf21a7d1c9ac6f48fc7fa3f4)
Reviewed-on: http://git-master/r/1260883
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>

2 years agoiommu/tegra: pci: fix PCIe switch configurations
Vidya Sagar [Sun, 20 Nov 2016 11:48:21 +0000]
iommu/tegra: pci: fix PCIe switch configurations

fixes of_node lookup even if the PCIe device(s) are not
connected directly to root port, rather connected via a
PCIe switch configuratin.

Bug 200253693

Change-Id: I952c1dcc83a3cc6ecccae195c246b2bb1eec7354
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-on: http://git-master/r/1256856
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>

2 years agoASoC: tegra-alt: fix noisy audio issue
Sameer Pujar [Thu, 5 Jan 2017 05:58:28 +0000]
ASoC: tegra-alt: fix noisy audio issue

Playback of few sample rates is affected due to incorrect pll_a
and pll_a_out0 values. Issues seen with 8kHz, 176.4kHz and some
of the odd frequency (multiples of 11.025kHz) streams.

Current patch provides required rates for pll_a and pll_a_out0.
pll_a rate is fixed at 338.688MHz, which can serve odd sample
rates. To support lower frequency sample rates (8/11.025 kHz),
pll_a_out0 is reduced to half of its value corresponding to
even/odd stream rates.

Bug 1849362

Change-Id: Icc1e7b08b573dc6ca1f4cc84ff931bf9fefe1a98
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1280564
(cherry picked from commit 8cf22e26dcfe7fa390188ca42b52df5c07adc56c)
Reviewed-on: http://git-master/r/1281482
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>

2 years agoarm64: dts: update pll source for sdmmc3
Jerry Chang [Fri, 13 Jan 2017 06:15:03 +0000]
arm64: dts: update pll source for sdmmc3

add pll_c4_out2 clock source for HS200 mode

Bug 1847474

Change-Id: I310846d5679d8bbce2fffe5af9eb0199e91c0f21
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: http://git-master/r/1284689
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jackie Chen <jackchen@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Vick Yu <vyu@nvidia.com>

2 years agopcie: host: tegra: use GFP_DMA32 for MSI mem alloc
Martin Chi [Fri, 24 Feb 2017 02:10:01 +0000]
pcie: host: tegra: use GFP_DMA32 for MSI mem alloc

uses GFP_DMA32 instead of GFP_KERNEL while allocating
memory to be given to PCIe end points to issue write
transactions to generate MSI interrupts.
This fixes issues with PCIe end points that are capable
of generating writes to only 32-bit addresses for generating
MSI interrupts

Bug 200234273

Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-on: http://git-master/r/1227735
(cherry picked from commit 11b39e38141e2b862ed79b9b414e0412e0e0e2f4)
Change-Id: I269cb5c55bcac20fd14deb2311067e8a1f58c49b
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/1306920
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agovideo: tegra: nvmap: fix possible use after free
Gagan Grover [Tue, 22 Nov 2016 09:31:11 +0000]
video: tegra: nvmap: fix possible use after free

Fix possible use after free issue.

Bug 1814555
Bug 1884319

Change-Id: I826aa34f61d43fda5419a528697ce84ba2ce1eae
Reviewed-on: http://git-master/r/1221643
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1257999
(cherry picked from commit b1647da33cff0c498ca8439a722ea1962ecf6901 in rel-24)
Reviewed-on: http://git-master/r/1460521
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>

2 years agodrivers: crypto: Avoid use of tainted scalar value
Konduri Praveen [Wed, 3 May 2017 03:42:41 +0000]
drivers: crypto: Avoid use of tainted scalar value

Copy from user may taint the scalar value members
in the respective struct variables.
Add check for verifying the validity of the
scalar value members to avoid undefined behaviour.

Bug 1903278

Change-Id: I727f28783eee880d03c90c027d3538b7e4b57b6d
Signed-off-by: Konduri Praveen <kondurip@nvidia.com>
Reviewed-on: http://git-master/r/1474467
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agovideo: tegra: host: add lower bound to num_syncpt_incrs
Gagan Grover [Fri, 21 Oct 2016 06:15:00 +0000]
video: tegra: host: add lower bound to num_syncpt_incrs

Check if there is at least one syncpt_incrs in each job.

Bug 1812182

Change-Id: I0bd0b2e7c4d01641c83ba729ec34390ddea81496
Reviewed-on: http://git-master/r/1221226
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1240374
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
(cherry picked from commit 847bb69132adcdb8fc2ce2d7dabeb80d9cc2aa32)
Reviewed-on: http://git-master/r/1460494
GVS: Gerrit_Virtual_Submit
Tested-by: Sandipan Patra <spatra@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

2 years agodccp: fix freeing skb too early for IPV6_RECVPKTINFO
Sandipan Patra [Tue, 21 Mar 2017 10:14:31 +0000]
dccp: fix freeing skb too early for IPV6_RECVPKTINFO

In the current DCCP implementation an skb for a DCCP_PKT_REQUEST packet
is forcibly freed via __kfree_skb in dccp_rcv_state_process if
dccp_v6_conn_request successfully returns.

However, if IPV6_RECVPKTINFO is set on a socket, the address of the skb
is saved to ireq->pktopts and the ref count for skb is incremented in
dccp_v6_conn_request, so skb is still in use. Nevertheless, it gets
freed
in dccp_rcv_state_process.

Fix by calling consume_skb instead of doing goto discard and therefore
calling __kfree_skb.

Similar fixes for TCP:

fb7e2399ec17f1004c0e0ccfd17439f8759ede01 [TCP]: skb is unexpectedly
freed.
0aea76d35c9651d55bbaf746e7914e5f9ae5a25d tcp: SYN packets are now
simply consumed

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Bug 200285540

Change-Id: I3bec712b03278102c88933d4684324c3f414b606
Signed-off-by: Sandipan Patra <spatra@nvidia.com>
Reviewed-on: http://git-master/r/1325178
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agogpu: nvgpu: acquire mutex for notifier read
Deepak Nibade [Mon, 27 Feb 2017 10:53:21 +0000]
gpu: nvgpu: acquire mutex for notifier read

We use &ch->error_notifier_mutex to protect writes and free of error
notifier. But we currently do not protect reading of notifier in
gk20a_fifo_set_ctx_mmu_error() and vgpu_fifo_set_ctx_mmu_error().
Add new API gk20a_set_error_notifier_locked() which is same as
gk20a_set_error_notifier() but without the locks.
In *_fifo_set_ctx_mmu_error() APIs, acquire the mutex explicitly,
and then use this new API gk20a_set_error_notifier() will now just
call gk20a_set_error_notifier_locked() within a mutex

Bug 1824788
Bug 1844312
Bug 200270206

Change-Id: I1f3831dc63fe1daa761b2e17e4de3c155f505d6f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1273471
(cherry picked from commit 505b442551a2e27aa3bc9e608c5a2bc9fccecbc4)
Reviewed-on: http://git-master/r/1311857
Reviewed-on: http://git-master/r/1324991
GVS: Gerrit_Virtual_Submit
Tested-by: Sandipan Patra <spatra@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agovideo: tegra: nvmap: Fix print format specifier
Gagan Grover [Tue, 29 Nov 2016 13:02:40 +0000]
video: tegra: nvmap: Fix print format specifier

The format specifier %p can leak kernel addresses.
The fix is designed to use %pK instead of %p, which also evaluates
whether kptr_restrict is set.

CVE-2016-8409 A-31495687

Bug 1844902
Bug 200286375

Change-Id: I57a1fca9c58c0ac433415e39c82ab72d7429e48e
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1261530
(cherry picked from commit aa8d5a3cda7ecce610c39baee371a3ca8a6533a5)
Reviewed-on: http://git-master/r/1315831
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shivdas Patil <shivdasp@nvidia.com>
Tested-by: Christian Gonzalez <christiang@nvidia.com>
Reviewed-by: Kaustubh Purandare <kpurandare@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

2 years agovideo: tegra: nvmap: fix time-of-check,time-of-use vulnerability
Sri Krishna chowdary [Sat, 25 Feb 2017 19:02:47 +0000]
video: tegra: nvmap: fix time-of-check,time-of-use vulnerability

Validate the region specified by offset and size before performing
the operations like nvmap_prot_handle, nvmap_cache_maint and nvmap_handle_mk*.
This validation of offset and size once the values are in local variables
guarantees that even though user space changes the values in user buffers,
nvmap continues to perform operations with the contents that are validated.
Fixes Google Bug 34113000.

Bug 1862379
Bug 1880033

Change-Id: I32786d26c269a95122fbaf0b91d6d090cba7388e
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/1298712
(cherry picked from commit f45441da608d8015ece73d253d4bdb48863f99e2)
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1311449
(cherry picked from commit 18b957d355340c436c7e58a95b2907402684b242)
Reviewed-on: http://git-master/r/1319904
GVS: Gerrit_Virtual_Submit

2 years agoFix L4T Bluetooth l2cap PTS test failures
Mahesh Patil [Fri, 24 Feb 2017 20:49:31 +0000]
Fix L4T Bluetooth l2cap PTS test failures

Include proper FCS length in Bluetooth l2cap ertm packet
retransmission and added l2cap extended feature UCD
(unicast connectionless data reception) support flag.

Bug 1882139

Change-Id: I02facaff214f3d9bf963f0843aa1de1c5dedcfd6
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: http://git-master/r/1311185
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rohit Vaswani <rvaswani@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>

2 years agomedia: tegra: camera: Fix stack overread
Amey Asgaonkar [Mon, 16 May 2016 23:33:15 +0000]
media: tegra: camera: Fix stack overread

We are not checking a variable which is user
controlled. This can lead to reading of the
stack data. Adding a check to ensure it is
less than the max possible value of the variable.

Bug 1763649

Change-Id: I395e882d030199bdd7684837906a9b5d60741650
Signed-off-by: Amey Asgaonkar <aasgaonkar@nvidia.com>
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/1150943
(cherry picked from commit 14359cb871606ffefa4ca2070b7e9ccb08dcd378)
Reviewed-on: http://git-master/r/1260833
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Christian Gonzalez <christiang@nvidia.com>
Tested-by: Christian Gonzalez <christiang@nvidia.com>

2 years agoarm64: config: enable Trusty for L4T
Stephen Warren [Wed, 9 Nov 2016 16:22:34 +0000]
arm64: config: enable Trusty for L4T

L4T systems will include the Trusty secure OS in the near future. Enable
the drivers required to communicate with Trusty in L4T's defconfig.

Bug 1818826

Change-Id: I7f0d139ea5a72e267f249510cd090e2aa94ae785
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255194
(cherry picked from commit 226a18e5a581107c1c0e25642eedf924d53f5ce7 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257374
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agoARM64: t210: dts: use virtual timer for secure timer
Sharif Inamdar [Fri, 23 Oct 2015 11:44:03 +0000]
ARM64: t210: dts: use virtual timer for secure timer

Initially with Trusty, we were facing a crash since kernel
registers for both secure and non-secure timer and trusty registers
for secure timer. Since both registers for the same interrupt we
see a crash.

The suggested fix was to make the arch timer driver register for
non-secure and virtual timer by changing the secure interrupt value
to virtual interrupt such that the kernel registers for non-secure
and virtual timer where as trusty then registers for secure timer.

With this we get rid of the crash since both trusty and arch timer
driver registers for different interrupt value.
arch timer driver will now register for non-secure and virtual timer.
Trusty will use the secure timer for its operation.

Bug 200148571
Bug 1818826

Change-Id: I5405c105e3694128afe93fb73371d4fae43300f1
Signed-off-by: Sharif Inamdar <isharif@nvidia.com>
Reviewed-on: http://git-master/r/822025
(cherry picked from commit 402e96ae9dbda633ccf9f44e2e1884454f8b2443 in dev-kernel-3.18)
(swarren manually applied the k3.18 patch to k3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255192
(cherry picked from commit 1d26af2ce2315553274bfd819fead1e17ef9eb51 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257373
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Don't register IPI
Wayne Lin [Wed, 23 Mar 2016 17:46:06 +0000]
trusty: Don't register IPI

System will randomly crash in trusty after enabling IPI.
If the previous CPU is A57, and IPI send to Denver.
There will be some memory coherence issue in trusty.

Bug 200184071
Bug 1818826

Change-Id: I9422cc75ce70acfdd44f5662c492ed0d64d3f212
Signed-off-by: Wayne Lin <wlin@nvidia.com>
Reviewed-on: http://git-master/r/1114575
(cherry picked from commit cc6387320acb8b2cd7c6345e62de32ac9a27b53e)
Reviewed-on: http://git-master/r/1115131
(cherry picked from commit 13b2e5944b9d5cb80782342fead3a022d3e63618 in dev-kernel-3.18)
(swarren manually applied the k3.18 patch to k3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255191
(cherry picked from commit 5cef87e303dcc5f2af2821d874357fb62c3ab725 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257372
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty-ipc: Add support for default Trusty IPC device
Michael Ryleev [Thu, 30 Jul 2015 19:50:08 +0000]
trusty-ipc: Add support for default Trusty IPC device

If particular Trusty IPC device to operate on is not
important caller can pass NULL for dev parameter to
tipc_create_channel routine to access default Trusty IPC
device.

Bug 1818826

Change-Id: Ib35f44f87ee9d71f827263c6a667a5852d4286e6
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit 78dd8a2878e3e7cf8d5fa998eea47a54bcb848b3 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255190
(cherry picked from commit 4a2adf1b31dbb404b9276ed3772fa749fc7ead3b in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257371
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty-virtio: add support for 64-bit phys addresses for vrings
Michael Ryleev [Thu, 22 Oct 2015 01:15:30 +0000]
trusty-virtio: add support for 64-bit phys addresses for vrings

Work around limitation of vring descriptor structure that only
supports 32 bits addresses. On archs with 64 bit physical addresses
store top 32 bits of such address in currently unused reserved field.

Bug 1818826

Change-Id: I30333f6b8966db89bd4b8a699a72b80c6257a31f
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit 5905c66d15412a6e0d82e3675fb5f01431040785 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255189
(cherry picked from commit df360bc31f3b875af6a3f72bc7175228a9f06a0b in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257370
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty-ipc: Fix a corner case in dn_handle_message
Michael Ryleev [Tue, 13 Oct 2015 02:51:04 +0000]
trusty-ipc: Fix a corner case in dn_handle_message

Return an original RX buffer to actually implement intended behavior
in corner case when tipc_chan_get_rx_buffer fails. This is only
currently possible when 0 order memory allocation fails.

Bug 1818826

Change-Id: I8599f7cfcecd2dda0e1d01c5477c9ac519bf6dcf
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit a32bbb810f65b8d036148a34ce1b05fd9188d2b4 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255188
(cherry picked from commit 5c6842c0723256446aabee37e8f48cd25e028c4f in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257369
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty-ipc: Fix a corner case in _handle_disc_request
Michael Ryleev [Tue, 13 Oct 2015 01:55:29 +0000]
trusty-ipc: Fix a corner case in _handle_disc_request

It is possible to receive a valid disconnect request when channel
still is in connecting state.

Bug 1818826

Change-Id: Iad1ef831a0ca5fc793f6d1df0be5b48933b633db
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit fe31b177f1f36f74febbb666af1319af8d1ee497 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255187
(cherry picked from commit c6ddbc8bf143376e0fe2de679cfec656b8727adb in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257368
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty-ipc: Add aio based readv and writev support
Michael Ryleev [Fri, 18 Dec 2015 22:46:40 +0000]
trusty-ipc: Add aio based readv and writev support

This implementation is aio based and suitable for older
kernels.

Bug 1818826

Change-Id: I0f21f727898d3bed9e7bb71df26371edb06061c0
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit 834aa62117ed2eae7b60874f2ed7cd7670f5bf1f from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255186
(cherry picked from commit 254130096e987d01134c025c34572d95a3ccab95 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257367
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Add smp support
Arve Hjønnevåg [Sat, 24 Jan 2015 01:55:48 +0000]
trusty: Add smp support

Add an unlocked nop call to allow multiple cpus to enter trusty.
Other standard calls are still serialized to avoid return codes
getting mixed up.
A new return code is used to indicate that the standard call is
running on another cpu.

Bug 1818826

Change-Id: Iccc0785138fbc3eb9daebf22fd79d6c1f9b23f6a
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 51132bfbacfcc63b4414fcb3b0bc62e737da93e3 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255185
(cherry picked from commit 4d23c49eef7df76107393312feb6569656de50c8 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257366
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agoarm: smp: Add support for custom ipi interrupt handlers
Arve Hjønnevåg [Tue, 3 Mar 2015 23:24:40 +0000]
arm: smp: Add support for custom ipi interrupt handlers

This allows forwarding IPIs to the trustzone OS.

Bug 1818826

Change-Id: I368ae24e8679afa089bfe14d44bf7a59b72b5c95
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(swarren, Arve's s-o-b received by email)
(cherry picked from commit 63df83ff361160be6cba09ef84696342a03e65d9 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255184
(cherry picked from commit d442eac05903422d631b11720b4fccc7bd208a12 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257365
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agoarm64: smp: Add support for custom ipi interrupt handlers
Arve Hjønnevåg [Sat, 24 Jan 2015 01:53:12 +0000]
arm64: smp: Add support for custom ipi interrupt handlers

This allows forwarding IPIs to the trustzone OS.

Bug 1818826

Change-Id: I157ce3a554a8a422755ac479815366fc893f6fea
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit a000af3a0fc5ad20769b1060eab1633de907ce8e from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255183
(cherry picked from commit 6e66ce11edd14102bc3b57d30a2b3f0abf479915 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257364
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Handle fiqs without calling notifier and enabling interrupts
Arve Hjønnevåg [Fri, 12 Jun 2015 02:51:54 +0000]
trusty: Handle fiqs without calling notifier and enabling interrupts

Bug 1818826

Change-Id: I3e396497283237b83a43127098dde0bf6e781c1f
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(swarren, Arve's s-o-b received by email)
(cherry picked from commit 63f6b6cdcad0c6f23de0b694310cb1659b577e8e)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255182
(cherry picked from commit b8edc8e1a219e5eedb9457d1de452f7f37a62fcf in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257363
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Select api version
Arve Hjønnevåg [Fri, 12 Jun 2015 02:34:28 +0000]
trusty: Select api version

Select api version in probe, and store it in trusty_state.
This enables new return codes from trusty, and will later be used
to enable a nop stdcall that does not take smc_lock.

Bug 1818826

Change-Id: Ia72d4264537ce7ddba12b867c3221dd92db22056
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(swarren, Arve's s-o-b received by email)
(cherry picked from commit 7f12378c142220404248c32eac0a8ca68de9c37a from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255181
(cherry picked from commit 4e9d3d16313c081a349cf1c8ed98b2472ebad7be in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257362
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Warn if trusty crashed
Arve Hjønnevåg [Fri, 12 Jun 2015 02:50:59 +0000]
trusty: Warn if trusty crashed

Bug 1818826

Change-Id: Id595f7658866472560c5f80a70a5235571e74f28
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(swarren, Arve's s-o-b received by email)
(cherry picked from commit 5817f951f010969288e5ebfe6693d8b0ba4d2aa9 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255180
(cherry picked from commit 43831a4d098f665c5fb9a915c1ad7ce925f73dc0 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257361
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Update smcall.h
Arve Hjønnevåg [Fri, 12 Jun 2015 03:01:36 +0000]
trusty: Update smcall.h

Bug 1818826

Change-Id: Ie9fd30e6a94b7f0ebe4ebd9db5856a960690d2fb
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(swarren, Arve's s-o-b received by email)
(cherry picked from commit af08ddcd66f821b3b40587817aa9a45551bfc202)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255179
(cherry picked from commit 2678b816351a491f52e0ae4ab87f550e3f8bb76d in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257360
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty-virtio: fix return values of trusty_load_device_descr
Michael Ryleev [Sat, 25 Apr 2015 01:38:53 +0000]
trusty-virtio: fix return values of trusty_load_device_descr

Return -ENODEV if load device descriptor operation failed
and log original error code.

Bug 1818826

Change-Id: Id170233a51994a514ec15598d4fcade6ec0a2f7a
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit a57353dd48e63450bdf74053a57e12588881262e from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255178
(cherry picked from commit db935c834884eddac31714841e5aa70c7b914e2e in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257359
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty-virtio: fix notifier registration order
Michael Ryleev [Sat, 25 Apr 2015 00:17:06 +0000]
trusty-virtio: fix notifier registration order

Trusty smc call_notifier has to be registered before
calling trusty_virtio_start.

Bug 1818826

Change-Id: I2d28a5f11d9dd11c2696b3d49f6944377e1da32f
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit cdb70d17a0e13208d8f665d28f7095158a88768a from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255177
(cherry picked from commit bd877adbad2a38e346be3aecb4e8bf43783e3a86 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257358
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: add trusty-ipc driver
Michael Ryleev [Wed, 7 Jan 2015 23:47:37 +0000]
trusty: add trusty-ipc driver

Trusty IPC driver provides message passing interface
between non-secure side (Linux) and secure side running
Trusty. It is handling a set of trusty IPC virtio devices
instantiated and configured by trusty-virtio driver based
on device description retrieved from secure side.

Bug 1818826

Change-Id: I81288aa458675996cbc93e73baf3c41d735d5429
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit 03545bd62370cb28db26613260ef36ac072e5fde from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255176
(cherry picked from commit b478e2867042c7e091a24a81a8b8c4b258e4f182 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257357
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: add trusty virtio driver
Michael Ryleev [Mon, 30 Mar 2015 19:43:59 +0000]
trusty: add trusty virtio driver

Trusty virtio driver is responsible for management an
interaction with virtio devices exposed by Trusty.
During initialization, this driver makes an smc
call to retrieve Trusty virtio device descriptor from
secure side, parses it then instantiates and configures
the specified set of virtio devices.

Bug 1818826

Change-Id: I20a23518d5c19bedd9282f7f1d4b16957ba75408
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit 49cd705cb598e32909ac7704bba79fabfd64feee from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255175
(cherry picked from commit cb980262ebfeeac3321b30c90e72fe45e48f1a69 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257356
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: add couple non-secure memory related helper routines
Michael Ryleev [Fri, 27 Mar 2015 02:31:25 +0000]
trusty: add couple non-secure memory related helper routines

trusty_encode_page_info - encodes page physical address, memory
type and other attributes into architecture specific structure
that can be parsed by secure side.

trusty_call32_mem_buf - can be used by drivers to make
specified smc call with physicaly contigues memory buffer as
an argument. Memory buffer info in retrieved by trusty_encode_page_info
and along with buffer size is encoded into series of 32-bit
smc call parameters.

Bug 1818826

Change-Id: Iae155c0eff0bb6269be1abbe53ee42f27a1c23f5
Signed-off-by: Michael Ryleev <gmar@google.com>
(cherry picked from commit 489d59d67530633b5d7712d9b3bccad2a1f180f1 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255174
(cherry picked from commit f1f39acb18e4174afc4773e97eb3158c47f3131d in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257355
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Get version string from trusty
Arve Hjønnevåg [Fri, 10 Oct 2014 04:24:17 +0000]
trusty: Get version string from trusty

Print trusty version to kernel log on startup, and export it in sysfs.

Bug 1818826

Change-Id: Ibb503a9385a223b590b882578fdd6332fc750a8d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit af1ac76fcfaa06395a13afd27edfc4f29dd52e7d from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255172
(cherry picked from commit c6243e7378298cf471a0e3345427e67426b02803 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257354
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Retry std_calls on SM_ERR_BUSY
Arve Hjønnevåg [Sun, 5 Oct 2014 00:36:20 +0000]
trusty: Retry std_calls on SM_ERR_BUSY

If the trusty spinlock is held, or if the strex fails for another
reason, trusty returns SM_ERR_BUSY. Add retry code to handle this.

Without this retry code, std_calls can fail. If the previous smc
call had returned SM_ERR_INTERRUPTED, this failure would cause
the driver to get out of sync with trusty. All later calls would
then fail with SM_ERR_INTERLEAVED_SMC.

Bug 1818826

Change-Id: I9f72bb7ce9af9e1ef0a38aeff62fb83ea51377cf
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit e909ef01e6ea5084d05c2ce89a83f63247970e40 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255171
(cherry picked from commit f68a02600e571c57f9dbb4b3e51a544c79a83c9f in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257353
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: move probe to subsys_initcall
Colin Cross [Tue, 13 May 2014 21:49:28 +0000]
trusty: move probe to subsys_initcall

Child devices of trusty like FIQ-based debuggers and watchdogs may
want to probe early, move trusty from module init to subsys init
to allow it and its children to probe earlier.

Bug 1818826

Change-Id: I10d7028d5c7dbeb4dc5e951029c059783b1953d3
Signed-off-by: Colin Cross <ccross@android.com>
(cherry picked from commit bd9b849d25e63069104360573f5cc5a7614de839 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255170
(cherry picked from commit 079a2d9b62fb0149c766e1cbd42a65a72ac76ebe in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257352
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: fiq-arm64: Allow multiple fiq handlers.
Arve Hjønnevåg [Sat, 3 May 2014 02:15:44 +0000]
trusty: fiq-arm64: Allow multiple fiq handlers.

If multiple fiq handlers are reqistered call them all. There is
currently no api to remove handlers.

Bug 1818826

Change-Id: I7e16a73f40251ccf6ad8d33fd32350f774651135
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 5a333166fdf1ffd094e0116c9b3ba059653fd346 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255169
(cherry picked from commit fbd89b9edfad885089ec8e0bc97b5f0c8144883d in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257351
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: arm64 fiq support
Arve Hjønnevåg [Tue, 15 Apr 2014 00:18:40 +0000]
trusty: arm64 fiq support

Bug 1818826

Change-Id: Icd7c410ea805d4f7b5318b922f269cff8a56d53e
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(swarren, Arve's s-o-b received by email)
(cherry picked from commit 86eb811e8180ed90dd1ef0c2bae4baf9794c46b4 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255168
(cherry picked from commit 58c35558ae4b8f85d1afc68385b24f56d15a0764 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257350
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Add trusty_fast_call64 api on 64 bit systems.
Arve Hjønnevåg [Tue, 15 Apr 2014 00:16:06 +0000]
trusty: Add trusty_fast_call64 api on 64 bit systems.

Bug 1818826

Change-Id: Ibb74be14fd3ddcb792862f7e1bd9c588007924d5
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 6b1a2d31a5682fd626b1c41895ddf7ab6bb8c643 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255789
(cherry picked from commit d66af47b07b50d442ab85ae700a2de5a3fc151a1 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257349
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agoarm64: Add fiq_glue stub
Arve Hjønnevåg [Thu, 24 Apr 2014 00:18:28 +0000]
arm64: Add fiq_glue stub

Adds header file and config option that can be selected when an
implementation of the api is available.

Bug 1818826

Change-Id: I9c70840eb9c7c8ac67095d146079fc8e6145fb3b
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 21cd2a8faa6f050346605316dbcc9068d506371b from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255788
(cherry picked from commit e58c873a3fe686a8c240cd85c72b141d854360d5 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257348
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Move 32 bit arm fiq code to trusty-fiq-arm.
Arve Hjønnevåg [Tue, 15 Apr 2014 00:12:26 +0000]
trusty: Move 32 bit arm fiq code to trusty-fiq-arm.

Bug 1818826

Change-Id: I58933fc70d165316bd5b91d2b7a6dabe404d736c
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 3d57f5df52ea7a76216a68bc5aa3bc8550709d78 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255787
(cherry picked from commit 0adad7d680aa223931ef91388f0fd87ed759f0c4 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257347
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Fix compile warning on arm
Arve Hjønnevåg [Thu, 24 Apr 2014 00:35:30 +0000]
trusty: Fix compile warning on arm

Bug 1818826

Change-Id: Idd832e59331e28f0bf07913df39af22706a9ffa1
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 39d85f0cd797179eb6095d3b9f20e30a1a812d13 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/773193
(cherry picked from commit ec5f16da709778a0003106eeff7adb297dafcb77 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1257346
GVS: Gerrit_Virtual_Submit
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

2 years agotrusty: Add arm64 support
Arve Hjønnevåg [Tue, 11 Mar 2014 03:29:06 +0000]
trusty: Add arm64 support

Bug 1818826

Change-Id: I5ddca64d2ecd7f2dc572f434ccf641f436c63aad
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 0da972cc7510010d76347ebfbaa1cc164e481b9e from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255786
(cherry picked from commit 0a163633fc61a1cedc7cabfb4a6fd6f1b1c63844 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1256411
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

2 years agotrusty: Provide trusty_std_call32 and trusty_fast_call32 stubs if CONFIG_TRUSTY is...
Arve Hjønnevåg [Tue, 17 Dec 2013 03:26:36 +0000]
trusty: Provide trusty_std_call32 and trusty_fast_call32 stubs if CONFIG_TRUSTY is not set.

Bug 1818826

Change-Id: I52119a6d09a7b380863f4ae5e4c5a95fa58be3bb
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 2e55f95a657ba34c081afec5d00840fea56b5515 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255785
(cherry picked from commit 3ccce903d15d5ba0fbfe7bab6c0604309071c3b8 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1256410
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

2 years agotrusty: Add fiq support
Arve Hjønnevåg [Wed, 27 Nov 2013 04:18:35 +0000]
trusty: Add fiq support

Register a custom fiq-return handler with the fiq-glue so the
monitor mode can atomically re-enable the fiq and return to the
last mode.

Bug 1818826

Change-Id: I7f2720f6c66f171995ab1927602e781f7dbea52d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit dc7e98fc2692f34a680091a6f1d4b8a43d071717 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255784
(cherry picked from commit a733a721465a371dde4ae8bb7b33be1186b20a2f in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1256409
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

2 years agotrusty: Add interrupt support
Arve Hjønnevåg [Tue, 19 Nov 2013 04:52:55 +0000]
trusty: Add interrupt support

Get list of interrupts from secure mode and register handlers for them.
When an interrupt triggers, disable the interrupt and schedule a work
function. The work functions then masks interrupts at the cpu, reenables
the interrupt and calls into secure mode.

Edge triggered interrupts are not supported.

Bug 1818826

Change-Id: I731d425e8c946552add6e01cd64dab76337af470
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 8abdce02cff69bac1df994a775d787a8732ddf6b from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255783
(cherry picked from commit d8c99bf3c0ae78968a9fdf4e580d8ee8b08ecde9 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1256408
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

2 years agotrusty: Add notifier before and after every smc call.
Arve Hjønnevåg [Thu, 21 Nov 2013 05:31:34 +0000]
trusty: Add notifier before and after every smc call.

Called with local interrupts disabled.

Bug 1818826

Change-Id: I6feb9cee349f78f8d228294f238b0b420a6d4beb
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit e30482e7bc33cd2074e0f3163212e4df7dcdffb7 from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255782
(cherry picked from commit 2e9a9c7d9060c9cf16b32457300e6571c9b12bcf in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1256407
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

2 years agotrusty: Add trusty driver
Arve Hjønnevåg [Tue, 19 Nov 2013 04:46:48 +0000]
trusty: Add trusty driver

Bug 1818826

Change-Id: I35318be3d41f84b922397e9afdca6bf47d9645db
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 33dbf3395558ad97cf65770235d8dfe90b33345f from https://android.googlesource.com/kernel/common/+/android-trusty-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255781
(cherry picked from commit 45bf2e74d512c0c6260094274be99f5635c3b57e in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1256406
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

2 years agoARM: tegra210: add Trusty DT
Stephen Warren [Wed, 9 Nov 2016 20:55:30 +0000]
ARM: tegra210: add Trusty DT

Some T210 systems will use Trusty. Add a DT fragment that describes the
existence of Trusty, and include it in the common T210 DT file. The node
will be enabled at run-time by the bootloader whenever Trusty is present
in the secure OS image.

The DT content was copied from device/hardware/nvidia/soc/t210.git as of
commit f2d24ed9df5b "arm64: tegra210: ERS: add apbmisc node to the dts".

Bug 1818826

Change-Id: Ibcfc45802f418c0f73e09406f031085254306eb6
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1255193
(cherry picked from commit 18719bb05148683b5760bc624f209a59e6be81b4 in dev-kernel-3.10)
Reviewed-on: http://git-master/r/1255861
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

2 years agoplatform: tegra: cluster-control: extended state ID format for power states
Varun Wadekar [Thu, 8 Sep 2016 19:00:30 +0000]
platform: tegra: cluster-control: extended state ID format for power states

This patch uses the extended state ID format for communicating power
states to the monitor software. This allows us to move to ARM Trusted
Firmware as the monitor stack.

Bug 1809446
Bug 1818826

Change-Id: Id30c3884c34e42473b309977598b3ff3a8c80bdb
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/1217307
(cherry picked from commit 7eafb7db75853960ed8b6bfb6aebd9da500d2c96 in dev-kernel-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1247563
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agocpuidle: tegra210: extended state ID format for power states
Varun Wadekar [Thu, 8 Sep 2016 18:59:37 +0000]
cpuidle: tegra210: extended state ID format for power states

This patch uses the extended state ID format for communicating power
states to the monitor software. This allows us to move to ARM Trusted
Firmware as the monitor stack.

Bug 1809446
Bug 1818826

Change-Id: I0c85452fcf2d6aba6fc640b29671b646ba35a186
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/1217306
(cherry picked from commit d5245356e1e27d197c4b9e6ed8fdf18ee1556910 in dev-kernel-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1247562
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agoarm64: tegra: pm: extended state ID format for power states
Varun Wadekar [Thu, 8 Sep 2016 18:12:18 +0000]
arm64: tegra: pm: extended state ID format for power states

This patch uses the extended state ID format for communicating power
states to the monitor software. This allows us to move to ARM Trusted
Firmware as the monitor stack.

Bug 1809446
Bug 1818826

Change-Id: Ie6d39db149187c77a60f6f2677b6b4b1f69681af
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/1217305
(cherry picked from commit 30643151a5fbf9f05cdd27ba9ad211e2d93196b1 in dev-kernel-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1247561
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agoarm64: psci: enable support for extended PSCI state ID
Varun Wadekar [Thu, 8 Sep 2016 17:41:44 +0000]
arm64: psci: enable support for extended PSCI state ID

This patch removes support for 'struct psci_power_state' and directly
accepts the PSCI power state as a 32-bit value. This allows us to start
using extended state IDs, which in turn allows us to interact with ARM
Trusted Firmware as the monitor stack

Bug 1809446
Bug 1818826

Change-Id: I88ce349dacc014e2b7ea39ba0139fdc8f001b8f2
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/1217304
(cherry picked from commit aef84526f17478d99715573e3684e478edb79dfc in dev-kernel-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1247560
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agoRevert "arm64: export functions for cpuidle drivers"
Varun Wadekar [Thu, 25 Aug 2016 20:29:47 +0000]
Revert "arm64: export functions for cpuidle drivers"

This reverts commit bba3d59da77d35ee3f964bf31ebf8cb3c843aec2.

Bug 1809446
Bug 1818826

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: I1156cc8a94d4199e8c65b5b540827ce8c41788d4
Reviewed-on: http://git-master/r/1217303
(cherry picked from commit c5c1b4f0efa27580f030529c4c9e82f129b715ec in dev-kernel-3.10)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1247559
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agoarm64: tegra210: PSCI v1.0 compatible function IDs
Varun Wadekar [Wed, 2 Nov 2016 22:26:08 +0000]
arm64: tegra210: PSCI v1.0 compatible function IDs

Convert all the power state function IDs to follow PSCI v1.0 format. Bit
30 states if the state is a power down state. Previous higher bits from
PSCI v0.2 have been removed in the new spec.

Bug 1809446
Bug 1818826

Change-Id: Iee11f397b5b22f33835348b15c88e09dc8d51823
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/1227100
(cherry-picked from commit 46e03f3129ced25ecd7d79f52778cc8e2c1b82e2 in
repo device/hardware/nvidia/soc/t210 branch dev-kernel)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1247558
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agocpuidle: tegra210: idle state parameters from the device tree
Varun Wadekar [Wed, 2 Nov 2016 22:07:33 +0000]
cpuidle: tegra210: idle state parameters from the device tree

NOTE: In l4t/l4t-r24.2, this patch contains just the DT portions of the
original kernel 3.18 patch from dev-kernel, which is described below. The
original patch both added DT content and adapted the code to immediately
use it. In r24.2, the code changes don't directly apply, and instead
future patches will adapt the code. However, we still need all the
definitions in DT, hence portions of this patch are cherry-picked.

==========

The CPU idle framework and the suspend/resume framework depend on the
CPU idle states and their parameters being defined from device trees.
A new node, 'idle-states', defines all the states supported by the CPUs.

Example
-------

cpu@<0,1,2,3> {
cpu-idle-states = <&C3>;
};

idle-states {
C3: c3 {
compatible = "nvidia,idle-state";
arm,psci-suspend-param = <0x3>;
wakeup-latency-us = <10>;
min-residency-us = <1>;
idle-state-name = "c3-HW-controlled-Vmin";
status = "okay";
};
};

In order to parse these new entries we enable CONFIG_DT_IDLE_STATES,
which in turn enables the dt_idle_state.c file. All the CPU idle states
are then stored in a per-cpu array and the indexes from the array are
then used as input parameter to the CPU idle entry function. The driver
is then supposed to handle the entry into the corresponding idle state.

Bug 200094906
Bug 1818826

Change-Id: If547488c5194a071312d6a85e85fb4d31bbfde7f
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/761599
(cherry-picked from commit ead3e59edc10e19a08900e92949ac1436fdc94e3 in
repo kernel-3.18 branch dev-kernel-3.18)
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1247557
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agomm: remove gup_flags FOLL_WRITE games from __get_user_pages() tegra-l4t-r24.2.1
Linus Torvalds [Thu, 13 Oct 2016 20:07:36 +0000]
mm: remove gup_flags FOLL_WRITE games from __get_user_pages()

commit 19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619 upstream.

This is an ancient bug that was actually attempted to be fixed once
(badly) by me eleven years ago in commit 4ceb5db9757a ("Fix
get_user_pages() race for write access") but that was then undone due to
problems on s390 by commit f33ea7f404e5 ("fix get_user_pages bug").

In the meantime, the s390 situation has long been fixed, and we can now
fix it by checking the pte_dirty() bit properly (and do it better).  The
s390 dirty bit was implemented in abf09bed3cce ("s390/mm: implement
software dirty bits") which made it into v3.9.  Earlier kernels will
have to look at the page state itself.

Also, the VM has become more scalable, and what used a purely
theoretical race back then has become easier to trigger.

To fix it, we introduce a new internal FOLL_COW flag to mark the "yes,
we already did a COW" rather than play racy games with FOLL_WRITE that
is very fundamental, and then use the pte dirty flag to validate that
the FOLL_COW flag is still valid.

Reported-and-tested-by: Phil "not Paul" Oester <kernel@linuxace.com>
Acked-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Michal Hocko <mhocko@suse.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Nick Piggin <npiggin@gmail.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[wt: s/gup.c/memory.c; s/follow_page_pte/follow_page_mask;
     s/faultin_page/__get_user_page]
Signed-off-by: Willy Tarreau <w@1wt.eu>

Bug 1829674

Change-Id: I6fbb1abf656ff7e05ec4c65f07dbbdd694546fb4
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/1241323
GVS: Gerrit_Virtual_Submit

2 years agot210: tegra-fuse: add support to read UID
Shardar Shariff Md [Thu, 1 Sep 2016 09:12:20 +0000]
t210: tegra-fuse: add support to read UID

- Add support to read unique ID (UID), there is no one register
field to read UID, instead UID is constructed from various bits
of information burned into the fuses during the manufactoring
process.

UID is constructed to 64 bit as below from below UID register
<CID:4><VENDOR:4><FAB:6><LOT:26><WAFER:6><X:9><Y:9>

- rename tegra21x offset filename to tegra210

Bug 1803702

Change-Id: Ie14ab25e147d6668ab2a092305a0c62b7257279a
Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
Reviewed-on: http://git-master/r/1241691
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>

2 years agospi: tegra: fixed polling mode tranfer timeout
snchen [Fri, 14 Oct 2016 09:44:57 +0000]
spi: tegra: fixed polling mode tranfer timeout

The change "set INTR_MASK only once" cause polling mode failed.

Interrupt mask has to be cleared in case of polling mode during setup.
Check against transfer direction is invalid during setup and will fail.
Removed direction check.

bug 1818284

Signed-off-by: snchen <snchen@nvidia.com>
Change-Id: I8f5c0f5685e6f0e311deadc4a32c0aade40dd572
Reviewed-on: http://git-master/r/1241690
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

2 years agogpio: pca953x: fix gpio input on gpio offsets >= 8
Martin Chi [Mon, 24 Oct 2016 08:57:37 +0000]
gpio: pca953x: fix gpio input on gpio offsets >= 8

This change fixes a regression introduced by commit
f5f0b7aa8 (gpio: pca953x: make the register access by GPIO bank)

When the pca953x driver was converted to using 8-bit reads/writes
the bitmask in pca953x_gpio_get_value wasn't adjusted with a
modulus BANK_SZ and consequently looks at the wrong bits in the
input register.

Bug 1826501

Change-Id: Id9c9d1cab9fb97e2fdf9408b03873722f787fbec
Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 40a625daa88653d7942dc85483f6f289cd687cb7)
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/1241694
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit

2 years agoARM64: DT: imx185: Add gain delay support
Frank Chen [Fri, 21 Oct 2016 00:56:12 +0000]
ARM64: DT: imx185: Add gain delay support

Add one frame delay for gain setting to be
in sync of exposure settings.

Bug 200244330

Change-Id: I2213c4630970b38f07fd8dedc3445699af81086c
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: http://git-master/r/1240263
GVS: Gerrit_Virtual_Submit
Reviewed-by: Joshua Widen <jwiden@nvidia.com>
Reviewed-by: David Wang (SW-TEGRA) <davidw@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

2 years agogpu: nvgpu: fix use-after-free in case of error notifier
Gagan Grover [Wed, 12 Oct 2016 11:35:06 +0000]
gpu: nvgpu: fix use-after-free in case of error notifier

A use-after-free scenario is possible where one thread in
gk20a_free_error_notifiers() is trying to free the error
notifier and another thread in gk20a_set_error_notifier()
is still using the error notifier

Fix this by introducing mutex error_notifier_mutex for
error notifier accesses

Take mutex in gk20a_free_error_notifiers() and in
gk20a_set_error_notifier() before accessing notifier

In gk20a_init_error_notifier(), set the pointer
ch->error_notifier_ref inside the mutex and only
after notifier is completely initialized

Bug 1824788

Change-Id: I47e1ab57d54f391799f5a0999840b663fd34585f
Reviewed-on: http://git-master/r/1233988
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1236662
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gaurav Singh (SW-TEGRA) <gaursingh@nvidia.com>
Tested-by: Gaurav Singh (SW-TEGRA) <gaursingh@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agoarm64: tegra: jetson-cv: add hynix emc dvfs
Bibek Basu [Tue, 27 Sep 2016 10:34:57 +0000]
arm64: tegra: jetson-cv: add hynix emc dvfs

Add Hynix emc dvfs table for ramcode 1.
Runtime selection will happen based on ramcode

Bug 1819114

Change-Id: I3503e8f9f87fea64b5a947ba9ffb84eda70df5bb
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/1227650
GVS: Gerrit_Virtual_Submit

2 years agoRevert "arm64: tegra21: enable Android Composite Gadget"
Prabhu Kuttiyam [Wed, 12 Oct 2016 16:53:11 +0000]
Revert "arm64: tegra21: enable Android Composite Gadget"

This reverts commit 4791baae56adddc8a97fa25dc27e46aa83ebf90d.
The original commit caused the device mode to stop working.
Hence reverting the commit
boot.img size decreased by 91552 bytes.

Bug 200236945

Change-Id: Id51f4e1d815c709529307fbdf9510fbe81f189f9
Signed-off-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Reviewed-on: http://git-master/r/1235396
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>

2 years agoWAR:arm64: dts: update imx185 dt
Saurabh Maniktala [Thu, 6 Oct 2016 23:59:38 +0000]
WAR:arm64: dts: update imx185 dt

This change disables these
modes:
 10 bit 30fps
 12 bit 60fps
 10 bit 60fps

Bug 1823414

Change-Id: I6ffbcf3454e7c65a2b51816cdabca8be57041c40
Signed-off-by: Saurabh Maniktala <smaniktala@nvidia.com>
Reviewed-on: http://git-master/r/1232811
Reviewed-by: David Wang (SW-TEGRA) <davidw@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

2 years agokernel: arm64: Added "model name" in /proc/cpuinfo
Ninad Malwade [Mon, 3 Oct 2016 08:46:01 +0000]
kernel: arm64: Added "model name" in /proc/cpuinfo

- Show "model name" in /proc/cpuinfo
- This will enable displaying processor info in
"System setting -> Details" in Ubuntu

model name display is generic.
model name      : ARMv8 Processor rev X (v8l)

bug 200225877

Change-Id: I6bd4334693b1e87c8f678f164be814d3047969ee
Signed-off-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-on: http://git-master/r/1230761
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agoarm64: config: enable IGB driver
Vidya Sagar [Mon, 3 Oct 2016 07:02:01 +0000]
arm64: config: enable IGB driver

enables Intel IGB driver to support Intel-82576
Gigabit Ethernet Controller based NICs

boot.img size not changed.

Change-Id: I24f08dd0e16f77a050f2384439a2b9240f45396c
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-on: http://git-master/r/1230003
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit

2 years agoARM64: DT: ov23850: Update mode settings
Frank Chen [Tue, 15 Mar 2016 01:24:35 +0000]
ARM64: DT: ov23850: Update mode settings

Update ov23850 mode settings.

Bug 200172566

Change-Id: Ibf0eba56b2daa0c05adb082dd106390752f9a618
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: http://git-master/r/1224071
Tested-by: Peter Mikolajczyk <pmikolajczyk@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Charlie Davies <cdavies@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

2 years agoARM64: dt: power setting for camera plugin-manager
Frank Chen [Mon, 12 Sep 2016 20:27:59 +0000]
ARM64: dt: power setting for camera plugin-manager

Add power servivce related DT entries for camera
plugin-manager

Bug 1812759
Bug 1789527

Change-Id: I5a64ab00fd5484682e1c43408780fa6ef0dfc59e
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: http://git-master/r/1219116
Cherry picked from: 877b0e25b2ea35399e7a52b710a1a20f1679b2ad
Reviewed-on: http://git-master/r/1221849
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>

2 years agoRevert "arm64:mm: rm swtch to ASID0 in ctxt swtch"
Rohit Khanna [Wed, 7 Sep 2016 20:00:23 +0000]
Revert "arm64:mm: rm swtch to ASID0 in ctxt swtch"

This reverts commit 584b60200b8bdcc895c8edacb94f48db5929f70a.

Change-Id: Ibe5b217521b77fa5799400b9460182e3329e1779
Signed-off-by: Rohit Khanna <rokhanna@nvidia.com>
Reviewed-on: http://git-master/r/1216501
(cherry picked from commit 04c8d66d61e15198b95d54672b2f2fe047d180b3)
Reviewed-on: http://git-master/r/1223589
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
GVS: Gerrit_Virtual_Submit

2 years agommc: card: test: Fix out of boundary array access
Xia Yang [Mon, 15 Aug 2016 21:56:51 +0000]
mmc: card: test: Fix out of boundary array access

Allocate buffer with 1 extra byte for NULL terminator.

Bug 1791602

Change-Id: I3c3658315c2cd2a1dc7be7d72953998a5275e71e
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/1216961
(cherry picked from commit 18c5b5ac8e51d8aaff61c63823f0ec99d4a065d5)
Reviewed-on: http://git-master/r/1216963
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>

2 years agoARM64: jetson-e: disable tskin estimator
Rajkumar Kasirajan [Thu, 11 Aug 2016 03:52:06 +0000]
ARM64: jetson-e: disable tskin estimator

The jetson-e E2581 Power Measurement board is an open system
with fan. Remove Tskin estimator as it is required only for
closed system without fan.

Bug 200227303

Change-Id: I112713a3fef8cf54c573c43e3e1b8f8da94a57f1
Signed-off-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-on: http://git-master/r/1200927
(cherry picked from commit 6ce6778f189aba77cc02d1394603727864365522)
Reviewed-on: http://git-master/r/1219259
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agoarm64: tegra21: enable Android Composite Gadget
Mark Kuo [Thu, 21 Jul 2016 10:21:05 +0000]
arm64: tegra21: enable Android Composite Gadget

This commit enables the composite gadget
in defconfig.

boot.img size increased by 91552 bytes.

Bug 200231426
Change-Id: I9b77287b9b1ab9c91d4780b95eddf2c28f873b95
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Signed-off-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Reviewed-on: http://git-master/r/1209229
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Ankit Gupta (SW-TEGRA) <ankitgu@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

2 years agoxhci-tegra: t210: wait for U3 entry in bus suspend
Henry Lin [Sun, 14 Aug 2016 17:17:11 +0000]
xhci-tegra: t210: wait for U3 entry in bus suspend

In T210, U3 entry delay is expected as LFPS dectector WAR needs to
use two mailbox commands to implement. The two mailbox commands can be
finished among 2 ms most of time. But, in worst case, they may
take up to hundreds of ms. Waiting for U3 entry in bus suspend
for some time can avoid xhci-tegra driver to stop system suspend
for long U3 entry delay frequently.

Bug 200227198

Change-Id: I989e60e829d8bd9b085495d96f70580c6d7981ab
Signed-off-by: Henry Lin <henryl@nvidia.com>
Reviewed-on: http://git-master/r/1202561
(cherry picked from commit 0c9facf9ed457262e4e09994a920d5fbf547359d)
Reviewed-on: http://git-master/r/1206882
Tested-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>