media: video: nvavp: Add bsea/vcp clocks for Audio

1) Enable bsea/vcp clocks for Audio support by ioctl
2) Send kernel event NVE276_OS_INTERRUPT_APP_NOTIFY
to user space
3) Suspend Resume support

bug 964514

Change-Id: I72fb790baa093b4bcd99a128c886dc049fa0fbb6
Signed-off-by: Vandana Salve <vsalve@nvidia.com>
Reviewed-on: http://git-master/r/108493
cherry picked from commit 4432c5fa5e9072ff019d994f3bc8239bd34ddad1
Reviewed-on: http://git-master/r/114589
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
patch: update graphic drivers
usb: ehci: tegra: Fix Slab corruption error

Give ownership of the DMA buffer back to the processor first and
then free the buffer. Otherwise processor won't be able to
access the dma mapped buffers and this would lead to slab
corruption.
When the DMA buffer is freed without a call to dma_sync_single_for_cpu(),
the kernel won't be able to set the buffer as POISON FREE and when we
acquire this memory back again the kernel will start printing slab
corruption output as the memory is not set to POISON FREE

Bug 1017884
Bug 1018161
Reviewed-on: http://git-master/r/#change,122151
Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>

Change-Id: I00d6cb185cd2314cccb56f968eb0a05288588c13
Reviewed-on: http://git-master/r/122390
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
(cherry picked from commit 642d37a0eee196d0ce811dd11bb7af5ba281ee3a)

Signed-off-by: Peter Zu <pzu@nvidia.com>
Change-Id: I3ff611a3674536a93233da53488840fb77c5d4ef
Reviewed-on: http://git-master/r/123470
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
media: video: tegra: Don't overwrite avp outbox

Before writing a new value in avp outbox register ensure the last
value written in it has been read by AVP. If AVP has not yet read
the current value in avp outbox register then wait until it is done.

Bug 1054421

Change-Id: Ie1f024969d9fcb87cf6f88b8ee3b557874eb310c
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/139406
(cherry picked from commit ecd44726ca121df4697044f5e0398aa75106ff63)

Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Change-Id: Ie01542d9ce27fff87d2a9fc5aec5d9310ed0583d
Reviewed-on: http://git-master/r/141227
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Niranjan Wartikar <nwartikar@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
GVS: Gerrit_Virtual_Submit
workqueue: skip nr_running sanity check in worker_enter_idle() if trustee is active

commit 544ecf310f0e7f51fa057ac2a295fc1b3b35a9d3 upstream.

worker_enter_idle() has WARN_ON_ONCE() which triggers if nr_running
isn't zero when every worker is idle.  This can trigger spuriously
while a cpu is going down due to the way trustee sets %WORKER_ROGUE
and zaps nr_running.

It first sets %WORKER_ROGUE on all workers without updating
nr_running, releases gcwq->lock, schedules, regrabs gcwq->lock and
then zaps nr_running.  If the last running worker enters idle
inbetween, it would see stale nr_running which hasn't been zapped yet
and trigger the WARN_ON_ONCE().

Fix it by performing the sanity check iff the trustee is idle.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
workqueue: perform cpu down operations from low priority cpu_notifier()

commit 6575820221f7a4dd6eadecf7bf83cdd154335eda upstream.

Currently, all workqueue cpu hotplug operations run off
CPU_PRI_WORKQUEUE which is higher than normal notifiers.  This is to
ensure that workqueue is up and running while bringing up a CPU before
other notifiers try to use workqueue on the CPU.

Per-cpu workqueues are supposed to remain working and bound to the CPU
for normal CPU_DOWN_PREPARE notifiers.  This holds mostly true even
with workqueue offlining running with higher priority because
workqueue CPU_DOWN_PREPARE only creates a bound trustee thread which
runs the per-cpu workqueue without concurrency management without
explicitly detaching the existing workers.

However, if the trustee needs to create new workers, it creates
unbound workers which may wander off to other CPUs while
CPU_DOWN_PREPARE notifiers are in progress.  Furthermore, if the CPU
down is cancelled, the per-CPU workqueue may end up with workers which
aren't bound to the CPU.

While reliably reproducible with a convoluted artificial test-case
involving scheduling and flushing CPU burning work items from CPU down
notifiers, this isn't very likely to happen in the wild, and, even
when it happens, the effects are likely to be hidden by the following
successful CPU down.

Fix it by using different priorities for up and down notifiers - high
priority for up operations and low priority for down operations.

Workqueue cpu hotplug operations will soon go through further cleanup.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
video: tegra: dc: Remove the delay while reading out crc checksum for sim

Change-Id: If6193bb74299f809f60e3edaddafd7e181b3719d
Signed-off-by: Chao Xu <cxu@nvidia.com>
Reviewed-on: http://git-master/r/93026
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
video: tegra: host: new syncpoint max interface

Add the NVHOST_IOCTL_CTRL_SYNCPT_READ_MAX ioctl for reading max value
of a syncpoint.

Bug 1039058

Change-Id: I61c348c3007a4fb919fbe48993907d46f38c5fa8
Signed-off-by: Michal Pecio <mpecio@nvidia.com>
Reviewed-on: http://git-master/r/132387
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
dvfs: set proper cold offset values
pwm: tegra: resource allocation through devm_*

Using the devm_* for memory region allocation and clock handler
request. As a result, there is no need to explicitly free them and
hence saving some code.

Change-Id: Id69d40bd44622105ea4f8a37426dd83a694adb8d
Signed-off-by: Kunal Agrawal <kunala@nvidia.com>
Reviewed-on: http://git-master/r/121581
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
ARM: Tegra: Omit L2 flush at disable

In Tegra kernel L2 is disabled only upon CPU cluster power down,
e.g. LP2 entry. Flushing L2 upon every LP2 entry is costly.
Since we are always in single core mode upon cluster power down
we can safely omit L2 flush upon L2 disable.

Change-Id: I27542b11e6133f3192a02440e5b14ea408b860fd
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/105625
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
build: ramddisk-aosp: Updating permissions
build: ramddisk-aosp: Removing user cap
build: ramddisk-aosp: Updatating # Sensor section
build: ramddisk-aosp: Adding # leds section
build: ramddisk-aosp: Adding increasing read ahead size of mmc block devices
drivers: cpufreq: ondemand: Bringing back inline with initial HTC Endeavor ondmeand
cpufreq_ondemand: dont use interactive tracers, create youre own

Conflicts:
	drivers/cpufreq/cpufreq_ondemand.c
drivers: cpufreq: ondemand: Adding missing debug_load to several dbs_freq_increase() calls
drivers: cpufreq: ondemand: Moving all defined variables to one central location