Gagan Grover [Thu, 16 Oct 2014 07:25:15 +0000 (12:55 +0530)]
futex-prevent-requeue-pi-on-same-futex.patch
futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1)
If uaddr == uaddr2, then we have broken the rule of only requeueing
froma non-pi futex to a pi futex with this call. If we attempt this,
then dangling pointers may be left for rt_waiter resulting in an
exploitable condition.
This change brings futex_requeue() in line with
futex_wait_requeue_pi() which performs the same check as per
commit 6f7b0a2a5c0f
("futex: Forbid uaddr == uaddr2 in futex_wait_requeue_pi()")
[ tglx: Compare the resulting keys as well, as uaddrs might be
different depending on the mapping ]
Jordan Nien [Wed, 8 Oct 2014 09:10:41 +0000 (17:10 +0800)]
input: touchscreen: raydium: update to 66.9
66.9 Change list:
[1]. base on firmware 66.7.
[2]. Fixed Line broken with palm
[3]. Keep the original setting of event report mode after
suspend/resume.
[4]. System Suspend / Resume with palm, will not enter the Auto Scan.
[5]. Fix Touch reported speed is not matching the actual speed in some
particular area which is 3 to 5mm away from edge [6]. Fix deadlock between rm_tch_cmd_process and rm_timer_work_handler
during lp0.
[6]. add solution for rm_ts_server issues with SELinux domain.
video: tegra: nvmap: remove support for Deprecated GET_ID/FROM_ID ioctl's
Remove support and add warning message for deprecated IOCTL's -
NVMAP_IOC_FROM_ID and NVMAP_IOC_GET_ID. These ioctl calls
are deprecated by corresponding FD ioctl calls.
Incremented nvmap_handle ref count in utility function
nvmap_get_id_from_dmabuf_fd() before the function release reference
to dma buffer. This is required to avoid race conditions in nvmap
code where nvmap_handle returned by this function could be freed
concurrently while the caller is still using it.
As a side effect of above change, every caller of this utility
function must decrement nvmap_handle ref count after using the
returned nvmap_handle.
Daniel Solomon [Fri, 15 Aug 2014 00:50:15 +0000 (17:50 -0700)]
video: tegra: dc: Avoid FRAME_END_INT conflict
Allowing for dc->lock to be acquired by the
caller in function tegra_dc_config_frame_end_intr
can result in FRAME_END_INT mask register being
overwritten if the lock is actually acquired by
another thread.
Refactor the critical section into its own function
and allow callers to call either function. Also
Change the name of tegra_dc_wait_for_frame_end
to indicate that it should be called with dc->lock
locked.
Daniel Solomon [Tue, 5 Aug 2014 21:48:42 +0000 (14:48 -0700)]
video: tegra: dc: Fix and refactor FRAME_END_INT
- Fix a conflict with other DC interrupt masks
when the DSI driver waits on FRAME_END_INT
- Move generic FRAME_END_INT mask/unmask and
wait-for functions to dc.c
Tuning vic scaling parameter to make vic more sensible to load and stay longer
at a slightly higher frequency.
- This tuning does not increase power in regular use cases.
- Thie will help fix CTS1 testPreviewFpsRange.
Bibhay Ranjan [Fri, 10 Oct 2014 12:25:53 +0000 (17:55 +0530)]
net: wireless: bcmdhd: synchronize 3 contexts
net_device and net_info is used in three different
contexts wl_event_handler, _dhd_sysioc_thread and
and within wl_dealloc_netinfo. These contexts are
getting triggered when AP association is happening
and simultaneously P2P interface deletion happens.
Because of this particular scenario, these two structs
get corrupted as they are not synchronized.
Now synchronizing them with readers/writers semaphore
makes sure, we do not free the memories in one context
while other context is still using it.
Jon McCaffrey [Fri, 10 Oct 2014 23:08:42 +0000 (16:08 -0700)]
nvmap: set background allocator to SCHED_IDLE
Set background allocator to SCHED_IDLE, so that it only runs when no
other processes wish to. Otherwise, it can run for 20-100ms with only
occasional interruption, signficantly disrupting other processing.
Alex Waterman [Mon, 14 Apr 2014 23:17:27 +0000 (16:17 -0700)]
video: tegra: nvmap: Fix zero page support
In the case that the zeroed page kernel config is set, the
userspace zeroed memory module param also required being set
otherwise non-zero memory could be placed back into the page
pools.
Alex Waterman [Mon, 28 Apr 2014 18:27:17 +0000 (11:27 -0700)]
video: tegra: nvmap: Consolidate zeroed mem config
Consilidate the NVMAP_FORCE_ZEROED_USER_PAGES config to only
two locations. Both are in nvmap_handle.c and ensure that
the module param zero_memory is enabled and unchangable when
NVMAP_FORCE_ZEROED_USER_PAGES is set.
Krishna Reddy [Tue, 5 Aug 2014 21:43:37 +0000 (14:43 -0700)]
video: tegra: nvmap: clean cache during page allocations into page pool
Clean cache during page allocations into page pool to
avoid cache clean overhead at the time of allocation.
Increase page pool refill size to 1MB from 512KB.
Alex Waterman [Thu, 3 Apr 2014 01:21:18 +0000 (18:21 -0700)]
video: tegra: nvmap: Remove old ZP support
Remove the old foreground page zeroing support. This is replaced
by using the background zeroed page pool support instead. If page
pools are empty clearing happens in the allocation context.
Alex Waterman [Thu, 3 Apr 2014 01:20:14 +0000 (18:20 -0700)]
video: tegra: nvmap: Add background allocator
Add a background kernel thread that allocates memory into the
page pool.
This allows zeroed pages to be allocated directly into the page
pool. In turn this avoids that overhead in the allocation path
itself (for page pool hits at least).
Pre-flushing the pages being placed into the page pool will be
implemented later.
Allen Yu [Mon, 21 Jul 2014 05:04:23 +0000 (13:04 +0800)]
video: tegra: dc: protect vsync code with lp_lock
There is a gap in vsycn code (wait for user vblank completion) that is not
and can not be protected by dc->lock. So there might be races between vsync
code and PM code. For example, if tegra_dsi_host_suspend() or tegra_dc_disable()
is called while vsync thread is waiting for the completion, dc clock will be
disabled as we drop all references to dc clock in _suspend() or _disable().
Fix description:
- Rename one_shot_lp_lock to lp_lock as we need it for continuous mode as well.
- Protect vsync code with lp_lock to eliminate races with PM code path.
Jon Mayo [Thu, 10 Jul 2014 18:07:05 +0000 (11:07 -0700)]
video: tegra: dc: eliminate races in vsync code
Fix races in vsync code, don't touch data structure outside of locks.
Support both continous mode panels, not just one-shot panels.
Use a bit flag so we don't clobber vblank settings needed by other modules.
Scott Long [Fri, 29 Aug 2014 23:18:18 +0000 (16:18 -0700)]
security: tlk_driver: free tmp memrefs
Release temporary memory parameter references at the conclusion
of a launch operation to ensure pages are unpinned and
other resources are properly cleaned up.
Gaurav Sarode [Mon, 4 Aug 2014 21:24:04 +0000 (14:24 -0700)]
video: tegra: nvmap: Fix sleeping while atomic warning
When reading /d/nvmap/iovmm/procrank, we first take clients_lock
spin_lock and then take ref_lock mutex inside nvmap_iovmm_get_client_mss.
This creates mutex inside spin_lock situation. To fix this,
clients_lock is converted to mutex.
Shital Jaju [Thu, 14 Aug 2014 17:13:26 +0000 (10:13 -0700)]
Update the cfg layer with new channel info
The upper layer is not notified of the change in channel after roaming.
This results in AGO creation on incorrect channel (previous AP channel)
after roaming. This change will update the cfg layer with the new channel
info after receiving romaing event.
Martin Chabot [Thu, 3 Jul 2014 13:47:31 +0000 (15:47 +0200)]
usb: host: tegra: no delay for boost frequency
Apply frequency boost as soon as bus_resume is done
to avoid no scheduling situation when there is a
lot of ehci_irq
Move frequency boost after ehci_resume to keep boost
for high speed device only.
Make sure only to decrement the PM counters if they were actually
incremented.
Note that the USB PM counter, but not necessarily the driver core PM
counter, is reset when the interface is unbound.
Fixes: 11ea859d64b6 ("USB: additional power savings for cdc-acm devices
that support remote wakeup")
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4421a014e97c6669db6eb8600ce83d29e5484842)
Change-Id: I9038def962389acfca7f6a583e719d15f0f8d758 Signed-off-by: Neil Patel <neilp@nvidia.com>
Reviewed-on: http://git-master/r/553907
GVS: Gerrit_Virtual_Submit Reviewed-by: Steve Lin <stlin@nvidia.com>
Added new file "maps" for nvmap heaps. In addition to data given by
existing "allocations" file, this also shows the client's virtual
mappings and total amount of handle physical memory that is actually
mapped to a client's virtual address space.
This change will help in tracking nvmap memory usage of processes.
Patch includes following nvmap changes:
- added "pid" field in nvmap_vma_list so now looking at handle's vma list,
we can say which vma belongs to which process.
- sorted handle's vma list in ascending order of handle offsets.
Change-Id: If7e25ca2ef43c036558c9c9ead5f67ee8eef6b42 Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/426734
(cherry picked from commit c1ddad1b13332386857f9f2964aa8968094e7e8c)
Reviewed-on: http://git-master/r/553676 Reviewed-by: Harry Lin <harlin@nvidia.com> Tested-by: Harry Lin <harlin@nvidia.com>
GVS: Gerrit_Virtual_Submit
Krishna Reddy [Fri, 20 Jun 2014 21:33:55 +0000 (14:33 -0700)]
video: tegra: nvmap: unify debug stats code
Unify debug stats code for iovmm and carveouts.
Change-Id: Ief800587870845ed6f566cb7afb2c91000d177ca Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/426733
(cherry picked from commit 0c0f7e5a9ef459d7940cc66af0a00321bb54d389)
Reviewed-on: http://git-master/r/553675 Reviewed-by: Harry Lin <harlin@nvidia.com> Tested-by: Harry Lin <harlin@nvidia.com>
GVS: Gerrit_Virtual_Submit
Krishna Reddy [Thu, 19 Jun 2014 23:10:23 +0000 (16:10 -0700)]
video: tegra: nvmap: don't count shared memory in full
Don't count shared memory in full in iovmm stats.
Add SHARE field to allocations info to show how many
processes are sharing the handle.
Update few comments in the code.
Remove unnecessary iovm_commit accounting.
Change-Id: I49650bf081d652dedc7139f639aae6da06965ecd Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/426274
(cherry picked from commit 92d47c10fbf7a315d4c953bafb71ee23032b7f65)
Reviewed-on: http://git-master/r/553673 Reviewed-by: Harry Lin <harlin@nvidia.com> Tested-by: Harry Lin <harlin@nvidia.com>
GVS: Gerrit_Virtual_Submit
Krishna Reddy [Tue, 17 Jun 2014 19:30:16 +0000 (12:30 -0700)]
video: tegra: nvmap: set handle dmabuf to NULL early
This can allow catching handle dmabuf usage during its free.
Change-Id: Ie20c7b860ca5194a190ff7005302bf50602d16ed Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/424329
(cherry picked from commit 10e648c2e2f9760c97ce55a1091d9e7097d2504d)
Reviewed-on: http://git-master/r/553669 Reviewed-by: Harry Lin <harlin@nvidia.com> Tested-by: Harry Lin <harlin@nvidia.com>
GVS: Gerrit_Virtual_Submit
Krishna Reddy [Fri, 20 Jun 2014 00:34:01 +0000 (17:34 -0700)]
video: tegra: nvmap: add handle share count to debug stats
handle share count provides info on how many processes are sharing
the handle. IOW, how many processes are holding a ref on handle.
Update the comments for umap/kmap_count.
Change-Id: I9f543ebf51842dad6ecd3bfeb7480496c98963be Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/426302
(cherry picked from commit 244c41508be0705cc232942b9403e17611f63e45)
Reviewed-on: http://git-master/r/553668 Reviewed-by: Harry Lin <harlin@nvidia.com> Tested-by: Harry Lin <harlin@nvidia.com>
GVS: Gerrit_Virtual_Submit
Change-Id: I0180f59ced7d070d1952e66cc7f1b21510a53c0e Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/418555
(cherry picked from commit bb20ce7cb828f4e64c64f538cace5f414d9e74fc)
Reviewed-on: http://git-master/r/553651 Reviewed-by: Harry Lin <harlin@nvidia.com> Tested-by: Harry Lin <harlin@nvidia.com>
GVS: Gerrit_Virtual_Submit
Krishna Reddy [Mon, 2 Jun 2014 23:18:56 +0000 (16:18 -0700)]
video: tegra: nvmap: track kernel and user map count
Track kernel and user map counts and add these to debug info.
Bug 1519700
Change-Id: I9b06bd748737dbfe57f531af4f9b61a48429d01a Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/417980
(cherry picked from commit e57544e6a284d228548ee555e6e1aff0f0a494e8)
Reviewed-on: http://git-master/r/553650 Reviewed-by: Harry Lin <harlin@nvidia.com> Tested-by: Harry Lin <harlin@nvidia.com>
GVS: Gerrit_Virtual_Submit
Krishna Reddy [Wed, 4 Jun 2014 21:50:05 +0000 (14:50 -0700)]
video: tegra: nvmap: track vma for all handles
Clean up the code related to mmap and handle nvmap_map_info_caller_ptr
failures graciously.
Initilize h->vmas at right place.
Add sanity checks in nvmap_vma_open/_close.
Vinayak Menon [Wed, 26 Feb 2014 19:06:22 +0000 (00:36 +0530)]
staging: android: lowmemorykiller: neglect swap cached pages in other_file
With ZRAM enabled it is observed that lowmemory killer
doesn't trigger properly. swap cached pages are
accounted in NR_FILE, and lowmemorykiller considers
this as reclaimable and adds to other_file. But these
pages can't be reclaimed unless lowmemorykiller triggers.
So subtract swap pages from other_file.
Processes reciding in memory are much faster than processes
in swap. For better user experience in a multiprocessing
environment it is preferable not to allow too many processes
to recide in memory.
Allen Yu [Wed, 20 Aug 2014 03:39:59 +0000 (11:39 +0800)]
media: tegra: nvavp: avoid racing in nvavp_uninit
nvavp_init() might be called when open_lock is dropped in nvavp_uninit(),
which will mess up the _init/_uninit sequence. To eliminate the racing,
removes the unnecessary cancel_work_sync() and also the _unlock/_lock
around it. It is safe to do so since nvavp_uninit() sets nvavp->pending
to false in nvavp_halt_vde(), and the work handler will do nothing if
nvavp->pending is false.
This change adds the LP1 Low Core Voltage feature to all platforms.
Enables the Core voltage to be lowered during voice call(LP1)
state. Also rearranges the sequence during reducing the core voltage.
Owing to lower perf, prefer CPU over SE HW for crypto
operations. However, we may still need SE for save/restore
key context across Lp0 so keep the driver to do this.
Rakesh Bodla [Mon, 4 Aug 2014 15:22:22 +0000 (20:52 +0530)]
usb: otg: tegra: Notify vbus event in resume to otg wakelock
When device cable is inserted in LP0, display should
wakeup. For this, uevent should be sent to framework
(sent in power supply extcon driver for charger)
before the system initiates system suspend.
Notifying the VBUS event to otg wakelock in driver resume
will make sure system does not goes back to suspend,
so display wakes up.
usb: tegra: increase delay for y-cable detection on tn8
On TN8 due to palmas pmic h/w limitation takes more time
to notify the id status. Increasing the delay enables
y-cable detection on TN8. Also, for faster
notification of charging icon reordering the sequence
of charging icon notification and setting current.
Do not use HW SE Engine for crypto operations.
As dm-crypt passes 512bytes to SE, using low
data buffer sizes cannot make use of the SE HW
data pipe-lining efficiently. Changing to 4k
bytes is showing good numbers with SE. So,
working with Google to increase buffer size to
4kbytes in dm-crypt is the solution left.
Scott Long [Tue, 8 Jul 2014 18:43:10 +0000 (11:43 -0700)]
security: tlk_driver: new ss protocol support
The new secure storage protocol design allows the tlk daemon
to exchange data directly with the secure storage TA.
The only role the tlk_driver now plays is in the scheduling path
between the tlk daemon and the secure storage TA.
A summary of the corresponding changes:
* add support for persistent mem buffer parameter type (the
mapping to these buffers persist for the duration of the
session); persistent mem buffers are kept on a separate
shared memory descriptor list and are tracked by session id
* modified ioctl interface between tlk daemon and tlk_driver to
involve only a single command; the integer value passed down
by the tlk daemon indicates whether it is ready for a new
request or has just completed the last request
* fixed up various warnings
Note that support for old protocol will be left intact until the
corresponding changes are applied to the TLK components.
Change-Id: Ibcaad4f0e00c8b1f107af5c1e82ea0aa4dd57398 Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: http://git-master/r/435709
(cherry picked from commit 69dd1cf5ba1687fc1f13ecb9b79b1f5a286ec15a)
Reviewed-on: http://git-master/r/488998 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Hyung Taek Ryoo <hryoo@nvidia.com> Tested-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-by: Kevin Kranzusch <kevink@nvidia.com>
Sharif Inamdar [Tue, 3 Jun 2014 04:48:11 +0000 (10:18 +0530)]
Revert "security: tlk_driver: delete te_pin_user_pages() and its usage"
We are reverting this as we want to add support of
te_pin_user_pages(). TA can have dynamic mappings
created as part of an OpenSession or LaunchOperation
command.
If either of these specify a buffer as an argument
(with virt addr and length as params), the TLK kernel
will create a mapping to it. This happens for things
that go between TAs (no pin issue there) and between
the NS and S worlds.
In the case of NS buffers being passed in, we need
phys memory to stay where it is, because the secure
world has a mapping to it that Linux is unaware of,
which is why we pin it.
The secure world now sends a PREEMPT_BY_FS error code as a result
of OpenSession/LaunchOp call. This indicates a pending FS request
from the secure world which we need to handle and send the
FS_COMPLETION SMC on completion.
Until the secure firmware and the linux driver get in sync, we keep
legacy SS handling alive to avoid incomaptibility issues. Once the
secure firmware switches to the new handling, we would remove the
legacy support from the linux driver as well.
Michael I. Gold [Mon, 30 Jun 2014 08:42:23 +0000 (01:42 -0700)]
video: tegra: dc: implement vblank event
Implement TEGRA_DC_EXT_EVENT_VBLANK for user space notification of
vblank events. Implement TEGRA_DC_EXT_SET_VBLANK to enable/disable
vblank notification per display.
Allen Yu [Sat, 9 Aug 2014 07:02:48 +0000 (15:02 +0800)]
media: tegra: nvavp: fix deadlock in nvavp_uninit
nvavp_uninit() should be called with open_lock held. And open_lock
needs to be released before flushing clock_disable_work since the
work handler needs the same lock.
Fix a linker issue with div and modulo operations
which caused linker to throw an undefined reference to
__aeabi_uldivmod using gcc 4.7.
Fix by typecast to int after division.
Colin Cross [Mon, 14 Apr 2014 22:42:28 +0000 (15:42 -0700)]
watchdog: tegra: remove reboot notifier
We don't want to disable the watchdog on reboot, it will catch
cases where reboot fails. On power down, tegra_wdt_remove will
be called and will disable the watchdog.