3 years agoworkqueue: consider work function when searching for busy work items rel-roth
Tejun Heo [Tue, 18 Dec 2012 18:35:02 +0000]
workqueue: consider work function when searching for busy work items

commit a2c1c57be8d9fd5b716113c8991d3d702eeacf77 upstream.

To avoid executing the same work item concurrenlty, workqueue hashes
currently busy workers according to their current work items and looks
up the the table when it wants to execute a new work item.  If there
already is a worker which is executing the new work item, the new item
is queued to the found worker so that it gets executed only after the
current execution finishes.

Unfortunately, a work item may be freed while being executed and thus
recycled for different purposes.  If it gets recycled for a different
work item and queued while the previous execution is still in
progress, workqueue may make the new work item wait for the old one
although the two aren't really related in any way.

In extreme cases, this false dependency may lead to deadlock although
it's extremely unlikely given that there aren't too many self-freeing
work item users and they usually don't wait for other work items.

To alleviate the problem, record the current work function in each
busy worker and match it together with the work item address in
find_worker_executing_work().  While this isn't complete, it ensures
that unrelated work items don't interact with each other and in the
very unlikely case where a twisted wq user triggers it, it's always
onto itself making the culprit easy to spot.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Andrey Isakov <andy51@gmx.ru>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51701
[lizf: Backported to 3.4:
 - Adjust context
 - Incorporate earlier logging cleanup in process_one_work() from
   044c782ce3a9 ('workqueue: fix checkpatch issues')]
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Icf4808d3053fc982e2c13a27df470b4cd0c298ce
Reviewed-on: http://git-master/r/821810
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoworkqueue: fix possible stall on try_to_grab_pending() of a delayed work item
Lai Jiangshan [Tue, 18 Sep 2012 17:40:00 +0000]
workqueue: fix possible stall on try_to_grab_pending() of a delayed work item

commit 3aa62497594430ea522050b75c033f71f2c60ee6 upstream.

Currently, when try_to_grab_pending() grabs a delayed work item, it
leaves its linked work items alone on the delayed_works.  The linked
work items are always NO_COLOR and will cause future
cwq_activate_first_delayed() increase cwq->nr_active incorrectly, and
may cause the whole cwq to stall.  For example,

state: cwq->max_active = 1, cwq->nr_active = 1
       one work in cwq->pool, many in cwq->delayed_works.

step1: try_to_grab_pending() removes a work item from delayed_works
       but leaves its NO_COLOR linked work items on it.

step2: Later on, cwq_activate_first_delayed() activates the linked
       work item increasing ->nr_active.

step3: cwq->nr_active = 1, but all activated work items of the cwq are
       NO_COLOR.  When they finish, cwq->nr_active will not be
       decreased due to NO_COLOR, and no further work items will be
       activated from cwq->delayed_works. the cwq stalls.

Fix it by ensuring the target work item is activated before stealing
PENDING in try_to_grab_pending().  This ensures that all the linked
work items are activated without incorrectly bumping cwq->nr_active.

tj: Updated comment and description.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[lizf: backported to 3.4: adjust context]
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I49121d52f507e9e2f24872acd1219b10c4c51c04
Reviewed-on: http://git-master/r/821809
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoworkqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s
Tejun Heo [Tue, 4 Dec 2012 15:40:39 +0000]
workqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s

commit fc4b514f2727f74a4587c31db87e0e93465518c3 upstream.

8852aac25e ("workqueue: mod_delayed_work_on() shouldn't queue timer on
0 delay") unexpectedly uncovered a very nasty abuse of delayed_work in
megaraid - it allocated work_struct, casted it to delayed_work and
then pass that into queue_delayed_work().

Previously, this was okay because 0 @delay short-circuited to
queue_work() before doing anything with delayed_work.  8852aac25e
moved 0 @delay test into __queue_delayed_work() after sanity check on
delayed_work making megaraid trigger BUG_ON().

Although megaraid is already fixed by c1d390d8e6 ("megaraid: fix
BUG_ON() from incorrect use of delayed work"), this patch converts
BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s so that such
abusers, if there are more, trigger warning but don't crash the
machine.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Xiaotian Feng <xtfeng@gmail.com>
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I54960d54922e433bed26b9716661b1641fd58955
Reviewed-on: http://git-master/r/821808
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoworkqueue: exit rescuer_thread() as TASK_RUNNING
Mike Galbraith [Wed, 28 Nov 2012 06:17:18 +0000]
workqueue: exit rescuer_thread() as TASK_RUNNING

commit 412d32e6c98527078779e5b515823b2810e40324 upstream.

A rescue thread exiting TASK_INTERRUPTIBLE can lead to a task scheduling
off, never to be seen again.  In the case where this occurred, an exiting
thread hit reiserfs homebrew conditional resched while holding a mutex,
bringing the box to its knees.

PID: 18105  TASK: ffff8807fd412180  CPU: 5   COMMAND: "kdmflush"
 #0 [ffff8808157e7670] schedule at ffffffff8143f489
 #1 [ffff8808157e77b8] reiserfs_get_block at ffffffffa038ab2d [reiserfs]
 #2 [ffff8808157e79a8] __block_write_begin at ffffffff8117fb14
 #3 [ffff8808157e7a98] reiserfs_write_begin at ffffffffa0388695 [reiserfs]
 #4 [ffff8808157e7ad8] generic_perform_write at ffffffff810ee9e2
 #5 [ffff8808157e7b58] generic_file_buffered_write at ffffffff810eeb41
 #6 [ffff8808157e7ba8] __generic_file_aio_write at ffffffff810f1a3a
 #7 [ffff8808157e7c58] generic_file_aio_write at ffffffff810f1c88
 #8 [ffff8808157e7cc8] do_sync_write at ffffffff8114f850
 #9 [ffff8808157e7dd8] do_acct_process at ffffffff810a268f
    [exception RIP: kernel_thread_helper]
    RIP: ffffffff8144a5c0  RSP: ffff8808157e7f58  RFLAGS: 00000202
    RAX: 0000000000000000  RBX: 0000000000000000  RCX: 0000000000000000
    RDX: 0000000000000000  RSI: ffffffff8107af60  RDI: ffff8803ee491d18
    RBP: 0000000000000000   R8: 0000000000000000   R9: 0000000000000000
    R10: 0000000000000000  R11: 0000000000000000  R12: 0000000000000000
    R13: 0000000000000000  R14: 0000000000000000  R15: 0000000000000000
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018

Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I23ff2a787f5624bdb4e71f3bb86e4ed6c9fe9182
Reviewed-on: http://git-master/r/821807
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoworkqueue: add missing smp_wmb() in process_one_work()
Tejun Heo [Fri, 3 Aug 2012 17:30:45 +0000]
workqueue: add missing smp_wmb() in process_one_work()

commit 959d1af8cffc8fd38ed53e8be1cf4ab8782f9c00 upstream.

WORK_STRUCT_PENDING is used to claim ownership of a work item and
process_one_work() releases it before starting execution.  When
someone else grabs PENDING, all pre-release updates to the work item
should be visible and all updates made by the new owner should happen
afterwards.

Grabbing PENDING uses test_and_set_bit() and thus has a full barrier;
however, clearing doesn't have a matching wmb.  Given the preceding
spin_unlock and use of clear_bit, I don't believe this can be a
problem on an actual machine and there hasn't been any related report
but it still is theretically possible for clear_pending to permeate
upwards and happen before work->entry update.

Add an explicit smp_wmb() before work_clear_pending().

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Iaf310a06fe1b6ae69203c4d9ebf052b14ee957f9
Reviewed-on: http://git-master/r/821806
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoworkqueue: UNBOUND -> REBIND morphing in rebind_workers() should be atomic
Lai Jiangshan [Sat, 1 Sep 2012 16:28:19 +0000]
workqueue: UNBOUND -> REBIND morphing in rebind_workers() should be atomic

commit 96e65306b81351b656835c15931d1d237b252f27 upstream.

The compiler may compile the following code into TWO write/modify
instructions.

worker->flags &= ~WORKER_UNBOUND;
worker->flags |= WORKER_REBIND;

so the other CPU may temporarily see worker->flags which doesn't have
either WORKER_UNBOUND or WORKER_REBIND set and perform local wakeup
prematurely.

Fix it by using single explicit assignment via ACCESS_ONCE().

Because idle workers have another WORKER_NOT_RUNNING flag, this bug
doesn't exist for them; however, update it to use the same pattern for
consistency.

tj: Applied the change to idle workers too and updated comments and
    patch description a bit.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Id93c81455f3cba15d18850d42190ab7e9c353819
Reviewed-on: http://git-master/r/821805
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoworkqueue: reimplement work_on_cpu() using system_wq
Tejun Heo [Tue, 18 Sep 2012 19:48:43 +0000]
workqueue: reimplement work_on_cpu() using system_wq

commit ed48ece27cd3d5ee0354c32bbaec0f3e1d4715c3 upstream.

The existing work_on_cpu() implementation is hugely inefficient.  It
creates a new kthread, execute that single function and then let the
kthread die on each invocation.

Now that system_wq can handle concurrent executions, there's no
advantage of doing this.  Reimplement work_on_cpu() using system_wq
which makes it simpler and way more efficient.

stable: While this isn't a fix in itself, it's needed to fix a
        workqueue related bug in cpufreq/powernow-k8.  AFAICS, this
        shouldn't break other existing users.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I0cd629fefbc21b35be0c84d9c64abd072073b1d0
Reviewed-on: http://git-master/r/821804
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoRevert "workqueue: CPU hotplug keep idle workers"
ximing [Thu, 22 Oct 2015 09:58:56 +0000]
Revert "workqueue: CPU hotplug keep idle workers"

This reverts commit 468011c1e1d998ad87ed82acad0b7538aee296a7.

Change-Id: I278c5dc66a0790f1ba5e4d90326f73a0a650428f
Signed-off-by: Ximing Chen <ximingc@nvidia.com>
Reviewed-on: http://git-master/r/821803
GVS: Gerrit_Virtual_Submit

3 years agothor:audio Enhance default sound value
Eric Zhang [Tue, 22 Sep 2015 09:35:33 +0000]
thor:audio Enhance default sound value

Redesign the codec driver to make sure volume is loud enough

Bug 200127797

Change-Id: Ie88c1814e4aa0c9c17ea8a407b3941a5b0c4969d
Signed-off-by: Eric Zhang <ericz@nvidia.com>
Reviewed-on: http://git-master/r/802870
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoprintk: apply timezone in the kernel log time
David Yu [Mon, 20 Jan 2014 06:27:18 +0000]
printk: apply timezone in the kernel log time

- fix  recursion bug
- show timezone applied log since logcat shows it

Change-Id: If25195ddd729d9897494aaa846525f25df1c872d
Signed-off-by: David Yu <davyu@nvidia.com>
Reviewed-on: http://git-master/r/357582
Reviewed-on: http://git-master/r/732495
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoprintk: change the timestamp behind kerne log to rtc time
Martin Chi [Thu, 16 Jan 2014 05:43:37 +0000]
printk: change the timestamp behind kerne log to rtc time

the original timestamp is CPU time, which causes
the time is missing in kernel log after LPx.
Change to rtc time to fix this and also good
for cross-checking with logcat

Change-Id: I87df3df6c699dacea40d550043afda0dc00d5c82
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/356301
Reviewed-on: http://git-master/r/732494
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>
GVS: Gerrit_Virtual_Submit

3 years agocpuquiet: move back cpuquiet_lock
Jubeom Kim [Fri, 29 Nov 2013 07:37:28 +0000]
cpuquiet: move back cpuquiet_lock

Moved cpuquiet_lock to the back of cpuquiet_switch_governor().
cpuquiet_switch_governor() has to be protected by cpuquiet_lock.
In the runnable cpuquiet_governor case, it can occur a kernel panic or BUG_ON
because schedule_work() and INIT_WORK() can be performed at the same time.

Bug 1410816

Change-Id: I6d3d69bd8896e5425a762cbc4a58343a319edf29
Signed-off-by: Jubeom Kim <jubeomk@nvidia.com>
Reviewed-on: http://git-master/r/336858
Reviewed-on: http://git-master/r/802057
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoandroid: drivers: workaround debugfs race in binder
Riley Andrews [Thu, 28 May 2015 22:10:14 +0000]
android: drivers: workaround debugfs race in binder

If a /d/binder/proc/[pid] entry is kept open after linux has
torn down the associated process, binder_proc_show can deference
an invalid binder_proc that has been stashed in the debugfs
inode.  Validate that the binder_proc ptr passed into binder_proc_show
has not been freed by looking for it within the global process list
whilst the global lock is held. If the ptr is not valid, print nothing.

Bug 19587483
Change-Id: Ice878c171db51ef9a4879c2f9299a2deb873d255
Signed-off-by: Riley Andrews <riandrews@android.com>
Reviewed-on: http://git-master/r/782321
Reviewed-by: Alex Lei <alei@nvidia.com>
Tested-by: Alex Lei <alei@nvidia.com>
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoipv4: Missing sk_nulls_node_init() in ping_unhash().
ximingc [Wed, 12 Aug 2015 04:22:01 +0000]
ipv4: Missing sk_nulls_node_init() in ping_unhash().

If we don't do that, then the poison value is left in the ->pprev
backlink.

This can cause crashes if we do a disconnect, followed by a connect().

Bug 1642949

Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Wen Xu <hotdog3645@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Change-Id: Ic4021b8e20c5ca05526d7293d93265200aa208e1
Signed-off-by: ximingc <ximingc@nvidia.com>
Reviewed-on: http://git-master/r/782211

3 years agopower: FG: max17048: don't hibernate in suspend
Nathan Zhang [Thu, 11 Jun 2015 03:05:20 +0000]
power: FG: max17048: don't hibernate in suspend

Don't let max17048 enter into hibernate mode to avoid
battery meter big drop after device resume

Bug 200114855

Change-Id: I9985fde9621bd3454e2ce4a5f7bdb44f40a64c4f
Signed-off-by: Nathan Zhang <nathanz@nvidia.com>
Reviewed-on: http://git-master/r/756794
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

3 years agomisc: tegra-profiler: add cpu notifier
Igor Nabirushkin [Wed, 29 Apr 2015 06:44:01 +0000]
misc: tegra-profiler: add cpu notifier

Detect when the CPU goes online/offline.

Bug 1634024

Change-Id: I989a9aefbc32a70070b37fe42ce5dcf75b18263b
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/729497
(cherry picked from commit a2eec5a5ea12fb50e073b322ca9d948818179968)
Reviewed-on: http://git-master/r/752158
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix stop error
Igor Nabirushkin [Mon, 13 Apr 2015 13:00:37 +0000]
misc: tegra-profiler: fix stop error

Do not verify the existence of profiled process after
start of session.
It fixes the stop error on non-rooted devices when
application is terminated during the profile session.

Bug 1634968

Change-Id: I5384e6de3c7ff9791033d344b02acba9a729157b
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/730898
(cherry picked from commit 79fcedbbf7fbc984ec8b95900ee49af0a9be590b)
Reviewed-on: http://git-master/r/752155
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix coverity issue
Igor Nabirushkin [Tue, 28 Apr 2015 06:04:15 +0000]
misc: tegra-profiler: fix coverity issue

Fix Coverity issue of out-of-bounds.
Coverity id: 29855

Bug 1416640

Change-Id: I112daaad55c1a2de9fdb411a0591e4ed7bf50e6e
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/730896
(cherry picked from commit 09c1b2add13aa7c6f4410c874ddad936913f5d19)
Reviewed-on: http://git-master/r/752154
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: send all frequencies
Igor Nabirushkin [Tue, 28 Apr 2015 05:58:51 +0000]
misc: tegra-profiler: send all frequencies

Send CPU, EMC and GPU frequencies at the start of profiling.
It is needed so that initial frequencies are also displayed
in the profiler GUI.

Bug 1635012

Change-Id: I2e850c846b110da8aa4331ac700a20930da6841b
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/730895
(cherry pick from commit a00b48ad9e012bf17e0e3f8610e2732af53b2115)
Reviewed-on: http://git-master/r/752152
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Andrey Trachenko <atrachenko@nvidia.com>
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agomerged the missing code from st8 branch
Narayan Reddy [Thu, 21 May 2015 11:46:44 +0000]
merged the missing code from st8 branch

Bug 200106155

Change-Id: Ia130c76a7cac2c077d46b12f1e48189df963ddc9
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: http://git-master/r/745515
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agosound: Switch from Blake when wifi turned off
Jason Roche [Thu, 31 Jul 2014 18:21:58 +0000]
sound: Switch from Blake when wifi turned off

This fixes the issue of delay in audio switching
from Blake when Wifi is turned off during playback

Bug:200025414

Signed-off-by: Jason Roche <jroche@nvidia.com>
Reviewed-on: http://git-master/r/736503
(cherry picked from commit 42ae383d54f83e0841e11f4f126d1a1fa0ff42d4)
Change-Id: Ibc436332d1a886ea166cffdcbbe8ac8b1465b6ad
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/738333
GVS: Gerrit_Virtual_Submit
Tested-by: Ramaiyer Ramesh <ramaiyerr@nvidia.com>
Reviewed-by: Ramaiyer Ramesh <ramaiyerr@nvidia.com>

3 years agoAdd driver command MKEEP_ALIVE
Srinivas Ramachandran [Fri, 11 Jul 2014 02:34:40 +0000]
Add driver command MKEEP_ALIVE

Add the driver command MKEEP_ALIVE to send a periodic IP based keep alive
packet from the firmware to avoid deauth from access point due to inactivity.

Bug 1528060
Bug 200102431

Change-Id: I6836b7d19ed617d216391e318e9cd5b93e1e0724
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: http://git-master/r/436944
(cherry pick from commit 56e54c835efef359d871def23cd1903841284d68)
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/738938
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoARM: tegra11: clock: Update emc dvfs in clock resume
Alex Frid [Thu, 13 Jun 2013 05:28:16 +0000]
ARM: tegra11: clock: Update emc dvfs in clock resume

Added emc dvfs update in clock resume in case when emc parent has been
changed across suspend (this update would also happen automatically
during resume of any driver with emc shared user, so this change is
"just in case" there is no driver that resumes emc shared users).

Bug 200093432

Change-Id: I4d4cf8092df52752c2f574e100b7128387dfad13
(cherry picked from commit cbb6705a9257948fcc99d713c28bbaa2c09e7bef)
Signed-off-by: Nathan Zhang <nathanz@nvidia.com>
Reviewed-on: http://git-master/r/736503
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoARM: tegra11: clock: Turn Off memory PLLs in resume
Alex Frid [Thu, 13 Jun 2013 04:10:13 +0000]
ARM: tegra11: clock: Turn Off memory PLLs in resume

Turned Off memory PLLs (PLLM or PLLC) in clock resume if they are left enabled
by LP0 or LP1 exit code, but not used as EMC clock sources.

Bug 200093432

Conflicts:
arch/arm/mach-tegra/tegra11_clocks.c

Change-Id: I017e79007873d8d4b918853e08e0cc27a424e310
Signed-off-by: Alex Frid <afrid@nvidia.com>
(cherry picked from commit efdebd8e986a622ec82593c959fd2e2eac444204)
Signed-off-by: Nathan Zhang <nathanz@nvidia.com>
Reviewed-on: http://git-master/r/736502
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoARM: tegra11: clock: Use exact PLL rate in resume
Alex Frid [Mon, 10 Mar 2014 19:01:17 +0000]
ARM: tegra11: clock: Use exact PLL rate in resume

Removed 1Hz margin from target rate request during PLL resume.
Although the PLL output rate is restored correctly in any case, PLL
dividers settings may differ from tabulated targets (if any) when non
exact rate is requested.

Bug 1473597
Bug 200093432

Change-Id: I5307ee49fcac4ce6dc6b3c38d1841629060700d7
Reviewed-on: http://git-master/r/379620
(cherry picked from commit 96a02b52db51498756967864d9c5a3596f812570)
Signed-off-by: Nathan Zhang <nathanz@nvidia.com>
Reviewed-on: http://git-master/r/736501
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoarm: Enable IRQs before attempting to read user space in __und_usr
Catalin Marinas [Tue, 20 Aug 2013 17:37:02 +0000]
arm: Enable IRQs before attempting to read user space in __und_usr

The Undef abort handler in the kernel reads the undefined instruction
from user space. If the page table was modified from another CPU, the
user access could fail and do_page_fault() will be executed with
interrupts disabled. This can potentially deadlock on ARM11MPCore or on
Cortex-A15 with erratum 798181 workaround enabled (both implying IPI for
TLB maintenance with page table lock held).

This patch enables the IRQs in __und_usr before attempting to read the
instruction from user space.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Change-Id: Ie5164d8ada9646d723b2b6ef65797e9307718292
Reviewed-on: http://git-master/r/264300
Reviewed-by: Bo Yan <byan@nvidia.com>
Tested-by: Bo Yan <byan@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-on: http://git-master/r/735560
GVS: Gerrit_Virtual_Submit
Tested-by: Jeffery Yu <jefferyy@nvidia.com>
Reviewed-by: Jeffery Yu <jefferyy@nvidia.com>
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoinput: touch: raydium: suspend/resume with display
Nathan Zhang [Sat, 18 Apr 2015 14:40:48 +0000]
input: touch: raydium: suspend/resume with display

 We would need to call suspend/resume only with display on/off. This
 would remove extra complexity and save power in order to avoid some
 use cases that cause touch does not work.

 Bug 1450642
 Bug 200043803
 Bug 200093432

 Conflicts:
         drivers/input/touchscreen/rm31080a_ts.c

Change-Id: I923a669cf9c293def53842b74b2dfd046d2a1411
(cherry picked from commit d1c4039c80b8a449525cd28cf8e51743d7b3bff8)
Reviewed-on: http://git-master/r/375387
(cherry picked from commit 117a82808f9947ce6e5cde4b9bdc06e2981741c4)
Reviewed-on: http://git-master/r/558827
(cherry picked from commit 77175ebd98e7d25c6adf6d2ba913d2143383383f)
Signed-off-by: Nathan Zhang <nathanz@nvidia.com>
Reviewed-on: http://git-master/r/733481
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoinput:touch:raydium: fix touch off with displayoff
Xiaohui Tao [Thu, 12 Sep 2013 17:56:51 +0000]
input:touch:raydium: fix touch off with displayoff

Do not call suspend/resume in display off case for touch.

Bug 1293127
Bug 200093432

Conflicts:
drivers/input/touchscreen/rm31080a_ts.c

Change-Id: I7b2d273d53bedfacb7c8ee5771fa3697b95028e7
Reviewed-on: http://git-master/r/263498
(cherry picked from commit 15b02eca5e9510cea68619c2905634df6dc9184a)
Signed-off-by: Nathan Zhang <nathanz@nvidia.com>
Reviewed-on: http://git-master/r/733480
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoinput: touch: raydium: conditional wakelock calls
Naveen Kumar S [Mon, 1 Jul 2013 11:16:21 +0000]
input: touch: raydium: conditional wakelock calls

Tasks holding wakelocks in raydium driver intermittently obstruct
system from entering suspend state. Added conditional checks while
invoking wakelock functions so as to disable them if needed.

Bug 1314808
Bug 1343545
Bug 200093432

Change-Id: Ie71ea98661e56f2f50d406ee759b007ac877762a
Reviewed-on: http://git-master/r/247729
(cherry picked from commit f56a79205a60e0e86b4a0c2e9f3c5d33f22c5a58)
(cherry picked from commit 1eab65886aaf933462c4b9bec873f076819c3395)
Signed-off-by: Nathan Zhang <nathanz@nvidia.com>
Reviewed-on: http://git-master/r/733479
Reviewed-by: Naveen Kumar S <nkumars@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agopower: bq2419x-charger: short vbus enable time
Martin Chi [Wed, 14 Aug 2013 07:15:53 +0000]
power: bq2419x-charger: short vbus enable time

Per the scope of vbus regulator when plug-in otg
device cable, the vbus ring time is only about 2ms,
so short enable time from 500ms to 8ms

Bug 1344478
Bug 200098419

Change-Id: Ief7573281d427940af2af3b0365bac1389ae7862
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/261358
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-on: http://git-master/r/733423
Reviewed-by: Lei Fan <leif@nvidia.com>
Tested-by: Lei Fan <leif@nvidia.com>
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agofutex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1)
Thomas Gleixner [Tue, 3 Jun 2014 12:27:06 +0000]
futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1)

If uaddr == uaddr2, then we have broken the rule of only requeueing from
a 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 ]

Fixes CVE-2014-3153.

Bug 200097934

Change-Id: Ia212432b3b8d2c7271882ef1bbb33b6516e39f89
Reported-by: Pinkie Pie
Signed-off-by: Will Drewry <wad@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/732933
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoHandle 'sk' being NULL in UID-based routing.
Sreeram Ramachandran [Tue, 8 Jul 2014 18:37:03 +0000]
Handle 'sk' being NULL in UID-based routing.

Bug: 15413527
Bug 200095904

Change-Id: If33bebb7b52c0ebfa8dac2452607bce0c2b0faa0
Signed-off-by: Sreeram Ramachandran <sreeram@google.com>
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/732520
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agonet: core: Support UID-based routing.
Lorenzo Colitti [Mon, 31 Mar 2014 07:23:51 +0000]
net: core: Support UID-based routing.

This contains the following commits:

1. 0149763 net: core: Add a UID range to fib rules.
2. 1650474 net: core: Use the socket UID in routing lookups.
3. 0b16771 net: ipv4: Add the UID to the route cache.
4. ee058f1 net: core: Add a RTA_UID attribute to routes.
    This is so that userspace can do per-UID route lookups.

Bug: 15413527
Bug 200095904

Change-Id: I1285474c6734614d3bda6f61d88dfe89a4af7892
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/732519
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoalarmtimer: Use hrtimer per-alarm instead of per-base
John Stultz [Thu, 13 Sep 2012 23:12:16 +0000]
alarmtimer: Use hrtimer per-alarm instead of per-base

Arve Hjønnevåg reported numerous crashes from the
"BUG_ON(timer->state != HRTIMER_STATE_CALLBACK)" check
in __run_hrtimer after it called alarmtimer_fired.

It ends up the alarmtimer code was not properly handling
possible failures of hrtimer_try_to_cancel, and because
these faulres occur when the underlying base hrtimer is
being run, this limits the ability to properly handle
modifications to any alarmtimers on that base.

Because much of the logic duplicates the hrtimer logic,
it seems that we might as well have a per-alarmtimer
hrtimer, and avoid the extra complextity of trying to
multiplex many alarmtimers off of one hrtimer.

Thus this patch moves the hrtimer to the alarm structure
and simplifies the management logic.

Changelog:
v2:
* Includes a fix for double alarm_start calls found by
  Arve

Cc: Arve Hjønnevåg <arve@android.com>
Cc: Colin Cross <ccross@android.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Arve Hjønnevåg <arve@android.com>
Tested-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I5ac6140f6fb44997f0b51ffbb70adcba44808f39
Reviewed-on: http://git-master/r/732198
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agonet: support marking accepting TCP sockets
Lorenzo Colitti [Wed, 26 Mar 2014 04:03:12 +0000]
net: support marking accepting TCP sockets

When using mark-based routing, sockets returned from accept()
may need to be marked differently depending on the incoming
connection request.

This is the case, for example, if different socket marks identify
different networks: a listening socket may want to accept
connections from all networks, but each connection should be
marked with the network that the request came in on, so that
subsequent packets are sent on the correct network.

This patch adds a sysctl to mark TCP sockets based on the fwmark
of the incoming SYN packet. If enabled, and an unmarked socket
receives a SYN, then the SYN packet's fwmark is written to the
connection's inet_request_sock, and later written back to the
accepted socket when the connection is established.  If the
socket already has a nonzero mark, then the behaviour is the same
as it is today, i.e., the listening socket's fwmark is used.

Black-box tested using user-mode linux:

- IPv4/IPv6 SYN+ACK, FIN, etc. packets are routed based on the
  mark of the incoming SYN packet.
- The socket returned by accept() is marked with the mark of the
  incoming SYN packet.
- Tested with syncookies=1 and syncookies=2.

Bug 200034037
Bug 200062531
Bug 200095892

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
(cherry picked from commit 4593f09b1f9939ec6ed2f8d7848def26b98c47ac)
Change-Id: I26bc1eceefd2c588d73b921865ab70e4645ade57
Reviewed-on: http://git-master/r/498738
(cherry picked from commit 1eff0016fcec30c661eab86761beab1724c74473)
Signed-off-by: Steve Kuo <stevek@nvidia.com>
Reviewed-on: http://git-master/r/664925
GVS: Gerrit_Virtual_Submit
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/730772
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agonet: add a sysctl to reflect the fwmark on replies
Lorenzo Colitti [Tue, 18 Mar 2014 11:52:27 +0000]
net: add a sysctl to reflect the fwmark on replies

Kernel-originated IP packets that have no user socket associated
with them (e.g., ICMP errors and echo replies, TCP RSTs, etc.)
are emitted with a mark of zero. Add a sysctl to make them have
the same mark as the packet they are replying to.

This allows an administrator that wishes to do so to use
mark-based routing, firewalling, etc. for these replies by
marking the original packets inbound.

Tested using user-mode linux:
 - ICMP/ICMPv6 echo replies and errors.
 - TCP RST packets (IPv4 and IPv6).

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
(cherry picked from commit 3356997e1e1b2aa9959f046203e6d0b193bbd7f7)

Bug 200034037
Bug 200062531
Bug 200095892

Change-Id: I6873d973196797bcf32e2e91976df647c7e8b85a
Reviewed-on: http://git-master/r/498727

(cherry picked from commit 4440681cc054ab163f08dac2132a9c2a08a7f630)
Signed-off-by: Steve Kuo <stevek@nvidia.com>
Change-Id: Ie8ca2d654308cfa4d36f0b4c40ae58c1a1c55f72
Reviewed-on: http://git-master/r/664924
GVS: Gerrit_Virtual_Submit
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/730770
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoAdd missing default route changes
Harshavardhan Nalajala [Fri, 24 Oct 2014 00:00:31 +0000]
Add missing default route changes

Default route changes were missing as part of
dbed723911c6ce4c1b9b3d3b8a9ac7ed681b646a. So,
ipv6 global address acquisition fails most of times.
Adding the missing default route changes resolved the issue.

Bug 1568030
Bug 200062531
Bug 200095892

Change-Id: Ida443281757e6feb3c35e1a7744cba6465e23bb9
Signed-off-by: Harshavardhan Nalajala <hnalajala@nvidia.com>
Reviewed-on: http://git-master/r/562657
(cherry picked from commit 6bf66bc7113c30b524ae96ef78ccedf99ead7bd2)
Reviewed-on: http://git-master/r/664927
GVS: Gerrit_Virtual_Submit
Reviewed-by: Steve Kuo <stevek@nvidia.com>
Tested-by: Steve Kuo <stevek@nvidia.com>
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/730773
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agotcp: incoming connections might use wrong route under synflood
Dmitry Popov [Thu, 11 Apr 2013 08:55:07 +0000]
tcp: incoming connections might use wrong route under synflood

[ Upstream commit d66954a066158781ccf9c13c91d0316970fe57b6 ]

There is a bug in cookie_v4_check (net/ipv4/syncookies.c):
flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk),
   RT_SCOPE_UNIVERSE, IPPROTO_TCP,
   inet_sk_flowi_flags(sk),
   (opt && opt->srr) ? opt->faddr : ireq->rmt_addr,
   ireq->loc_addr, th->source, th->dest);

Here we do not respect sk->sk_bound_dev_if, therefore wrong dst_entry may be
taken. This dst_entry is used by new socket (get_cookie_sock ->
tcp_v4_syn_recv_sock), so its packets may take the wrong path.

Bug 200095892

Change-Id: I275845e71c9581c422f25556f25bd1b0cafec8ab
Signed-off-by: Dmitry Popov <dp@highloadlab.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/730771
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agotcp: resets are misrouted
Alexey Kuznetsov [Fri, 12 Oct 2012 04:34:17 +0000]
tcp: resets are misrouted

[ Upstream commit 4c67525849e0b7f4bd4fab2487ec9e43ea52ef29 ]

After commit e2446eaa ("tcp_v4_send_reset: binding oif to iif in no
sock case").. tcp resets are always lost, when routing is asymmetric.
Yes, backing out that patch will result in misrouting of resets for
dead connections which used interface binding when were alive, but we
actually cannot do anything here.  What's died that's died and correct
handling normal unbound connections is obviously a priority.

Comment to comment:
> This has few benefits:
>   1. tcp_v6_send_reset already did that.

It was done to route resets for IPv6 link local addresses. It was a
mistake to do so for global addresses. The patch fixes this as well.

Actually, the problem appears to be even more serious than guaranteed
loss of resets.  As reported by Sergey Soloviev <sol@eqv.ru>, those
misrouted resets create a lot of arp traffic and huge amount of
unresolved arp entires putting down to knees NAT firewalls which use
asymmetric routing.

Bug 200095892

Change-Id: I446bf2a9f1062a9dccccb6b5d241e8a820e0e221
Signed-off-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/730769
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agonet: ipv6: autoconf routes into per-device tables
Lorenzo Colitti [Wed, 26 Mar 2014 10:35:41 +0000]
net: ipv6: autoconf routes into per-device tables

Currently, IPv6 router discovery always puts routes into
RT6_TABLE_MAIN. This causes problems for connection managers
that want to support multiple simultaneous network connections
and want control over which one is used by default (e.g., wifi
and wired).

To work around this connection managers typically take the routes
they prefer and copy them to static routes with low metrics in
the main table. This puts the burden on the connection manager
to watch netlink to see if the routes have changed, delete the
routes when their lifetime expires, etc.

Instead, this patch adds a per-interface sysctl to have the
kernel put autoconf routes into different tables. This allows
each interface to have its own autoconf table, and choosing the
default interface (or using different interfaces at the same
time for different types of traffic) can be done using
appropriate ip rules.

The sysctl behaves as follows:

- = 0: default. Put routes into RT6_TABLE_MAIN as before.
- > 0: manual. Put routes into the specified table.
- < 0: automatic. Add the absolute value of the sysctl to the
       device's ifindex, and use that table.

The automatic mode is most useful in conjunction with
net.ipv6.conf.default.accept_ra_rt_table. A connection manager
or distribution could set it to, say, -100 on boot, and
thereafter just use IP rules.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
(cherry picked from commit 5fe5c512af518d0abbbc0d2fafa8e355f518c2a9)

Bug 200034037
Bug 200062531
Bug 200095892

Change-Id: I82d16e3737d9cdfa6489e649e247894d0d60cbb1
Reviewed-on: http://git-master/r/498098
(cherry picked from commit ab9efc0aa2af07a96c15a9119b09172c3f09ab3c)
Signed-off-by: Steve Kuo <stevek@nvidia.com>
Reviewed-on: http://git-master/r/664926
GVS: Gerrit_Virtual_Submit

Signed-off-by: Nine Feng <nfeng@nvidia.com>
Change-Id: If8239f02ada6a9af82d113d20f6e4cc7bccea6f4
Reviewed-on: http://git-master/r/730768
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoping: prevent NULL pointer dereference on write to msg_name
Hannes Frederic Sowa [Mon, 18 Nov 2013 06:07:45 +0000]
ping: prevent NULL pointer dereference on write to msg_name

A plain read() on a socket does set msg->msg_name to NULL. So check for
NULL pointer first.

[Backport of net-next cf970c002d270c36202bd5b9c2804d3097a52da0]

linux Bug: 12780426

bug 200058771
Bug 200062530
Bug 200095899

(cherry picked from commit 5a0312add72620b4bd67ccb7cde887ef2b95cd6d)
Change-Id: I3df76aca2fa56478b9a33c404f7b1f0940475ef7
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Reviewed-on: http://git-master/r/658453
(cherry picked from commit 055bd70e50d3d05e5a2a52b12f3894fb546c9f79)
Signed-off-by: Steve Kuo <stevek@nvidia.com>
Reviewed-on: http://git-master/r/664975
GVS: Gerrit_Virtual_Submit
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/730732
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agotcp: add a sysctl to config the tcp_default_init_rwnd
Andy Carman [Mon, 1 Dec 2014 22:53:12 +0000]
tcp: add a sysctl to config the tcp_default_init_rwnd

bug 200058863
Bug 200062526
Bug 200095911

The default initial rwnd is hardcoded to 10.

Now we allow it to be controlled via
/proc/sys/net/ipv4/tcp_default_init_rwnd
which limits the values from 3 to 100

This is somewhat needed because ipv6 routes are
autoconfigured by the kernel.

See "An Argument for Increasing TCP's Initial Congestion Window"
in https://developers.google.com/speed/articles/tcp_initcwnd_paper.pdf

Change-Id: I4d0555b0ab21b381ce4d66aaff352da450157daf
Reviewed-on: http://git-master/r/658109
Signed-off-by: Steve Kuo <stevek@nvidia.com>
(cherry picked from commit f8a616119808d2b4c7a4909ad5ee37aa472639d9)
Reviewed-on: http://git-master/r/664520
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/730724
Reviewed-by: Andy Carman <acarman@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoarm: configs: tegra11 enable CONFIG_NETFILTER_XT_TARGET_IDLETIMER
Steve Kuo [Tue, 16 Dec 2014 14:37:33 +0000]
arm: configs: tegra11 enable CONFIG_NETFILTER_XT_TARGET_IDLETIMER

Bug 200062526
Bug 200095911

Change-Id: I00f3880dcf44025eb6a30f66bebaef37f595db9d
Signed-off-by: Steve Kuo <stevek@nvidia.com>
Reviewed-on: http://git-master/r/664516
GVS: Gerrit_Virtual_Submit
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/730723
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoasoc: tegra: forbid kernel to operate TFA9887
Lei Fan [Wed, 15 Apr 2015 08:56:44 +0000]
asoc: tegra: forbid kernel to operate TFA9887

TFA9887 should be operated in HAL not kernel

Bug 200092982

Change-Id: I55bf4cef247b279a21d477b5f66f2217f79f1547
Signed-off-by: Lei Fan <leif@nvidia.com>
Reviewed-on: http://git-master/r/731731
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: cleanup unwinding rules
Igor Nabirushkin [Sat, 21 Mar 2015 16:33:09 +0000]
misc: tegra-profiler: cleanup unwinding rules

DWARF unwinding: cleanup unwinding rules for frames.
It fixes some broken backtraces.

Bug 1626528

Change-Id: Iaa62528cc0b6b97f1763934ef641791f196897b0
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/720600
Reviewed-on: http://git-master/r/729060
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix broken backtraces
Igor Nabirushkin [Sat, 21 Mar 2015 15:39:55 +0000]
misc: tegra-profiler: fix broken backtraces

Unwinding based on arm32 ehabi: fix broken backtraces when
all unwind entries are located in exidx section and
extab section is not exist.

Bug 1625585

Change-Id: I800e1347b04aa2c2c8802b81478931985c19feb2
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/720598
Reviewed-on: http://git-master/r/729058
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: simpler task status checking
Dmitry Antipov [Fri, 20 Mar 2015 12:24:41 +0000]
misc: tegra-profiler: simpler task status checking

Use PF_EXITING to check task status and simplify argument checking
in read_all_sources, adjust hrtimer_handler accordingly.

Bug 1625611

Signed-off-by: Dmitry Antipov <dantipov@nvidia.com>
Change-Id: Ida8f9e7ed5492f17868988e05328bfa8432a31e9
Reviewed-on: http://git-master/r/719460
Reviewed-on: http://git-master/r/729056
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add unwind entry checking
Dmitry Antipov [Fri, 20 Mar 2015 12:23:53 +0000]
misc: tegra-profiler: add unwind entry checking

Use simple disassembler to verify unwind table entry against function code.

Bug 1618651

Signed-off-by: Dmitry Antipov <dantipov@nvidia.com>
Change-Id: Ib75b50f1bb753b7358fcc08107bfefc3133b4f0c
Reviewed-on: http://git-master/r/714784
Reviewed-on: http://git-master/r/729054
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add unwind reason codes
Igor Nabirushkin [Mon, 16 Mar 2015 15:13:33 +0000]
misc: tegra-profiler: add unwind reason codes

Unwinding: store individual URC codes for each method.

Bug 1624134

Change-Id: I3b2045f9c9147354f3440e326fd3aeccb5e0458d
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/717848
Reviewed-on: http://git-master/r/729052
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add task states
Igor Nabirushkin [Mon, 16 Mar 2015 14:08:36 +0000]
misc: tegra-profiler: add task states

* Add task states into sched samples.
* Store task exit_state field.

Bug 1624099

Change-Id: I4a25aa6c15b59da987688342478127dccc5c0a1c
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/717839
Reviewed-on: http://git-master/r/729046
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: prevent infinite loop
Igor Nabirushkin [Mon, 9 Mar 2015 16:16:55 +0000]
misc: tegra-profiler: prevent infinite loop

* Prevent false recursion in mixed mode.
* Unwinding based on frame pointers: do not save lr address
  if previous frame is incorrect.

Bug 1619030

Change-Id: Iadeb8ca87ead576b18821964878cddf7aa94cf27
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/715291
Reviewed-on: http://git-master/r/729045
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add cpufreq notifier
Igor Nabirushkin [Fri, 6 Mar 2015 13:36:42 +0000]
misc: tegra-profiler: add cpufreq notifier

Add cpufreq notifier into the profiler.

Bug 1618622

Change-Id: I06352c515c64f524fb88898dadefe1d07cedfe0f
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/714765
Reviewed-on: http://git-master/r/729044
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add unwind reason codes
Igor Nabirushkin [Thu, 26 Feb 2015 14:49:41 +0000]
misc: tegra-profiler: add unwind reason codes

Add unwind reason codes for dwarf unwinding.

Bug 1611073

Change-Id: Ic7f324f526ba34505e3b9bbedae7b98c29ce097d
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/711654
Reviewed-on: http://git-master/r/729043
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix broken call chains
Igor Nabirushkin [Thu, 26 Feb 2015 11:16:21 +0000]
misc: tegra-profiler: fix broken call chains

Fix broken call chains for thumb code with dwarf and
arm ehabi information simultaneously.

Bug 1615165

Change-Id: If34ecfac26657546170121c363cf89b8b7256dbb
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/711611
Reviewed-on: http://git-master/r/729042
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix return value check
Igor Nabirushkin [Sat, 14 Feb 2015 21:08:11 +0000]
misc: tegra-profiler: fix return value check

Tegra System Profiler: device is frozen when using clk events.
Fix return value check.

Bug 1611412

Change-Id: Ic9da6f02b222aaf0b3e5e84156103be39a28168b
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/708066
Reviewed-on: http://git-master/r/729041
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: support debug frame sections
Igor Nabirushkin [Fri, 13 Feb 2015 19:21:22 +0000]
misc: tegra-profiler: support debug frame sections

DWARF unwinding: support debug frame sections (AArch32/AArch64).

Bug 1611073

Change-Id: Ia7a01c61843d35d8c5466623be7d8e44fc70f5a1
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/707910
Reviewed-on: http://git-master/r/729032
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: support eh_frame sections
Igor Nabirushkin [Fri, 13 Feb 2015 17:35:02 +0000]
misc: tegra-profiler: support eh_frame sections

Support dwarf unwinding for arm32 files (based on
eh_frame sections).

Bug 1611069

Change-Id: Ie057ebcfcff75ccb2d3e62aa7cb85ac4b090930c
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/707903
Reviewed-on: http://git-master/r/729031
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix debug preempt warnings
Igor Nabirushkin [Mon, 29 Dec 2014 08:16:30 +0000]
misc: tegra-profiler: fix debug preempt warnings

Tegra Profiler: fix warnings with CONFIG_DEBUG_PREEMPT=y

* Add the missing preempt_disable/enable() pairs in start/stop ioctls.
* Untie mmap and some other samples from the current cpu.

Bug 200067410

Change-Id: I9f03facf3a0ecee20432019ea8094a349c7897d1
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/668123
Reviewed-on: http://git-master/r/673171
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix sparse warnings
Igor Nabirushkin [Sun, 7 Dec 2014 12:26:34 +0000]
misc: tegra-profiler: fix sparse warnings

Tegra Profiler: fix sparse static warnings.

Bug 1587428

Change-Id: Ic07b4d6247a506109144ceb1b7401f25373d2137
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/660600
(cherry picked from commit c197f471258f8eb99aa1402ec3a1144b1b34dd65)
Reviewed-on: http://git-master/r/663744
Reviewed-on: http://git-master/r/668222
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix vsp increment
Igor Nabirushkin [Tue, 2 Dec 2014 11:48:47 +0000]
misc: tegra-profiler: fix vsp increment

Decode the unwinding instructions (AArch32): fix incorrect
increment of virtual stack pointer (vsp).

Bug 1584541

Change-Id: I4ec64eb21a758b9283df9e6bd6b87a0555180eab
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/658441
(cherry picked from commit c963ce2532586098ddae159d19a2e241fc25cd1a)
Reviewed-on: http://git-master/r/663742
Reviewed-on: http://git-master/r/668221
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agotegra-profiler: record offset of the stack pointer
Igor Nabirushkin [Tue, 2 Dec 2014 11:23:26 +0000]
tegra-profiler: record offset of the stack pointer

Tegra Profiler: when collecting backtraces, record
remaining data stack size.

Bug 1584533

Change-Id: I608ab73f8e1b7da84221a17a782080fdf5598111
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/658431
(cherry picked from commit 803c1a41e9b7ebcbf297bd7ce5caeed1d1f800ce)
Reviewed-on: http://git-master/r/663741
Reviewed-on: http://git-master/r/668220
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add Cortex-A57 events
Igor Nabirushkin [Mon, 24 Nov 2014 17:54:38 +0000]
misc: tegra-profiler: add Cortex-A57 events

Tegra Profiler: add ARMv8 Cortex-A57 specific pmu events.

Bug 1582354

Change-Id: I72b1e1ccea3d455d91492cb6ad8538f2405c3937
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/654818
(cherry picked from commit 0d4bbf2c837461aa1571d242be80907fbad14482)
Reviewed-on: http://git-master/r/663740
Reviewed-on: http://git-master/r/668219
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add lower bound of memory
Igor Nabirushkin [Wed, 5 Nov 2014 17:10:43 +0000]
misc: tegra-profiler: add lower bound of memory

Tegra Profiler: add lower bound of memory for unwinding.

Bug 1574379

Change-Id: Ia3c412caa0c2adfe603c08b3916bd57f3ea14255
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/594457
Reviewed-on: http://git-master/r/654604
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: use mmap for samples
Igor Nabirushkin [Sun, 19 Oct 2014 20:22:32 +0000]
misc: tegra-profiler: use mmap for samples

Tegra Profiler: send samples via memory mapping areas
to the user space.

Bug 1566270

Change-Id: I19aae4ca1f8d6a3ae7c36e99fb018d8fcd2152d3
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/559124
Reviewed-on: http://git-master/r/654603
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix build warnings
Igor Nabirushkin [Tue, 7 Oct 2014 05:10:31 +0000]
misc: tegra-profiler: fix build warnings

Fix build warnings for Tegra Profiler.

Bug 1562287

Change-Id: I3bab0fdea33a217a8f13284329e6edec9fe35c50
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
(cherry picked from commit 27796155c4a7d33878c0c82c955d6c467d162651)
Reviewed-on: http://git-master/r/594163
Reviewed-on: http://git-master/r/654602
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: enable Werror flag
Igor Nabirushkin [Sun, 28 Sep 2014 20:40:57 +0000]
misc: tegra-profiler: enable Werror flag

Bug 1559160

Change-Id: I73fcaed4f6fb97d2dce6efe16573c5b90c82fde0
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/542493
(cherry picked from commit bbb307ed7ce749dc7425a50b45c5db773067362a)
Reviewed-on: http://git-master/r/594159
Reviewed-on: http://git-master/r/654601
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix broken call chains
Igor Nabirushkin [Mon, 1 Sep 2014 20:23:11 +0000]
misc: tegra-profiler: fix broken call chains

Dwarf unwinding on AArch64: fix broken call chains
for some types of functions.

Bug 1549713

Change-Id: Ia3d51723f6381befe01481a5d4d3b4041ad7b411
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/494632
(cherry picked from commit ec10a69ec9999ff7937a520caa9e562c38b826c6)
Reviewed-on: http://git-master/r/594146
Reviewed-on: http://git-master/r/654600
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: support dwarf unwinding
Igor Nabirushkin [Fri, 22 Aug 2014 15:46:15 +0000]
misc: tegra-profiler: support dwarf unwinding

Add implementation of a dwarf unwinding for AArch64.

Bug 1465331

Change-Id: I1ff0c5411fe63ea5b7291c53c1d5a1d1cde59c25
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/486989
(cherry picked from commit f00783180ee09c5698463a39bed62c08ef17802a)
Reviewed-on: http://git-master/r/594142
Reviewed-on: http://git-master/r/654599
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix copy_to_user fails
Igor Nabirushkin [Tue, 19 Aug 2014 19:13:41 +0000]
misc: tegra-profiler: fix copy_to_user fails

Do not use copy_to_user while holding a spinlock, it is not safely.
This patch fixes tegra_profiler_test fails on Android L.

Bug 1543109
Bug 1545325

Change-Id: I282f491e86de97defadd841a939ff0679ffad47a
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/482176
(cherry picked from commit 5ac6bc186cdff3efd0d71881dd510a85d3ffc629)
Reviewed-on: http://git-master/r/729023
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix Coverity issue of NULL dereference
Deepak Nibade [Fri, 25 Jul 2014 07:05:45 +0000]
misc: tegra-profiler: fix Coverity issue of NULL dereference

Pointer "pt_regs *regs" is first dereferenced and then checked for NULL
To fix this move NULL checking to beginning of function
Coverity id : 26686

Bug 1416640

Change-Id: I40e97e38e5a61a5d77ea68fa511e996f24385cfc
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/447532
(cherry picked from commit 4651be4faa111a0ff64a924889b69ec56ae19ace)
Reviewed-on: http://git-master/r/594136
Reviewed-on: http://git-master/r/654597
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: rd_alloc
Shu Zhong [Tue, 1 Jul 2014 17:25:57 +0000]
misc: tegra-profiler: rd_alloc

quadd_unwind_start calls rd_alloc while holding a spinlock.
This is dangerous because rd_alloc allocates memory with
the GFP_KERNEL flag. This fix simply moves rd_alloc outside
the critical section.

Bug 1529894

Change-Id: I284e72d2fdd9089428d75f3c3efb79513a897b7e
Signed-off-by: Shu Zhong <shuz@nvidia.com>
Reviewed-on: http://git-master/r/433264
(cherry picked from commit e29a862f449b3f1831410162c4360041438017dc)
Reviewed-on: http://git-master/r/594134
Reviewed-on: http://git-master/r/654596
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix backtraces for 64-bit
Igor Nabirushkin [Tue, 24 Jun 2014 13:07:53 +0000]
misc: tegra-profiler: fix backtraces for 64-bit

* Fix backtraces for 64-bit programs
* Also, allow user to use any frequency in range [100 Hz; 100 kHz]

Bug 1527404

Change-Id: I29495ddd1449e59b354ac00d4112bdf7b9845375
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/427738
(cherry picked from commit b4f84b60177750214ddac24c63c2f9a08b15ce05)
Reviewed-on: http://git-master/r/434898
Reviewed-on: http://git-master/r/654595
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add time source option
Igor Nabirushkin [Tue, 24 Jun 2014 08:18:29 +0000]
misc: tegra-profiler: add time source option

* Add time source option (CNTVCT or kernel monotonic clock).
* Do not use arch timer if user does not have direct access to
  CNTVCT register.

Bug 1508327

Change-Id: I0efc619146c1256ac57120b8646ecd8e819a1315
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/427620
(cherry picked from commit 5e375e6dbca8211bb2af04bd25d5e5d66371aa4f)
Reviewed-on: http://git-master/r/434897
Reviewed-on: http://git-master/r/654594
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: mixed backtraces
Igor Nabirushkin [Thu, 5 Jun 2014 07:57:52 +0000]
misc: tegra-profiler: mixed backtraces

Unwinding: switch from code with frame pointers to code
with unwind tables.

Bug 1487488

Change-Id: I254a8fd762b5312f854db1fe79635a2b419091f0
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/419384
(cherry picked from commit 79aede1e667170d0479302b6690cdd666d10960e)
Reviewed-on: http://git-master/r/434888
Reviewed-on: http://git-master/r/654593
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add sched samples
Igor Nabirushkin [Thu, 5 Jun 2014 07:08:55 +0000]
misc: tegra-profiler: add sched samples

Tegra Profiler: capture task starting being scheduled on a core.
Add sched in/out samples.

Bug 1520808

Change-Id: I2c62e5c1918bdba0fc997d79d8aeb3b7b63530f0
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/419352
(cherry picked from commit 662031c6aee9dedb05e4b5cb12aabf3ea001337f)
Reviewed-on: http://git-master/r/434887
Reviewed-on: http://git-master/r/654592
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: use cntvct as time source
Igor Nabirushkin [Thu, 5 Jun 2014 05:52:29 +0000]
misc: tegra-profiler: use cntvct as time source

Tegra Profiler: use Virtual Count register (CNTVCT) as
time source.

Bug 1508327

Change-Id: If37e2dbe0a256ec28575d7c1b7d601d6bc1090f5
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/419305
(cherry picked from commit 2e5fe3f706a404a087e110a9289818dd6c855c15)
Reviewed-on: http://git-master/r/434886
Reviewed-on: http://git-master/r/654591
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: get perfmon extension
Igor Nabirushkin [Thu, 5 Jun 2014 05:10:47 +0000]
misc: tegra-profiler: get perfmon extension

Add version of the ARMv8 NVIDIA perfmon extension to
device capabilities.

Bug 1520757

Change-Id: I18d10133272a10e3faf5022b4579c7dfea78791e
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/419274
(cherry picked from commit 1973fe595ad0fc5ec45e65df3c70ffbeaac94e7e)
Reviewed-on: http://git-master/r/434885
Reviewed-on: http://git-master/r/654590
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix hang up bug for Norrin
Igor Nabirushkin [Mon, 19 May 2014 12:49:19 +0000]
misc: tegra-profiler: fix hang up bug for Norrin

Do not use probe_kernel_address.
Actually, it is not safe on Norrin: this can lead to system crash.

Bug 200005974
Bug 1522252

Change-Id: If8bae9afd7c7e1bbb5beaf430c0c61f552aeb036
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/411507
(cherry picked from commit 6c6b72dcf09a127d05082bab65b172a77bb56f45)
Reviewed-on: http://git-master/r/434883
Reviewed-on: http://git-master/r/654589
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: add unwind information
Igor Nabirushkin [Fri, 16 May 2014 08:49:15 +0000]
misc: tegra-profiler: add unwind information

Tegra Profiler: add additional unwind information
for each call entry.

Bug 1514626

Change-Id: I2873941a4c903e0e7e909897ead55eb34d80b966
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/410770
(cherry picked from commit c240aead0cc500c3bd8ef668d93e7b44acd3310c)
Reviewed-on: http://git-master/r/434882
Reviewed-on: http://git-master/r/654588
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fixed recursive call chains
Igor Nabirushkin [Fri, 16 May 2014 08:05:36 +0000]
misc: tegra-profiler: fixed recursive call chains

In some cases, recursive call chains can be broken.
This patch fixes this problem.

Bug 200005395

Change-Id: I7d31ec64b004109c3684cf0d143d9b1d6cd59f9f
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/410745
(cherry picked from commit 0f2d2d582d5907a51a2f32e9d1c0fa50b9f59601)
Reviewed-on: http://git-master/r/434881
Reviewed-on: http://git-master/r/654587
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: support too deep stack level
Igor Nabirushkin [Fri, 16 May 2014 07:24:50 +0000]
misc: tegra-profiler: support too deep stack level

Too deep stack level: handle it properly.
Appropriate unwind reason code has been added.

Unwinding based on frame pointers: add unwind reason codes.

Bug 200005380

Change-Id: I2199df90c746ada6a7f224a8b675638b69dc6da8
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/410717
(cherry picked from commit e96cd9adf0ca020c55545925168671373a67a009)
Reviewed-on: http://git-master/r/434880
Reviewed-on: http://git-master/r/654586
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix setup bug
Igor Nabirushkin [Fri, 16 May 2014 06:44:06 +0000]
misc: tegra-profiler: fix setup bug

* Fix bug that happens when using non-standard profiling frequencies
* Allow root user to use any frequency in range [100 Hz; 100 kHz]

Bug 200005366

Change-Id: I9a07e2c9c1fec6d61f34009d1975ea7f5d0e2592
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/410705
(cherry picked from commit baa22c2e4e7b1f676fec2456907c8f8ce43c6c03)
Reviewed-on: http://git-master/r/434878
Reviewed-on: http://git-master/r/654585
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix resource leaks
Deepak Nibade [Mon, 19 May 2014 10:18:02 +0000]
misc: tegra-profiler: fix resource leaks

Fix Coverity issue of resource leaks
Coverity id : 26481
Coverity id : 26483

Bug 1416640

Change-Id: Ib71950f196b5421ccbc21b3ac8d620e790e83366
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/411421
(cherry picked from commit 4449c4508c2619f2e21c2965c97605d69284ab0c)
Reviewed-on: http://git-master/r/434876
Reviewed-on: http://git-master/r/654584
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agotegra-profiler: add access to the exception tables
Igor Nabirushkin [Tue, 6 May 2014 05:47:02 +0000]
tegra-profiler: add access to the exception tables

Tegra Profiler: add access to the exception tables via mmap areas.
Do not read directly from the user space.

Bug 200002243

Change-Id: I442daaecb11fd4416b3e485722efdf34234e0241
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/405671
(cherry picked from commit eb721f5af416f14aacf5589c4403c7b6a0b0b5fb)
Reviewed-on: http://git-master/r/434875
Reviewed-on: http://git-master/r/654583
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: unwinding: use RCU locking
Igor Nabirushkin [Thu, 17 Apr 2014 09:02:07 +0000]
misc: tegra-profiler: unwinding: use RCU locking

Unwinding: use RCU locking instead of spinlocks to protect
map of regions.

Bug 1502205

Change-Id: If1089b74b1f317eeaae5059de40d7a3365ae4061
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/397599
(cherry picked from commit 3504dc62f0aad25ad5c50f46c6c3319b95775966)
Reviewed-on: http://git-master/r/434874
Reviewed-on: http://git-master/r/398058
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoRevert "tegra-profiler: fix copy_to_user fails"
Igor Nabirushkin [Wed, 8 Apr 2015 10:55:22 +0000]
Revert "tegra-profiler: fix copy_to_user fails"

This reverts commit b339234adf50923e361472ae364a04ba3c981225.
Rollback of this commit, which was applied out of order.

Bug 1543109
Bug 1545325

Change-Id: I23a3f20b757f503123c08f30f9a83ba018942a81
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/728987
GVS: Gerrit_Virtual_Submit
Tested-by: Maxim Morin <mmorin@nvidia.com>
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoasoc: tegra: mark speaker for event
Lei Fan [Mon, 13 Apr 2015 08:58:13 +0000]
asoc: tegra: mark speaker for event

mark speaker as disconnected when it is disabled

Bug 200092998

Change-Id: I306884be9c156d293d1705cb14e6777c731126a1
Signed-off-by: Lei Fan <leif@nvidia.com>
Reviewed-on: http://git-master/r/730748
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoasoc: tegra: enable Tfa9887 at once
Lei Fan [Mon, 13 Apr 2015 06:14:13 +0000]
asoc: tegra: enable Tfa9887 at once

Tfa9887 will not be opened at the first reference due to reference
count. So speaker cannot be enabled until the next usage.
It can be fixed by increasing the reference count in advance

Bug 200090871
Bug 200092982

Change-Id: I25bb239f74e22c6310bd9b13ceaba9371a52b34e
Signed-off-by: Lei Fan <leif@nvidia.com>
Reviewed-on: http://git-master/r/730694
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoSELinux: include definition of new capabilities
Eric Paris [Fri, 6 Jul 2012 18:13:29 +0000]
SELinux: include definition of new capabilities

The kernel has added CAP_WAKE_ALARM and CAP_EPOLLWAKEUP.  We need to
define these in SELinux so they can be mediated by policy.

Bug 200091249

Change-Id: I8a3e0db15ec5f4eb05d455a57e8446a8c2b484c2
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
[sds: rename epollwakeup to block_suspend to match upstream merge]
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Rick Song <ricks@nvidia.com>
Reviewed-on: http://git-master/r/728820
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoARM: tegra: roth enable E2542 debug board
Martin Chi [Wed, 8 Apr 2015 08:40:30 +0000]
ARM: tegra: roth enable E2542 debug board

if debug uart is set to 5, just mux sdcard mmc pins to UART-A.

Change-Id: I697ce3629b17a481fb52f4218c888ff8cf25c22f
(cherry pick from commit 637cad50a2d4f38bdc1aaf1e067f2eff14060b48)
Signed-off-by: David Pu <dpu@nvidia.com>
Reviewed-on: http://git-master/r/338732
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/727881
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agoPower: pmqos: Add emc freq pmqos constraint
Puneet Saxena [Mon, 27 Jan 2014 11:00:29 +0000]
Power: pmqos: Add emc freq pmqos constraint

It adds min emc freq pmqos.

Bug 1432476
Bug 200060679
Bug 200060926
Bug 200061236
Bug 1626496

Change-Id: If05c2e8cceffc9ca071ed0b023c29e1ef2921245
Reviewed-on: http://git-master/r/360379
(cherry picked from commit 37a301258e7f7de4da5aea0e2942cd9e890e895a)
Reviewed-on: http://git-master/r/668694
(cherry picked from commit 2c5736541dd44018072ed3ca07f29a71dd02acf8)
Signed-off-by: Nathan Zhang <nathanz@nvidia.com>
Reviewed-on: http://git-master/r/726886
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agoPM QoS: Add GPU frequency limits to PM QoS
Alex Frid [Tue, 23 Jul 2013 04:26:11 +0000]
PM QoS: Add GPU frequency limits to PM QoS

Added GPU frequency min/max as PM QoS classes.

Bug 1330780
Bug 200060679
Bug 200060926
Bug 200061236
Bug 1626496

Change-Id: I099dc24ebdad970f62a1a5275dc18e50768bc745
Reviewed-on: http://git-master/r/267702
(cherry picked from commit d8d88882a9d43369b6b677a50ee2277dcd6f6d39)
Reviewed-on: http://git-master/r/339689
(cherry picked from commit 58bf40ca43d8ac629922be6eb1c1cc5addcabb1a)
Signed-off-by: Nathan Zhang <nathanz@nvidia.com>
Reviewed-on: http://git-master/r/726885
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agomisc: tegra-profiler: fix copy_to_user fails
Igor Nabirushkin [Tue, 19 Aug 2014 19:13:41 +0000]
misc: tegra-profiler: fix copy_to_user fails

Do not use copy_to_user while holding a spinlock, it is not safely.
This patch fixes tegra_profiler_test fails on Android L.

Bug 1543109
Bug 1545325
Bug 1561782
Bug 200093006

Change-Id: Iea7b89d879e1f3a003cd26e06bf6c4dea0b7b1dc
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/482176
(cherry picked from commit 5ac6bc186cdff3efd0d71881dd510a85d3ffc629)
Reviewed-on: http://git-master/r/593509
Signed-off-by: Nine Feng <nfeng@nvidia.com>
Reviewed-on: http://git-master/r/654598
Reviewed-by: Ximing Chen <ximingc@nvidia.com>
Tested-by: Ximing Chen <ximingc@nvidia.com>

3 years agonet: wireless: bcmdhd: enable TDLS
Om Prakash Singh [Mon, 13 Oct 2014 06:19:06 +0000]
net: wireless: bcmdhd: enable TDLS

Bug 1533863

Change-Id: I5cca6148513bcea1087c699484b2e69a38bbd26c
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Signed-off-by: Lucas Dai <lucasd@nvidia.com>
Reviewed-on: http://git-master/r/555860
Reviewed-on: http://git-master/r/724031
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ximing Chen <ximingc@nvidia.com>

3 years agosound: Add blacklist for audio devices
Jun Yan [Tue, 25 Mar 2014 02:10:32 +0000]
sound: Add blacklist for audio devices

Prevent specified audio devices from sending
uevents upon connection/disconnection.

Bug 1474213

Change-Id: I532968ed9717dc18db62671deedd60bb4a38463e
Signed-off-by: Jun Yan <juyan@nvidia.com>
Reviewed-on: http://git-master/r/385931
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Pierre Gervais <pgervais@nvidia.com>
(cherry picked from commit 553636416a0700b354385d7a508d67653814272d)
Reviewed-on: http://git-master/r/449065
Reviewed-by: Jason Roche <jroche@nvidia.com>
Tested-by: Anshul Jain (SW) <anshulj@nvidia.com>
Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com>
(cherry picked from commit 282fa8e2055eea1364b5864b0b997f30890107f8)
Reviewed-on: http://git-master/r/712724
Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com>
Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>

3 years agoHID: usbhid: set interface data null
Vinayak Pane [Sat, 5 Jul 2014 02:08:07 +0000]
HID: usbhid: set interface data null

Set USB interface data to null at disconnect.

Bug 200018305
Bug 200024051

Change-Id: I65aec8c97f674faef0ebd9ed5916f28e22604da6
Signed-off-by: Vinayak Pane <vpane@nvidia.com>
Reviewed-on: http://git-master/r/448304
Tested-by: Yunfan Zhang <yunfanz@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sang-Hun Lee <sanlee@nvidia.com>
Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com>

3 years agoarm:tegra:thor: Set dc to stop on hdmi close
David Dastous [Fri, 25 Jul 2014 19:47:01 +0000]
arm:tegra:thor: Set dc to stop on hdmi close

HDMI needs to set DC to stop when closing, otherwise there is a flicker
upon shutdown

Bug 1448296

Change-Id: I93d14517e2b2ec77b0a6730a5c40930cd71f4327
Signed-off-by: David Dastous <ddastoussthi@nvidia.com>
Reviewed-on: http://git-master/r/447733
(cherry picked from commit 6971c4be6bbf07ded3c7d35e60e0ffaf7fccef5)
Reviewed-on: http://git-master/r/709524
GVS: Gerrit_Virtual_Submit
Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com>

3 years agoarm:tegra:thor: Sound debug print fix
David Dastous [Wed, 30 Jul 2014 22:31:49 +0000]
arm:tegra:thor: Sound debug print fix

Debugging message should be listed under snd_printdd

Bug 200020654

Change-Id: I934d4de870e38dff80bf1d0731e9f66d8e39812b
Signed-off-by: David Dastous <ddastoussthi@nvidia.com>
Reviewed-on: http://git-master/r/449022
(cherry picked from commit 18f5872d2168a0671a78d5a460600e3a777af11d)
Reviewed-on: http://git-master/r/709522
GVS: Gerrit_Virtual_Submit
Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com>

4 years agoarch: arm: roth: fix dsi panel timings
Ivan Raul Guadarrama [Wed, 7 Jan 2015 13:48:52 +0000]
arch: arm: roth: fix dsi panel timings

Fix the dsi panel timings to match datasheet
requirements and provide 60.00 Hz refresh rate.

Bug 1562375

Change-Id: I6d62f7d8117842a375122ef8c5ab9e2eb3a02fd7
Signed-off-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Reviewed-on: http://git-master/r/670247
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Lars Bishop <lbishop@nvidia.com>

4 years agobcmdhd: ensure work completion before freeing
Sang-Hun Lee [Wed, 30 Jul 2014 00:53:48 +0000]
bcmdhd: ensure work completion before freeing

Problem description:
 - wl_dealloc_netinfo would free allocated wireless_dev structures, which has
   work_struct for wdev_cleanup_work
 - If there is any job scheduled for wdev_cleanup_work and if it
   is scheduled after kfree of its parent struct, the result is undefined
 - But simply waiting for wdev_cleanup_work completion in
   wl_cfg80211_netdev_notifier_call would result in a dead lock, as wdev_cleanup_work
   and cfg80211_event_work both use the same workqueue. cfg80211_event_work
   may ultimately call wl_cfg80211_netdev_notifier_call

Fix description:
 - Separate the detach of an interface from the deallocation of an interface
 - Upon a detach, only remove the interface, and schedule a deallocation of it

Bug 1533639

Change-Id: I865907243ac370ab5932fb1d5ec7ce8c83279baf
Signed-off-by: Sang-Hun Lee <sanlee@nvidia.com>
Reviewed-on: http://git-master/r/448637
Reviewed-on: http://git-master/r/453624
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-by: Raymond Poudrier <rapoudrier@nvidia.com>