]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/log
hercules2020/nv-tegra/linux-4.4.git
4 years agoFix memguard and related syscalls tx2-joel
Michal Sojka [Thu, 9 Apr 2020 09:35:25 +0000 (11:35 +0200)]
Fix memguard and related syscalls

Previous commit set them as not-implemented (sys_ni_syscall).

4 years agoComment out IRQ disable/enable system calls
Michal Sojka [Tue, 7 Apr 2020 16:57:05 +0000 (18:57 +0200)]
Comment out IRQ disable/enable system calls

These are too dangerous. If called unintentionally, the can lock up
the whole system.

4 years agoMove our PREM-related system calls to a separate .c file
Michal Sojka [Tue, 7 Apr 2020 16:52:29 +0000 (18:52 +0200)]
Move our PREM-related system calls to a separate .c file

This has several advantages:
1. When we change the implementation of these system calls, the whole
   kernel does not get recompiled.
2. If we comment out the function completely, we will end up with
   -ENOSYS thanks to cond_syscall.

5 years agoNew memguard hypercall
Joel Matejka [Thu, 25 Oct 2018 08:48:01 +0000 (10:48 +0200)]
New memguard hypercall

5 years agoAdd syscall prem_guard_set for calling the hypervisor prem
Michal Sojka [Sat, 26 May 2018 11:05:50 +0000 (13:05 +0200)]
Add syscall prem_guard_set for calling the hypervisor

5 years agoAdd PREM-related syscalls
Michal Sojka [Sat, 26 May 2018 10:39:37 +0000 (12:39 +0200)]
Add PREM-related syscalls

These are the changes made by Joel for his experiments. I stole them
from his repo on grid :)

6 years agoarm64: config: Enable CDC-ACM driver in kernel l4t/l4t-r28.2
Wayne Wang [Wed, 21 Feb 2018 09:36:52 +0000 (17:36 +0800)]
arm64: config: Enable CDC-ACM driver in kernel

Enable ACM driver in tegra18_defconfig and tegra21_defconfig.

CONFIG_USB_ACM=y

Bug 200389284

Change-Id: I9029068c59184cd41471f460444a0cdc40eab841
Signed-off-by: Wayne Wang <waywang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1663977
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>
6 years agovideo: fbmon: fix HDMI 1.4 VSDB parsing logic
Santosh Reddy Galma [Thu, 8 Feb 2018 14:05:40 +0000 (19:35 +0530)]
video: fbmon: fix HDMI 1.4 VSDB parsing logic

- Currently HDMI 1.4 LLC VSDB CEA extension block
parsing is done unconditionally without checking
for length of block in header, HDMI_Video_Present
field needed for HDMI ext modes resulting in junk
fields populated from other CEA extension blocks.
- Minimum length of HDMI 1.4 VSDB is "5" as per spec
- This change parses extension fields in HDMI 1.4 VSDB
based on length specified in header.
- Also, this change also parses HDMI_EXT modes only
when HDMI_Video_Present field is set in extension field.

Bug 2045877

Change-Id: I4ccc87c822fa76beb076070073fe6eb88633e67a
Signed-off-by: Santosh Reddy Galma <galmar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1654337
(cherry picked from commit 90441f34df0ee30b880c60c1773df0e806ec0659)
Reviewed-on: https://git-master.nvidia.com/r/1659804
Reviewed-by: Naveen Kumar S <nkumars@nvidia.com>
Tested-by: Naveen Kumar S <nkumars@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
6 years agopacket: Do not call fanout_release from atomic contexts
Anoob Soman [Wed, 15 Feb 2017 20:25:39 +0000 (20:25 +0000)]
packet: Do not call fanout_release from atomic contexts

[ Upstream commit 2bd624b4611ffee36422782d16e1c944d1351e98 ]

Commit 6664498280cf ("packet: call fanout_release, while UNREGISTERING a
netdev"), unfortunately, introduced the following issues.

1. calling mutex_lock(&fanout_mutex) (fanout_release()) from inside
rcu_read-side critical section. rcu_read_lock disables preemption, most often,
which prohibits calling sleeping functions.

[  ] include/linux/rcupdate.h:560 Illegal context switch in RCU read-side critical section!
[  ]
[  ] rcu_scheduler_active = 1, debug_locks = 0
[  ] 4 locks held by ovs-vswitchd/1969:
[  ]  #0:  (cb_lock){++++++}, at: [<ffffffff8158a6c9>] genl_rcv+0x19/0x40
[  ]  #1:  (ovs_mutex){+.+.+.}, at: [<ffffffffa04878ca>] ovs_vport_cmd_del+0x4a/0x100 [openvswitch]
[  ]  #2:  (rtnl_mutex){+.+.+.}, at: [<ffffffff81564157>] rtnl_lock+0x17/0x20
[  ]  #3:  (rcu_read_lock){......}, at: [<ffffffff81614165>] packet_notifier+0x5/0x3f0
[  ]
[  ] Call Trace:
[  ]  [<ffffffff813770c1>] dump_stack+0x85/0xc4
[  ]  [<ffffffff810c9077>] lockdep_rcu_suspicious+0x107/0x110
[  ]  [<ffffffff810a2da7>] ___might_sleep+0x57/0x210
[  ]  [<ffffffff810a2fd0>] __might_sleep+0x70/0x90
[  ]  [<ffffffff8162e80c>] mutex_lock_nested+0x3c/0x3a0
[  ]  [<ffffffff810de93f>] ? vprintk_default+0x1f/0x30
[  ]  [<ffffffff81186e88>] ? printk+0x4d/0x4f
[  ]  [<ffffffff816106dd>] fanout_release+0x1d/0xe0
[  ]  [<ffffffff81614459>] packet_notifier+0x2f9/0x3f0

2. calling mutex_lock(&fanout_mutex) inside spin_lock(&po->bind_lock).
"sleeping function called from invalid context"

[  ] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
[  ] in_atomic(): 1, irqs_disabled(): 0, pid: 1969, name: ovs-vswitchd
[  ] INFO: lockdep is turned off.
[  ] Call Trace:
[  ]  [<ffffffff813770c1>] dump_stack+0x85/0xc4
[  ]  [<ffffffff810a2f52>] ___might_sleep+0x202/0x210
[  ]  [<ffffffff810a2fd0>] __might_sleep+0x70/0x90
[  ]  [<ffffffff8162e80c>] mutex_lock_nested+0x3c/0x3a0
[  ]  [<ffffffff816106dd>] fanout_release+0x1d/0xe0
[  ]  [<ffffffff81614459>] packet_notifier+0x2f9/0x3f0

3. calling dev_remove_pack(&fanout->prot_hook), from inside
spin_lock(&po->bind_lock) or rcu_read-side critical-section. dev_remove_pack()
-> synchronize_net(), which might sleep.

[  ] BUG: scheduling while atomic: ovs-vswitchd/1969/0x00000002
[  ] INFO: lockdep is turned off.
[  ] Call Trace:
[  ]  [<ffffffff813770c1>] dump_stack+0x85/0xc4
[  ]  [<ffffffff81186274>] __schedule_bug+0x64/0x73
[  ]  [<ffffffff8162b8cb>] __schedule+0x6b/0xd10
[  ]  [<ffffffff8162c5db>] schedule+0x6b/0x80
[  ]  [<ffffffff81630b1d>] schedule_timeout+0x38d/0x410
[  ]  [<ffffffff810ea3fd>] synchronize_sched_expedited+0x53d/0x810
[  ]  [<ffffffff810ea6de>] synchronize_rcu_expedited+0xe/0x10
[  ]  [<ffffffff8154eab5>] synchronize_net+0x35/0x50
[  ]  [<ffffffff8154eae3>] dev_remove_pack+0x13/0x20
[  ]  [<ffffffff8161077e>] fanout_release+0xbe/0xe0
[  ]  [<ffffffff81614459>] packet_notifier+0x2f9/0x3f0

4. fanout_release() races with calls from different CPU.

To fix the above problems, remove the call to fanout_release() under
rcu_read_lock(). Instead, call __dev_remove_pack(&fanout->prot_hook) and
netdev_run_todo will be happy that &dev->ptype_specific list is empty. In order
to achieve this, I moved dev_{add,remove}_pack() out of fanout_{add,release} to
__fanout_{link,unlink}. So, call to {,__}unregister_prot_hook() will make sure
fanout->prot_hook is removed as well.

Bug 200389571

Change-Id: I5a4fbe7ca16180eede8ddeba6948f0f1c855edc4
Fixes: 6664498280cf ("packet: call fanout_release, while UNREGISTERING a netdev")
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Anoob Soman <anoob.soman@citrix.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1660655
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Dipen Patel <dipenp@nvidia.com>
6 years agodrivers: speculative load before bound-check
James Huang [Fri, 2 Feb 2018 02:51:20 +0000 (10:51 +0800)]
drivers: speculative load before bound-check

Data can be speculatively loaded from memory and stay in cache even
when bound check fails. This can lead to unintended information
disclosure via side-channel analysis.

To mitigate this problem, insert speculation barrier.

Bug 1964290
Bug 1975133
CVE-2017-5753

Change-Id: I69ce0633516b3a838cf2547adcff4ded806394e0
Signed-off-by: Hien Goi <hgoi@nvidia.com>
Signed-off-by: James Huang <jamehuang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1650789
Reviewed-by: Hayden Du <haydend@nvidia.com>
(cherry picked from commit 7541f4625b73b64e0c64b403c6182cb295fd884c)
Reviewed-on: https://git-master.nvidia.com/r/1653656
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Tested-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
6 years agodrivers: use right API to get reset reason
Sandipan Patra [Tue, 6 Feb 2018 05:02:09 +0000 (10:32 +0530)]
drivers: use right API to get reset reason

critical condition driver to use the modified API to get tegra reset reason.
Earlier the API was different and with the current version of codeline
the API name is changes in pmc.c. Hence updating cc.c driver to use
latest API.

Bug 200377085

Change-Id: Iecab4cac7ac4fab8626dd403dc8306938414fe68
Signed-off-by: Sandipan Patra <spatra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1652709
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
6 years agopmc: add sysfs entry to get tegra reset reason
Sandipan Patra [Mon, 5 Feb 2018 13:23:32 +0000 (18:53 +0530)]
pmc: add sysfs entry to get tegra reset reason

sysfs entry - /sys/kernel/pmc/reset_reason is added in readonly mode
to get tegra reset reason in user land. Invoking this will internally
access tegra_reset_reason() API in kernel space and the value is being
copied to user space.

Bug 200377085

Change-Id: I77ded2313af2375982f90c31e923e72b222a66f7
Signed-off-by: Sandipan Patra <spatra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1652710
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>
6 years agosoc: tegra-pmc: add API to show last reset status
Sandipan Patra [Mon, 5 Feb 2018 07:02:32 +0000 (12:32 +0530)]
soc: tegra-pmc: add API to show last reset status

Export "tegra_pmc_get_system_reset_reason" API to show last reset reason,
so that if other driver need to act on particular reset source,
they can act based on reset status. For example, if other driver need to do
some work if watchdog-timeout was the last reset-reason, that driver can
call this API to get the last reset status and based on reset-status,
driver can proceed further.

Bug 200377085

Change-Id: I23a7a2165889907ce287d73bd99ece83780e0204
Signed-off-by: Sandipan Patra <spatra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1652707
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
6 years agothermal: add boundary check to set_cur_state
Srikar Srimath Tirumala [Tue, 12 Sep 2017 19:27:13 +0000 (12:27 -0700)]
thermal: add boundary check to set_cur_state

Prevent sysfs from setting a cur_state that exceeds the max cur_state
of the cooling device.

Bug 200334223
Bug 200331706
Bug 1968660
Bug 1968616
Bug 1968653

Change-Id: I935be6166a9e184683abfcdce70cb08cbe4a1350
Reviewed-on: https://git-master.nvidia.com/r/1630002
Reviewed-by: Jeetesh Burman <jburman@nvidia.com>
Tested-by: Jeetesh Burman <jburman@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Signed-off-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
(cherry picked from commit 66c223caacc3dfc7110f04ffbde36b68d6941244)
Reviewed-on: https://git-master.nvidia.com/r/1652919
GVS: Gerrit_Virtual_Submit
Tested-by: Bibek Basu <bbasu@nvidia.com>
6 years agowatchdog: t21x: Remove WDT IRQ handler only once
Shreshtha SAHU [Tue, 2 Jan 2018 06:32:04 +0000 (12:02 +0530)]
watchdog: t21x: Remove WDT IRQ handler only once

WDT IRQ is requested when WDT daemon is started early
during kernel boot. WDT daemon is stopped when user
space opens /dev/watchdog and then WDT IRQ is also freed.

If user space open/close /dev/watchdog multiple times,
then WDT IRQ free is getting called each time, even though
WDT daemon was already disabled first time user space
started watchdog.

To prevent this multiple free, IRQ free is moved to driver
remove. Also when user space is taking over WDT ping, IRQ is
disabled to stop WDT daemon from pinging WDT.

Bug 1976162

Change-Id: Iae2b8f78311f1f012b4d4078100662295472f069
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1629847
(cherry picked from commit c7d7331a7cbaf0194c31a5a7de8cb4961e3df245)
Reviewed-on: https://git-master.nvidia.com/r/1651378
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>
6 years agodrivers: speculative load before bound-check
James Huang [Fri, 2 Feb 2018 04:22:57 +0000 (12:22 +0800)]
drivers: speculative load before bound-check

Data can be speculatively loaded from memory and stay in cache even
when bound check fails. This can lead to unintended information
disclosure via side-channel analysis.

To mitigate this problem, insert speculation barrier.

Bug 1964290
CVE-2017-5753

Change-Id: I7382dbcc6e9f352fafd457301beafe753925f3c4
Signed-off-by: Hien Goi <hgoi@nvidia.com>
Signed-off-by: James Huang <jamehuang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1650791
Reviewed-by: Hayden Du <haydend@nvidia.com>
(cherry picked from commit 5cabd53985a30aa818896abdb64564a74c09ab9c)
Reviewed-on: https://git-master.nvidia.com/r/1651418
Reviewed-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Tested-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
6 years agoarm64: define speculation barrier
James Huang [Thu, 1 Feb 2018 05:01:50 +0000 (13:01 +0800)]
arm64: define speculation barrier

The instruction sequency "dsb sy" followed by "isb" functions as
a speculation barrier, which prevents the instructions after that
from being speculatively executed.

bug 2039126

Change-Id: I898aab771ff82b26b08214a06814d2e6e78969a7
Signed-off-by: Bo Yan <byan@nvidia.com>
Signed-off-by: James Huang <jamehuang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1650093
Reviewed-by: Hayden Du <haydend@nvidia.com>
(cherry picked from commit f125c60045878513902cac4a084fde9a516eb3e2)
Reviewed-on: https://git-master.nvidia.com/r/1650749
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Tested-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
6 years agomedia: isc: prevent speculative load related leak
James Huang [Thu, 1 Feb 2018 03:53:29 +0000 (11:53 +0800)]
media: isc: prevent speculative load related leak

Data can be speculatively loaded from memory and stay in cache even
when bound check fails. This can lead to unintended information
disclosure via side-channel analysis.

To mitigate this problem, insert speculation barrier.

bug 2039126
CVE-2017-5753

Change-Id: I3fdea370a0c713ec84dc3fb58fb6b9891880190a
Signed-off-by: David Gilhooley <dgilhooley@nvidia.com>
Reviewed-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Signed-off-by: James Huang <jamehuang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1650059
Reviewed-by: Hayden Du <haydend@nvidia.com>
(cherry picked from commit efac96bc2e7f333211bbcb7950a2ab1559890ff0)
Reviewed-on: https://git-master.nvidia.com/r/1650748
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Tested-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
6 years agov4l2: prevent speculative load
James Huang [Thu, 1 Feb 2018 02:58:04 +0000 (10:58 +0800)]
v4l2: prevent speculative load

bug 2039126
Change-Id: Id1908c3058c9ecc0dfb4f2d85440a8d36db45db5
Signed-off-by: David Gilhooley <dgilhooley@nvidia.com>
Signed-off-by: James Huang <jamehuang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1650029
Reviewed-by: Hayden Du <haydend@nvidia.com>
(cherry picked from commit 7a0213eca150614fe88d197a09d461fff6168652)
Reviewed-on: https://git-master.nvidia.com/r/1650739
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Tested-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
6 years agocryptodev: prevent speculative load related leak
James Huang [Thu, 1 Feb 2018 02:38:00 +0000 (10:38 +0800)]
cryptodev: prevent speculative load related leak

Data can be speculatively loaded from memory and stay in cache even
when bound check fails. This can lead to unintended information
disclosure via side-channel analysis.

To mitigate this problem, insert speculation barrier.

bug 2039126
CVE-2017-5753

Change-Id: Id85eb9c91932f358dd999b28dd53d7788b37ea04
Signed-off-by: David Gilhooley <dgilhooley@nvidia.com>
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Signed-off-by: James Huang <jamehuang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1650014
Reviewed-by: Hayden Du <haydend@nvidia.com>
(cherry picked from commit 25bd9436b11f41e23048c9515deae97900a46669)
Reviewed-on: https://git-master.nvidia.com/r/1650738
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Tested-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
6 years agoplatform: nvadsp: prevent speculative load related leak
James Huang [Thu, 1 Feb 2018 01:42:30 +0000 (09:42 +0800)]
platform: nvadsp: prevent speculative load related leak

Data can be speculatively loaded from memory and stay in cache even
when bound check fails. This can lead to unintended information
disclosure via side-channel analysis.

To mitigate this problem, insert speculation barrier.

bug 2039126
CVE-2017-5753

Change-Id: I5a745320b64bf6689cf8ac4b713cf1b32f662a23
Signed-off-by: David Gilhooley <dgilhooley@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1649976
Reviewed-by: James Huang <jamehuang@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
(cherry picked from commit 53deb61791f7227f33f365d3a7f12032dc5af4f2)
Reviewed-on: https://git-master.nvidia.com/r/1650736
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Tested-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
6 years agofbcon: intialize console data on all valid VTs
Naveen Kumar S [Wed, 31 Jan 2018 07:08:37 +0000 (12:38 +0530)]
fbcon: intialize console data on all valid VTs

Need to update console parameters for graphical VTs too. This
will help in cases where a graphical client exits abruptly
without switching to a fbconsole VT. In such a case, VT owned
by graphical client is moved to fbconsole. If console data is
not initialized on that VT, fbconsole might enable display
controller with invalid/random resolution causing unexpected
behaviour.
This change updates only the console data structures of a
VT. Hence, it won't affect the graphical client in any way.

bug 200382772

Change-Id: Ie398eb5e7fae937512603c557eac7ecebbd0386c
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1649287
GVS: Gerrit_Virtual_Submit
Reviewed-by: Tow Wang <toww@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
6 years agoarm64: Add CONFIG_HARDEN_BRANCH_PREDICTOR option
Hayden Du [Thu, 25 Jan 2018 06:57:41 +0000 (14:57 +0800)]
arm64: Add CONFIG_HARDEN_BRANCH_PREDICTOR option

Aliasing attacks against CPU branch predictors can allow an attacker to
redirect speculative control flow on some CPUs and potentially divulge
information from one context to another.

This patch adds a Kconfig option to enable implementation-specific
mitigations against these attacks for CPUs that are affected. Currently,
a workaround is only implemented for Cortex-A57 and Cortex-A72, which
additionally relies on the EL3 firmware setting CPUACTLR_EL1[0] to 1.

Back ported from K4.9: https://git-master.nvidia.com/r/1621628/

Bug 1975157

Change-Id: I61a3eb3a95b48632b1306f2841683a6c179c6bb5
Signed-off-by: Hayden Du <haydend@nvidia.com>
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1645812
(cherry picked from commit 846e37e578b521fa515c9ef961e0df1d35c7685c)
Reviewed-on: https://git-master.nvidia.com/r/1649748
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Tested-by: Prabhu Kuttiyam <pkuttiyam@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
6 years agodefconfig: t186: Provide configs for GPU frequency table calculations
Rohit Vaswani [Thu, 2 Feb 2017 02:30:54 +0000 (18:30 -0800)]
defconfig: t186: Provide configs for GPU frequency table calculations

The GPU frequency table needs the configs to provide
values that are used as inputs to calculate the
frequency table in a platform independent way.
L4T needs the minimum frequency to be 140250000 and step
size to be 7 to generate the appropriate tables.

Bug 1869602
Bug 200348636

Change-Id: Ifee4e63245b51fd7ff2a119cbcc5f0918cff64e6
Signed-off-by: Rohit Vaswani <rvaswani@nvidia.com>
Reviewed-on: http://git-master/r/1297662
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit 0ba0cd3534f38cef1c053e57b3a6f5f825b46d33 in
rel-27)
Reviewed-on: https://git-master.nvidia.com/r/1645194
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Winnie Hsu <whsu@nvidia.com>
6 years agoarm64: Remove nospec_ptr() lower bounds check
David Gilhooley [Thu, 11 Jan 2018 23:28:27 +0000 (15:28 -0800)]
arm64: Remove nospec_ptr() lower bounds check

Arrays always start at 0, so remove the need
for a lower bound in nospec_ptr for easier
use.

Bug 2031795

Change-Id: I091b3a4970ffc1983800aff39dea89cf29100883
Signed-off-by: David Gilhooley <dgilhooley@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1646581
Reviewed-by: James Huang <jamehuang@nvidia.com>
Tested-by: James Huang <jamehuang@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoarm64: implement nospec_ptr()
David Gilhooley [Thu, 11 Jan 2018 23:21:03 +0000 (15:21 -0800)]
arm64: implement nospec_ptr()

This patch implements nospec_ptr() for arm64, following the recommended
architectural sequence.

Bug 2031795

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Change-Id: I8e0f67ca00ba227fceb63b42b70366d53d7ff827
Signed-off-by: David Gilhooley <dgilhooley@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1646580
Reviewed-by: James Huang <jamehuang@nvidia.com>
Tested-by: James Huang <jamehuang@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoDocumentation: document nospec helpers
Mark Rutland [Fri, 5 Jan 2018 14:57:48 +0000 (14:57 +0000)]
Documentation: document nospec helpers

Document the rationale and usage of the new nospec*() helpers.

Bug 2031795

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Change-Id: I81d5d8e74b76d55c122a1fac5433f8a47f4b421c
Signed-off-by: David Gilhooley <dgilhooley@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1646579
Reviewed-by: James Huang <jamehuang@nvidia.com>
Tested-by: James Huang <jamehuang@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoasm-generic/barrier: add generic nospec helpers
David Gilhooley [Thu, 11 Jan 2018 23:10:32 +0000 (15:10 -0800)]
asm-generic/barrier: add generic nospec helpers

Under speculation, CPUs may mis-predict branches in bounds checks. Thus,
memory accesses under a bounds check may be speculated even if the
bounds check fails, providing a primitive for building a side channel.

This patch adds helpers which can be used to inhibit the use of
out-of-bounds pointers under speculation.

A generic implementation is provided for compatibility, but does not
guarantee safety under speculation. Architectures are expected to
override these helpers as necessary.

Bug 2031795

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Daniel Willams <dan.j.williams@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Change-Id: Iee42a603b32b78c9d8ac26cef57d6eefd6e1092e
Signed-off-by: David Gilhooley <dgilhooley@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1646578
Reviewed-by: James Huang <jamehuang@nvidia.com>
Tested-by: James Huang <jamehuang@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agomisc: tegra-profiler: fix initialization failure
Igor Nabirushkin [Wed, 27 Dec 2017 11:23:21 +0000 (15:23 +0400)]
misc: tegra-profiler: fix initialization failure

Support ARMv8.1 PMUVer field of ID_AA64DFR0_EL1 register.
This commit fixes profiler initialization failure.

Bug 2040442

Change-Id: If605bfb689addb55ec90fc27a04340ba7db77f7c
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1627167
(cherry picked from commit 3954ff13b21fec4e0fad724fd2192c030c5b6a9d)
Reviewed-on: https://git-master.nvidia.com/r/1644136
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agotegra-profiler: convert spinlock to raw spinlock
Igor Nabirushkin [Mon, 25 Dec 2017 14:10:44 +0000 (18:10 +0400)]
tegra-profiler: convert spinlock to raw spinlock

Convert some locks to raw locks, this prevents preemption during
the critical sections that can lead to system crash on -rt kernels.

Bug 2038881

Change-Id: Ib845021950fd226da043177a591f1e5867047c2f
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1626108
(cherry picked from commit 19bb1c2f5734727894d0b280dc73553665a5dec0)
Reviewed-on: https://git-master.nvidia.com/r/1644135
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agomisc: tegra-profiler: change print level
Igor Nabirushkin [Mon, 4 Dec 2017 16:10:53 +0000 (20:10 +0400)]
misc: tegra-profiler: change print level

Change level of some prints from info to debug to prevent
redundant messages.

Bug 2030348

Change-Id: I482ee56f45a914cf2f5069a901d59406ecc39699
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1611122
(cherry picked from commit c93c27fbaeafadb680ba2cb52366f4aae37cfb85)
Reviewed-on: https://git-master.nvidia.com/r/1644134
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agomisc: tegra-profiler: fix system crash
Igor Nabirushkin [Thu, 23 Nov 2017 09:25:16 +0000 (12:25 +0300)]
misc: tegra-profiler: fix system crash

DWARF/ARM32 EHABI unwinding: do not free used mmap regions.
This commit fixes a possible system crash.

Bug 2030260

Change-Id: Iad9d3b5cd777511537ebb625ce0558abe3536f55
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1611121
(cherry picked from commit 3c306312d55f9b3e1da0422dd8e79bb6f29f2922)
Reviewed-on: https://git-master.nvidia.com/r/1644133
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agomisc: tegra-profiler: send virtual ids
Igor Nabirushkin [Mon, 4 Sep 2017 10:26:54 +0000 (13:26 +0300)]
misc: tegra-profiler: send virtual ids

Sched events: send virtual pid and tgid of the current
task (from the pid namespace).
This is useful for correlation between ids coming from the kernel
module with ids coming from the injection library.

Bug 1963327

Change-Id: Ie825afee503092c3cd162bc043ab6b344cd17a67
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1551258
(cherry picked from commit 0d3a3d3cf69936bc41eccec1c13998742938779c)
Reviewed-on: https://git-master.nvidia.com/r/1644132
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agomisc: tegra-profiler: fix stopping the session
Igor Nabirushkin [Thu, 3 Aug 2017 15:52:21 +0000 (18:52 +0300)]
misc: tegra-profiler: fix stopping the session

Do not stop profiling if some clocks are not available.
This commit fixes unexpected stop on some devices.

Bug 1968948

Change-Id: Ieacf481d1884ec717027aff2460be499ddf77ff8
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1532770
(cherry picked from commit abec385924a12beda1c281a1b5aa872729761d05)
Reviewed-on: https://git-master.nvidia.com/r/1644131
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agomisc: tegra-profiler: send virtual ids
Igor Nabirushkin [Sun, 23 Jul 2017 18:56:46 +0000 (21:56 +0300)]
misc: tegra-profiler: send virtual ids

Send virtual pid and tgid of the current task (from
the pid namespace).
This is useful for correlation between ids coming from the kernel
module with ids coming from the injection library.

Bug 1963327

Change-Id: I8e15a9803730ef443ada528e39116056b05157a2
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1530291
(cherry picked from commit 3114f919d190a629e55787583701225c8a9035dd)
Reviewed-on: https://git-master.nvidia.com/r/1644130
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agomisc: tegra-profiler: fix lost samples
Igor Nabirushkin [Mon, 10 Jul 2017 19:54:12 +0000 (23:54 +0400)]
misc: tegra-profiler: fix lost samples

Do not send 'header' samples for non-present cores.
This fixes lost samples in some cases.

Bug 1956713

Change-Id: Ib09aecbb71265b96840e18dcb40315adf286994f
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1516355
(cherry picked from commit 5f24b2ab8592b8c7a035abe3d9b70b3346d90126)
Reviewed-on: https://git-master.nvidia.com/r/1644129
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: vivid: Clean upstream vivid driver
Bhanu Murthy V [Wed, 24 Jan 2018 02:35:27 +0000 (18:35 -0800)]
drivers: vivid: Clean upstream vivid driver

Revert tegra specific changes in upstream vivid
driver.

Bug 2044469

Change-Id: I6eb637f57c42704e8123a11e366077934fafb298
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1644942
Reviewed-by: Ahung Cheng <ahcheng@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoconfigs: Add tegra-vivid driver config
Bhanu Murthy V [Wed, 24 Jan 2018 01:56:14 +0000 (17:56 -0800)]
configs: Add tegra-vivid driver config

Bug 2044469

Change-Id: Iaf265b1a18d32fc6762fb65b70579a23914e4d04
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1644941
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ahung Cheng <ahcheng@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agotegra-vivid: Support tegra-vivid module driver
Bhanu Murthy V [Wed, 24 Jan 2018 01:46:40 +0000 (17:46 -0800)]
tegra-vivid: Support tegra-vivid module driver

Add support for tegra vivid driver to build
under a tegra-vivid driver name to distinguish
for testing needs.

Bug 2044469

Change-Id: Ia36aab329894fc75a8b408a44eb6dab3f6467de5
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1644940
Reviewed-by: Ahung Cheng <ahcheng@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: Add tegra vivid driver
Bhanu Murthy V [Tue, 23 Jan 2018 22:07:28 +0000 (14:07 -0800)]
drivers: Add tegra vivid driver

Duplicate vivid driver with enhancements and
flow required to support tegra extensions.

Bug 2044469

Change-Id: I68789e5f37f5c69729e5a453270c1d84974d76cb
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1644939
Reviewed-by: Ahung Cheng <ahcheng@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoarm64: config: enable NVMAP_PAGE_POOLS T210 L4T
Bibek Basu [Fri, 26 Jan 2018 13:59:34 +0000 (19:29 +0530)]
arm64: config: enable NVMAP_PAGE_POOLS  T210 L4T

Enable NVMAP_PAGE_POOLS to Use page pools
to reduce allocation overhead

Bug 200384061

Change-Id: I00d7246eb2d6f70ec72336c1ffea5ba631c03090
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1646744
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: media: evaluate capture init latency
Jerry Chang [Tue, 9 Jan 2018 09:26:04 +0000 (17:26 +0800)]
drivers: media: evaluate capture init latency

- check VI driver's capture init latency
- evaluate the latency between videobuf2 queue init
  and first captured frame release to user-space
- add debug prints for SOF and EOF

Bug 200376318
Bug 2016843

Change-Id: I7cd6c6c33c12f7bdc8b36621341b0f46eecf62f8
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1634665
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agokernel: update vi4 as two thread approach
Jerry Chang [Wed, 17 Jan 2018 05:59:52 +0000 (13:59 +0800)]
kernel: update vi4 as two thread approach

improve capture init latency by two thread approach

Bug 200376318

Change-Id: I39078725ad639667c446307c575bf83e602b7b2d
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1632193
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: media: fix buffer race in two theads
Jerry Chang [Thu, 28 Dec 2017 06:02:35 +0000 (14:02 +0800)]
drivers: media: fix buffer race in two theads

- don't race on capture_state in vi2 driver
- fix vi2 intermittency MW_ACK_DONE syncpt timeout

Bug 200376318
Bug 1824878
Bug 2011290

Change-Id: I5016eff06aa60d51a1a26a3029c11ec3dc41d2c5
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1627611
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: media: camera: improve VI capture latency
Jerry Chang [Fri, 29 Dec 2017 07:19:46 +0000 (15:19 +0800)]
drivers: media: camera: improve VI capture latency

- Release frame buffer at the memory write ack event
  to improve the initial latency of the system.
- Use different sync points for tracking frame start
  and memory write done events.
- Add error recovery mechanism for both the flows.

Bug 200376318
Bug 1824878
Bug 2011290

Change-Id: Iac208619ce9ea243a7b67a074fefd7aca44f89e9
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1627610
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoarm64: tegra21: resolve docker config issue
Ninad Malwade [Thu, 18 Jan 2018 10:21:01 +0000 (18:21 +0800)]
arm64: tegra21: resolve docker config issue

CONFIG_LESS_GCC_OPT enables compiler option '-O1' which causes
crash while writing the mounted overlay filesystem.

Since overlay file system is the default used for dockers, docker
daemon crashes while writing the mounted drives using overlay FS.
Which cause docker.service to stay in activating state and never
come out of that.

By disabling CONFIG_LESS_GCC_OPT, the default optimization is now
set to '-O2' which reduces the code size further and improves the
performance. Kernel Image size is reduced around 928 Kb

Also setting the default scheduler to CFQ which is recommended for
docker and enable the CFS_BANDWIDTH config.

Bug 2033135

Change-Id: I3e167df73731b6b6d64cee1282b2bba12d9d519e
Signed-off-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1641136
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoASoC: tegra-alt: Fix audio capture/playback across suspend
Jon Hunter [Wed, 10 Jan 2018 13:28:51 +0000 (13:28 +0000)]
ASoC: tegra-alt: Fix audio capture/playback across suspend

If audio capture/playback is active when the device enters system
suspend then the sound core does not correctly suspend capture/playback
and so when the system is resumed, audio capture/playback does not
continue. The problem is that the various DAI links have the property
'ignore_suspend' set and this causes the sound core to skip suspending
any active PCM streams and hence, the DMA controller is not
stopped/paused as it should be on entering suspend or started/resumed
as it should be on exiting suspend. Fix this by removing the
'ignore_suspend' properties for the various DAI links.

Bug 200363507

Change-Id: I80cd74e3bc86532c8920bd25326a31aec7396560
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1636471
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodmaengine: tegra210-adma: Add pause/resume support
Jon Hunter [Wed, 10 Jan 2018 13:50:42 +0000 (13:50 +0000)]
dmaengine: tegra210-adma: Add pause/resume support

The tegra-alt PCM driver specifies the flags SNDRV_PCM_INFO_PAUSE and
SNDRV_PCM_INFO_RESUME which indicates that the DMA driver supports
pausing and resuming of a DMA channel. However, the ADMA driver does
not populate the pause/resume function pointers for the ADMA driver
and so when the sound core attempts to pause a DMA channel, the
channel is not paused as expected.

Given that the ADMA controller supports pausing and resuming of a DMA
transfer, populate the DMAENGINE pause/resume function pointers for
the ADMA driver.

Please note that the 'wait_for_burst_complete' parameter that was
being passed to the tegra_adma_pause() function was not being used
within the function and so this parameter has been removed. This
aligns with both the upstream and Linux v4.9 kernels that don't have
such a parameter either.

Bug 200363507

Change-Id: I72d36bb00e094ca0b1f4043cad4e22ebf535650a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1636470
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodmaengine-dma: tegra210-adma: Fix channel restoration
Jon Hunter [Wed, 10 Jan 2018 14:27:45 +0000 (14:27 +0000)]
dmaengine-dma: tegra210-adma: Fix channel restoration

The ADMA CMD register state is not saved and restored during system
suspend. This register contains the enable bit for the channel. The
sound core will pause DMA channels during suspend rather than
terminate the DMA transfer if this is supported by the DMA
controller. When an ADMA channel is paused, the enable bit in the CMD
register is still set and if suspend is entered with a channel paused
it is not re-enabled during the restoration of the channels during
the system resume. Fix this by saving and restoring the CMD register
state when suspending the ADMA controller.

Bug 200363507

Change-Id: I822b551f024e44b2a1500e0378850b09e7a1ea69
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1636469
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoEnable swp & setend emulation.
Hall Jiang [Thu, 18 Jan 2018 04:39:13 +0000 (12:39 +0800)]
Enable swp & setend emulation.

Bug 200374581

Change-Id: If4a848a27b60c875ad05cdd083e5249b4f692caa
Signed-off-by: Hall Jiang <hallj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1641725
Reviewed-by: Bruce Xu <brucex@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bo Yan <byan@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoxhci-tegra: t210: support XHCI "soft retry"
TW Chiu [Wed, 17 Jan 2018 06:56:00 +0000 (14:56 +0800)]
xhci-tegra: t210: support XHCI "soft retry"

Fix the programming sequence to disable clamp before enabling
receiver detector.

Bypass the programming for OUT EP as there is no need to do this.

Bug 2024235

Manually cherry pick this change from linux-3.10 below:
https://git-master.nvidia.com/r/#/c/1615635/

Change-Id: I2e3a649229524cf6593a92502c4583489f0a320e
Signed-off-by: TW Chiu <twchiu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1639917
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jim Lin <jilin@nvidia.com>
Reviewed-by: BH Hsieh <bhsieh@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoSanitize 'move_pages()' permission checks
Linus Torvalds [Sun, 20 Aug 2017 20:26:27 +0000 (13:26 -0700)]
Sanitize 'move_pages()' permission checks

The 'move_paghes()' system call was introduced long long ago with the
same permission checks as for sending a signal (except using
CAP_SYS_NICE instead of CAP_SYS_KILL for the overriding capability).

That turns out to not be a great choice - while the system call really
only moves physical page allocations around (and you need other
capabilities to do a lot of it), you can check the return value to map
out some the virtual address choices and defeat ASLR of a binary that
still shares your uid.

So change the access checks to the more common 'ptrace_may_access()'
model instead.

This tightens the access checks for the uid, and also effectively
changes the CAP_SYS_NICE check to CAP_SYS_PTRACE, but it's unlikely that
anybody really _uses_ this legacy system call any more (we hav ebetter
NUMA placement models these days), so I expect nobody to notice.

Famous last words.

Bug 2031795

Reported-by: Otto Ebeling <otto.ebeling@iki.fi>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Change-Id: Ifb9cf19a16fc3a9dfcc029f34b22d85f88dcc498
Reviewed-on: https://git-master.nvidia.com/r/1639134
Reviewed-by: James Huang <jamehuang@nvidia.com>
Tested-by: James Huang <jamehuang@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agox86/acpi: Prevent out of bound access caused by broken ACPI tables
Seunghun Han [Tue, 18 Jul 2017 11:03:51 +0000 (20:03 +0900)]
x86/acpi: Prevent out of bound access caused by broken ACPI tables

The bus_irq argument of mp_override_legacy_irq() is used as the index into
the isa_irq_to_gsi[] array. The bus_irq argument originates from
ACPI_MADT_TYPE_IO_APIC and ACPI_MADT_TYPE_INTERRUPT items in the ACPI
tables, but is nowhere sanity checked.

That allows broken or malicious ACPI tables to overwrite memory, which
might cause malfunction, panic or arbitrary code execution.

Add a sanity check and emit a warning when that triggers.

[ tglx: Added warning and rewrote changelog ]

Bug 2031795

Signed-off-by: Seunghun Han <kkamagui@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: security@kernel.org
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: stable@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Change-Id: I370ace5a64b80dbe18f30a0dcc5a244a4658d780
Reviewed-on: https://git-master.nvidia.com/r/1639125
Reviewed-by: James Huang <jamehuang@nvidia.com>
Tested-by: James Huang <jamehuang@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodevfreq: stop podgov polling when disabled through sysfs
Peter Boonstoppel [Thu, 18 May 2017 21:54:43 +0000 (14:54 -0700)]
devfreq: stop podgov polling when disabled through sysfs

The pod governor allows scaling to be enabled/disabled through
sysfs. In the current implementation the devfreq_monitor keeps polling
periodically even when scaling is disabled. This patch disables the
timer when scaling is disabled.

NVGPU-20
BUG 1853519

Change-Id: I6842585afec48dbc9a2fe5aee96867c68612a127
Reviewed-on: https://git-master/r/1485174
(cherry picked from commit 20ccd8da5757ddc63710f0b6dbde4cb65c0b896f)
Signed-off-by: Jon McCaffrey <jmccaffrey@nvidia.com>
Signed-off-by: Arun Kannan <akannan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1639684
Reviewed-by: Hayden Du <haydend@nvidia.com>
Tested-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agomisc: remove tegra-throughput
Anders Kugler [Wed, 5 Oct 2016 03:05:32 +0000 (20:05 -0700)]
misc: remove tegra-throughput

Removed obsolete tegra-throughput because no longer used.

TGFXP-673
NVGPU-20
bug 1853519

Change-Id: I45ccb8836aefece43dbe5b7fb38f07ce0bea5d7b
Reviewed-on: https://git-master/r/1484173
(cherry picked from commit 7bf95b79dd54381aa3f2d03b6bcdfc2dd22b970d)
Signed-off-by: Jon McCaffrey <jmccaffrey@nvidia.com>
Signed-off-by: Arun Kannan <akannan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1639680
Reviewed-by: Hayden Du <haydend@nvidia.com>
Tested-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoBluetooth: hci_uart: prevent kernel crash due to race condition
Dipen Patel [Fri, 12 Jan 2018 21:27:45 +0000 (13:27 -0800)]
Bluetooth: hci_uart: prevent kernel crash due to race condition

There is a race condition during tty close between
cancel_work_sync and hci_uart_tx_wakeup where
hci_uart_write_work may still be scheduled after call
to cancel_work_sync which causes kernel null reference
crash as hci_uart_tty_close frees the required resources

locking out hci_uart_tty_close, hci_uart_tx_wakeup and
work queue along with new flag HCI_UART_PROTO_READY
will prevent kernel crashes and race condition

Bug 200373122

Change-Id: If7c788a934ebf11a1498364db527c850a3105409
Reviewed-on: https://git-master.nvidia.com/r/1637439
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipen Patel <dipenp@nvidia.com>
Tested-by: Dipen Patel <dipenp@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agolocking: percpu-rwsem: export percpu_free_rwsem function
Dipen Patel [Fri, 12 Jan 2018 21:25:56 +0000 (13:25 -0800)]
locking: percpu-rwsem: export percpu_free_rwsem function

Export for percpu_free_rwsem function for the external modules

Bug 200373122

Change-Id: Iec66aefc264e0c1050ee1b62e4d6d64e179bb298
Reviewed-on: https://git-master.nvidia.com/r/1637438
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipen Patel <dipenp@nvidia.com>
Tested-by: Dipen Patel <dipenp@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoote_device: reduce verbosity of TLK print
Mihir Joshi [Mon, 18 Dec 2017 19:23:13 +0000 (11:23 -0800)]
ote_device: reduce verbosity of TLK print

Due to run time TOS detection support, we need to verify whether TLK
node is enabled in the DT or not before any TOS related operation.

For that, get_tlk_device_node() API is used internally. If TLK node is not
present it outputs an error message in dmesg which has no relevance from
end user's POV.

This change reduces verbosity of that message so that it doesn't spam the
UART if non-TLK TOS is flashed.

Bug 200366478
Tests GVS

Change-Id: I304f0d87930c3725e5babde0643903d7a4f0e0e5
Signed-off-by: Mihir Joshi <mihirj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1620551
Reviewed-by: Hayden Du <haydend@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers:camera: Update cameras to use common init
Josh Kergan [Wed, 25 Oct 2017 01:31:28 +0000 (18:31 -0700)]
drivers:camera: Update cameras to use common init

All cameras were doing the same setup and cleanup. This common
code was moved to camera_common and now all cameras should behave
the same after probe finishes.

JIRA:
Jira CHWI-1369

NvBugs:
Bug 200368584

Change-Id: If45351cf051e08015d2edb118a0ee2d1630a72da
Signed-off-by: Josh Kergan <jkergan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1585024
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1619031

6 years agodrivers:camera: Provide common setup/tear-down
Josh Kergan [Tue, 24 Oct 2017 23:12:54 +0000 (16:12 -0700)]
drivers:camera: Provide common setup/tear-down

Currently most cameras do the same steps during camera setup and
then these should be unset when the driver is unloaded. This change
moves the common setup and tear down into camera common. This helps
make the camera drivers cleaner and make extending functionality
for all sensors easier. It also takes care of sensor properties
stored in the DT so that they are parsed during the sensor
initialization rather than during channel setup.

 * Create common setup/tear down function for sensors
 * Parse DT for sensor properties during sensor initialization
   rather than channel setup.

JIRA:
Jira CHWI-1369

NvBugs:
Bug 200368584

Change-Id: I85fc8e9272e0289c0d2de29b8809480a56d2d515
Signed-off-by: Josh Kergan <jkergan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1585023
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1619030

6 years agodrivers:camera: Update fmt to be sensor specific
Josh Kergan [Wed, 25 Oct 2017 01:35:01 +0000 (18:35 -0700)]
drivers:camera: Update fmt to be sensor specific

V4L2 driver was providing all the possible color_fmts supported
by the VI, when it should have been providing only the values used
by that sensor. This fix updates the driver to check the formats
supported by the VI with the formats supported by the sensor as
described in the sensor_properties.

JIRA:
Jira CHWI-1379

NvBugs:
Bug 200368584

Change-Id: Ia7f2a7c5080eeb0c65fd10fa16dadb30195a6b29
Signed-off-by: Josh Kergan <jkergan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1613713
Reviewed-on: https://git-master.nvidia.com/r/1618498
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodevfreq: Clean up podgov parameter initialization
Peter Boonstoppel [Mon, 1 May 2017 18:08:57 +0000 (11:08 -0700)]
devfreq: Clean up podgov parameter initialization

Remove support for VIC
Remove checks for chipid
Remove unused througput parameters

Jira NVGPU-20

Change-Id: I806c5689df12ff742f1be577a25ecc1b194e5075
Reviewed-on: https://git-master/r/1473146
(cherry picked from commit 7dafdfeadadc210aba58d2c225f7c6b2b1967336)
Signed-off-by: Jon McCaffrey <jmccaffrey@nvidia.com>
Signed-off-by: Arun Kannan <akannan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1639683
GVS: Gerrit_Virtual_Submit
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodevfreq: Use devfreq timers for podgov
Peter Boonstoppel [Mon, 1 May 2017 17:27:01 +0000 (10:27 -0700)]
devfreq: Use devfreq timers for podgov

The pod governor used to rely on being invoked from nvgpu on every
gk20_busy/idle() call. This was done originally for load-tracking
purposes. This change refactors the code to instead rely on devfreq's
internal polling loop for calling the governor periodically. It also
removes the idle timeout from the podgov code, since devfreq will keep
polling even when the GPU is idle.

Jira NVGPU-20

Change-Id: I767b74c250d199e3cd5f7e249a49736836a54c0d
Reviewed-on: https://git-master/r/1473145
(cherry picked from commit 6080342d3d911112c9c9486c1bbe0f8e38ea3f57)
Signed-off-by: Jon McCaffrey <jmccaffrey@nvidia.com>
Signed-off-by: Arun Kannan <akannan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1639682
GVS: Gerrit_Virtual_Submit
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodevfreq: remove throughput hints from podgov
Konsta Holtta [Wed, 29 Mar 2017 12:19:18 +0000 (15:19 +0300)]
devfreq: remove throughput hints from podgov

The CONFIG_TEGRA_THROUGHPUT-dependent throughput hint feature is dead,
so remove the code from podgov that used it.

Bug 1853519
NVGPU-20
TGFXP-673

Change-Id: Icb36eb0b2baa98757b3ce419080b43978384bbc9
Reviewed-on: http://git-master/r/1454591
(cherry picked from commit 7c37ca23a6ade6fcaa3ce6f20afd5dfb906d041f)
Signed-off-by: Jon McCaffrey <jmccaffrey@nvidia.com>
Signed-off-by: Arun Kannan <akannan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1639681
GVS: Gerrit_Virtual_Submit
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agot210: ffu: Enable FFU
Aniruddha Tvs Rao [Thu, 11 Jan 2018 08:44:18 +0000 (00:44 -0800)]
t210: ffu: Enable FFU

Add config to enable FFU on t210.

Bug 200345130

Change-Id: Ief330c2f687afd9c8288725da16df8253d92981b
Signed-off-by: Aniruddha Tvs Rao <anrao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1637010
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoASoC: tegra-alt: Fix crash when 'rt565x-playback' link is not defined
Jon Hunter [Wed, 10 Jan 2018 09:49:29 +0000 (09:49 +0000)]
ASoC: tegra-alt: Fix crash when 'rt565x-playback' link is not defined

If the 'rt565x-playback' link is not defined in device-tree for the
Tegra210 rt565x machine driver then the following crash is seen ...

 Unable to handle kernel NULL pointer dereference at virtual address 00000068
 pgd = ffffffc00163e000
 [00000068] *pgd=000000017b1d8003, *pud=000000017b1d8003, *pmd=000000017b1d9003, *pte=00e8000050041707
 Internal error: Oops: 96000005 [#1] PREEMPT SMP
 Modules linked in:
 CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.4.38-tegra #222
 Hardware name: jetson_tx1 (DT)
 task: ffffffc0fb2f0000 ti: ffffffc0fb2a4000 task.ti: ffffffc0fb2a4000
 PC is at rt5659_set_jack_detect+0x8/0x2c
 LR is at tegra_t210ref_driver_probe+0x248/0x284
 pc : [<ffffffc0009b3864>] lr : [<ffffffc0009c5a60>] pstate: 60000045
 sp : ffffffc0fb2a7bf0
 x29: ffffffc0fb2a7bf0 x28: 0000000000000000 
 x27: 0000000000000000 x26: 0000000000000000 
 x25: 0000000000000000 x24: 0000000000000000 
 x23: 0000000000000000 x22: 0000000000000000 
 x21: ffffffc0fa282010 x20: ffffffc07d136c18 
 x19: ffffffc07d136c20 x18: 0000000000000000 
 x17: 0000000000000000 x16: 0000000000000000 
 x15: 0000000000000008 x14: 66656420746f6e20 
 x13: 6b6e696c20636564 x12: 6f63203a646e756f 
 x11: 7320783536357472 x10: 2d656c69626f6d2d 
 x9 : 666572303132742d x8 : ffffffc00030e7c8 
 x7 : 0000000000000000 x6 : 000000000000006c 
 x5 : 0000000000000000 x4 : ffffffc0fb2a78e0 
 x3 : 0000000000000000 x2 : 0000000000000c16 
 x1 : ffffffc001622228 x0 : 0000000000000000 
 
 Process swapper/0 (pid: 1, stack limit = 0xffffffc0fb2a4020)
 Call trace:
 [<ffffffc0009b3864>] rt5659_set_jack_detect+0x8/0x2c
 [<ffffffc0009c5a60>] tegra_t210ref_driver_probe+0x248/0x284
 [<ffffffc0006323c4>] platform_drv_probe+0x4c/0xb4
 [<ffffffc00062fd44>] really_probe+0x138/0x2f0
 [<ffffffc00062fff0>] driver_probe_device+0x8c/0xcc
 [<ffffffc000630090>] __driver_attach+0x60/0x8c
 [<ffffffc00062de50>] bus_for_each_dev+0x54/0x94
 [<ffffffc00062f938>] driver_attach+0x20/0x28
 [<ffffffc00062f280>] bus_add_driver+0x144/0x230
 [<ffffffc000630fd4>] driver_register+0x90/0xd8
 [<ffffffc000632324>] __platform_driver_register+0x54/0x5c
 [<ffffffc001296918>] tegra_t210ref_driver_init+0x18/0x20
 [<ffffffc0000810d8>] do_one_initcall+0x4c/0xf0
 [<ffffffc001245b64>] do_initcall_level+0xa0/0xc0
 [<ffffffc001245b9c>] do_initcalls+0x18/0x30
 [<ffffffc001245bd8>] do_basic_setup+0x24/0x30
 [<ffffffc001245d10>] kernel_init_freeable+0x118/0x1ac
 [<ffffffc000bc1ba8>] kernel_init+0xc/0xe8
 [<ffffffc000084790>] ret_from_fork+0x10/0x40
 ---[ end trace 783136a9ec7cad16 ]---

This crash is caused because when the 'rt565x-playback' link is not
defined we will still call rt5659_set_jack_detect() but pass a NULL
pointer for the codec handle. Fix this by ensuring we only call
rt5659_set_jack_detect() when the 'rt565x-playback' link is present.

Bug 2045523

Change-Id: Ib8945fee1abe1745c1b087605bf876341b3ad367
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1636468
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoarm64: configs: tegra: Enable INPUT_CFBOOST
Terry Wang [Thu, 11 Jan 2018 13:30:55 +0000 (21:30 +0800)]
arm64: configs: tegra: Enable INPUT_CFBOOST

This patch enables the input-cfboost driver module to boost
CPUfreq on an input event.

boot.img size is increased by 22528 bytes

bug 200373262

Change-Id: I33aafe40d8848f27cffaca93f6d1afddee932efb
Signed-off-by: Terry Wang <terwang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1636516
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agocoresight: fix cpu dynamic power gating side effect
Clarence.Zhou [Tue, 9 Jan 2018 02:46:27 +0000 (10:46 +0800)]
coresight: fix cpu dynamic power gating side effect

CPU loses all its PTMs' registers' values in low power state when its
dynamic power gating is enabled.

Register CPU PM notifier callback function, which saves and restores
the PTM registers' values, on low power state.

Bug 200348671

Change-Id: Ib451feeb931d32caa5a26750491796b1ac0bd1fc
Signed-off-by: Clarence.Zhou <clarencez@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1634382
GVS: Gerrit_Virtual_Submit
Reviewed-by: Chun Xu <chunx@nvidia.com>
Reviewed-by: Bo Yan <byan@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers:camera: Update default Format for OV5693
Josh Kergan [Thu, 26 Oct 2017 21:54:49 +0000 (14:54 -0700)]
drivers:camera: Update default Format for OV5693

The sensor ov5693 reports it's default format as RG10
when it really uses BG10, these formats have the same size
so the driver was working, but we should expose the true format.

JIRA CHWI-1379
Bug 200368584

Change-Id: Ia8379d456d451cf71821c7edf75ae2531095ffd1
Signed-off-by: Josh Kergan <jkergan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1586508
(cherry picked from commit 948c7d9d2a5265a554da2de4251f686a2eb79be0)
Reviewed-on: https://git-master.nvidia.com/r/1618510
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoASoC: tegra-alt: Fix error path for rt565x machine driver
Jon Hunter [Mon, 8 Jan 2018 22:09:36 +0000 (22:09 +0000)]
ASoC: tegra-alt: Fix error path for rt565x machine driver

The error path of the Tegra210 rt565x machine driver does not call
tegra_alt_asoc_utils_fini() or unregister the headset switch on
failure.

Failure to call tegra_alt_asoc_utils_fini() may leave clocks enabled
and leak references to clock handles.

Failure to unregister the headset switch on failure prevents causes
subsequent calls to register a switch to fail because one is already
registered. Hence, if the probe of the rt565x machine driver is
deferred, for example because the codec is not register yet, this
will cause subsequent probe attempts to fail because a switch is
already registered.

Fix the above issues by calling tegra_alt_asoc_utils_fini() and
unregistering the switch in the error path of the Tegra210 rt565x
machine driver probe. Finally ensure the switch is unregistered
in the removal of the rt565x machine driver.

Bug 2044665

Change-Id: Iaeb6f7ae30b6fdff46b0a8679003674804399a99
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1634166
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: camera: support syncpt init in channel init
Ahung Cheng [Wed, 27 Dec 2017 05:29:55 +0000 (13:29 +0800)]
drivers: camera: support syncpt init in channel init

This is specific for vi2 driver to use fixed syncpt id

Using dynamic syncpt id in vi2 driver can cause a side
effect that vi2 might send unexpected syncpt incremental
to a freed syncpt. This can be observed when HDMI-IN
hotplug happened and then application re-start a capture.

If the syncpt got assigned to another nvhost client,
that unexpected increment will cause syncpt timeout

bug 200357789

Change-Id: I5d9107b3b21a47c91d5fe56b0cf80ad5e89b9023
Reviewed-on: https://git-master.nvidia.com/r/1627061
GVS: Gerrit_Virtual_Submit
(cherry picked from commit 877d999757341278eb891e7fa0e00f5c484ea4a6)
Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1629741
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agocore: mmc: suspend/resume without power in suspend
Aniruddha Tvs Rao [Wed, 8 Nov 2017 04:07:34 +0000 (09:37 +0530)]
core: mmc: suspend/resume without power in suspend

Check the status of pm flags before resume.

Bug 200352008

Change-Id: I69ee988779c5393b1a8f67d07a01e92cc5f0dd30
Signed-off-by: Aniruddha Tvs Rao <anrao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1594012
(cherry picked from commit 596089e8aa68a4db907617fcc18c8b779e928ff2)
Reviewed-on: https://git-master.nvidia.com/r/1627725
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Vick Yu <vyu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agocrypto: increase NEON instruction cipher priority
Ian Chang [Thu, 28 Dec 2017 08:49:12 +0000 (16:49 +0800)]
crypto: increase NEON instruction cipher priority

We found issue when enabling file encryption on T210 platform.
After use NEON instruction the issue disappear.So increase
the NEON instruction priority to 400 on T210 platform as WAR.

bug 200345207
bug 200368838

Change-Id: I254418d19e5c9cde4f570244b5a859c7bfc0cfaa
Reviewed-on: https://git-master.nvidia.com/r/1627700
Reviewed-by: Ian Chang <ianc@nvidia.com>
Tested-by: Ian Chang <ianc@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoRevert "arm64: configs: Enable android for loglevel print"
Bharat Nihalani [Wed, 27 Dec 2017 04:46:42 +0000 (20:46 -0800)]
Revert "arm64: configs: Enable android for loglevel print"

This reverts commit 080d88aaed36043cd0b88ec8270a1e807a15eaf8
since this causes SQA Automation tests to fail because we
don't see "BOOT_COMPLETE" print with this config enabled.

Bug 200375800

Change-Id: Ib76c0efb83073617dbb55359d63c37bf98944bda
Reviewed-on: https://git-master.nvidia.com/r/1626954
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoCHROMIUM: nouveau: check path_nr before passing it to nvkm_ioctl_path
Kary Jin [Tue, 19 Sep 2017 08:35:08 +0000 (16:35 +0800)]
CHROMIUM: nouveau: check path_nr before passing it to nvkm_ioctl_path

Check the path_nr before passing it into nvkm_ioctl_path to avoid the
out-of-bound issue.

Bug 2019915

Change-Id: Ida06ef6218b914df0794a7431b9679c916988f33
Signed-off-by: Kary Jin <karyj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1615237
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Tested-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoUPSTREAM: ALSA: timer: Call notifier in the same spinlock
Takashi Iwai [Wed, 10 Feb 2016 11:47:03 +0000 (12:47 +0100)]
UPSTREAM: ALSA: timer: Call notifier in the same spinlock

snd_timer_notify1() is called outside the spinlock and it retakes the
lock after the unlock.  This is rather racy, and it's safer to move
snd_timer_notify() call inside the main spinlock.

The patch also contains a slight refactoring / cleanup of the code.
Now all start/stop/continue/pause look more symmetric and a bit better
readable.

Bug 2019915
Change-Id: Ib90099f88c8b04928a8cdd2808cd9e16da6d519c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Siqi Lin <siqilin@google.com>
Reviewed-on: https://git-master.nvidia.com/r/1615234
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoALSA: timer: Fix race between read and ioctl
Takashi Iwai [Fri, 2 Jun 2017 13:03:38 +0000 (15:03 +0200)]
ALSA: timer: Fix race between read and ioctl

The read from ALSA timer device, the function snd_timer_user_tread(),
may access to an uninitialized struct snd_timer_user fields when the
read is concurrently performed while the ioctl like
snd_timer_user_tselect() is invoked.  We have already fixed the races
among ioctls via a mutex, but we seem to have forgotten the race
between read vs ioctl.

This patch simply applies (more exactly extends the already applied
range of) tu->ioctl_lock in snd_timer_user_tread() for closing the
race window.

Bug 2019915
Reported-by: Alexander Potapenko <glider@google.com>
Tested-by: Alexander Potapenko <glider@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Change-Id: I680a4758ace7eb5fb999fce6abb7070242b6c6da
Reviewed-on: https://git-master.nvidia.com/r/1615233
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoANDROID: scsi: Add segment checking in sg_read
Roberto Pereira [Wed, 11 Oct 2017 00:14:48 +0000 (17:14 -0700)]
ANDROID: scsi: Add segment checking in sg_read

Bug 2019915
Signed-off-by: Roberto Pereira <rpere@google.com>
Change-Id: I91b6b5dbcea7c39643beffdc12a23ee3d8f8775d
Reviewed-on: https://git-master.nvidia.com/r/1615236
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Tested-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoarm64: tegra21: enable CONFIG_MMC_TEST
Sandipan Patra [Fri, 22 Dec 2017 05:32:54 +0000 (11:02 +0530)]
arm64: tegra21: enable CONFIG_MMC_TEST

enabling CONFIG_MMC_TEST to enable mmc test.

boot.img size is increased by 16512 bytes

Bug 1616399

Change-Id: If53ce6d452f18b382741bc2ae056e857f89dae91
Signed-off-by: Sandipan Patra <spatra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1624510
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: camera: fix panic for HDMI-CSI bridge
Ahung Cheng [Tue, 5 Dec 2017 09:37:44 +0000 (17:37 +0800)]
drivers: camera: fix panic for HDMI-CSI bridge

HDMI-CSI bridge doesn't support override control
and doesn't allocate struct for camera_common_data.
When VI driver is access to override control for HDMI-IN,
it is actually to update the memory of mutex pointer.

bug 200366976

Change-Id: Ie9a2e283f9c846136e83b002bbaec64ba07baf80
Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1611113
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agotlk_driver: check TLK node before tlk_restore_keyslots
Mihir Joshi [Mon, 18 Dec 2017 19:36:30 +0000 (11:36 -0800)]
tlk_driver: check TLK node before tlk_restore_keyslots

Currently, we call tlk_restore_keyslots even if TLK node is not enabled in
DTB.
This patch adds a check to not call the TLK SMC if detected TOS is not TLK

Bug 200366892
Tests GVS

Change-Id: I52b35f9398c8c9a6d0350640313794beeb20e23d
Signed-off-by: Mihir Joshi <mihirj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1620558
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoASoC: tegra-alt: Fix SW reset for Tegra210 ADMAIF9/10
Jon Hunter [Mon, 18 Dec 2017 15:38:26 +0000 (15:38 +0000)]
ASoC: tegra-alt: Fix SW reset for Tegra210 ADMAIF9/10

When using ADMAIF9/10 channels for audio playback/capture on Tegra210,
the soft-reset of the ADMAIF is failing when playback finishes ...

Playing WAVE 'rec.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
[  260.094969] tegra210-ape-admaif tegra210-admaif: Failed at ADMAIF0_TX sw reset

There are a couple issues here ...
1. The ADMAIF that fails is reported as 'ADMAIF0' although in the above
   test ADMAIF9 is being used. This is purely an error in the driver
   which is using 'dev-id' as the ADMAIF ID instead of 'dai->id'. Hence
   the above error message is misleading.
2. The soft reset fails because the regmap configuration for the ADMAIF
   registers on T210 is incorrect. In the function,
   tegra210_admaif_volatile_reg(), only the ADMAIF registers between
   offset 0x000 and 0x500 are considered volatile. The problem is that
   the ADMAIF channel registers for T210 actually span 0x000-0x280 (for
   RX) and 0x300-0x580 (for TX). This means that for TX, the ADMAIF9/10
   channel registers are not considered volatile and hence, polling the
   soft reset register is failing.

Fix the above two issues by correcting the ADMAIF ID reported for any
soft reset failures, and correct the address range for ADMAIF volatile
registers.

Bug 2037162

Change-Id: If22eba754ab4bf2bf5acc3c9da51388b7208c749
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1620448
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: camera: Fix calibration for CSI2
David Bang [Mon, 18 Dec 2017 18:31:53 +0000 (13:31 -0500)]
drivers: camera: Fix calibration for CSI2

CSI2 mipi lanes calibration is driven by sensor
state. As soon as the mipi pad is powered on the
sensor is also powered/streamed to reach the standby
state for performing the calibration during the
initialization sequence of CSI2 HW.
Address issues with loadable sensor modules, calibration
will be performed only when the sensor is bound.

Bug 200324656

Change-Id: I63821287514c1202570fc78a287a01882ff69fcc
Signed-off-by: David Bang <dbang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1565678
Reviewed-on: https://git-master.nvidia.com/r/1620526
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: camera: Fix Mipi Calibration sequence
David Bang [Mon, 18 Dec 2017 17:54:12 +0000 (12:54 -0500)]
drivers: camera: Fix Mipi Calibration sequence

MIPI calibration can happen irrespective of
sensor state by keeping CSI CIL in reset
state. This change adds calibration to complete
when the CSI is powered ON and based on the sensor
settings. By this approach the mipi lanes are
calibrated and are ready as soon as sensor is
turned ON.

Bug 200324656

Change-Id: Id2cd6336395d3a0f0b2637207eb4fdfe6edc3d63
Signed-off-by: David Bang <dbang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1560331
Reviewed-on: https://git-master.nvidia.com/r/1620523
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoRevert "video: hdmi: fix coverity defect"
Ahung Cheng [Wed, 6 Dec 2017 09:17:54 +0000 (17:17 +0800)]
Revert "video: hdmi: fix coverity defect"

This reverts commit da5970b381be265f799b881b60d73c87c5e741ae.

The vendor and product buffers are indeed not nul terminated
(see the CEA-861 spec).
So forcing the last byte to be 0 will cut off the last
character when using full-length vendor (8 chars) or
product (16 chars) names.

bug 2023690

Change-Id: Ie8be3d8db0648e324d829c791d0432a924462908
Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1612329
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agonet: wireless: bcmdhd_pcie: remove unsed WEXT file.
Insun Song [Tue, 30 May 2017 08:34:51 +0000 (17:34 +0900)]
net: wireless: bcmdhd_pcie: remove unsed WEXT file.

WEXT API was already obsoleted and should be removed.
CVE-2017-0509 (Android-32124445/Broadcom-RB#110688)

Bug 200312259

Change-Id: I9f40b7c02b553b47681cc8a7c836be918526b6dc
Signed-off-by: Insun Song <insun.song@broadcom.com>
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: http://git-master/r/1493649
(cherry picked from commit b0741841e12dbbb10ead5bbf393c80c72331dd7e)
Reviewed-on: https://git-master.nvidia.com/r/1613075
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agousb: xhci: apply XHCI_TRUST_TX_LENGTH to Renesas platforms
Vidya Sagar [Tue, 12 Dec 2017 03:03:53 +0000 (08:33 +0530)]
usb: xhci: apply XHCI_TRUST_TX_LENGTH to Renesas platforms

Renesas platforms are freezing system with the following log

xhci_hcd 0000:01:00.0: WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk?

Hence applying XHCI_TRUST_TX_LENGTH quirk for Renesas

Bug 200371487

Change-Id: I26b47907a5c3722a6d4c8a186121eb30baa8305b
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1616111
Tested-by: Dane Liu <danel@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoASoC: tegra-alt: Add support for overriding the bclk ratio
Jon Hunter [Fri, 17 Nov 2017 11:17:22 +0000 (11:17 +0000)]
ASoC: tegra-alt: Add support for overriding the bclk ratio

To test internal loopback on any I2S interface using various different
sampling frequencies, it is necessary to be able to override the bit
clock ratio. However, rather than adding a kcontrol for each audio
link supported by the machine driver, add a global kcontrol that when
set will control the bit clock ratio for all I2S links.

Bug 2025176

Change-Id: I46ec949d36f0fe34967b9ed718d2189b539a1a37
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1602528
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoASoC: tegra-alt: Improve Tegra210 support for testing I2S4
Jon Hunter [Mon, 27 Nov 2017 12:11:52 +0000 (12:11 +0000)]
ASoC: tegra-alt: Improve Tegra210 support for testing I2S4

On Tegra210 Jetson TX1, the audio path which defines the I2S4 interface
as the CPU DAI, only supports 2-channel 16-bit audio at 48kHz. This
prevents the user from testing other data formats and rates with this
I2S interface.

For Tegra210 Jetson TX1, the I2S4 interface is used by the DAI link
named 'spdif-dit-0'. Improve support for testing the I2S4 interface by
allowing the sampling rate, data format and number of channels for
'spdif-dit-0' DAI link to be updated.

Bug 2025176

Change-Id: Ifb9092a3d66f88d05d4a85aeee02e99469195649
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1605633
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agosoc: tegra: Update DMIC maximum frequency
Jon Hunter [Wed, 6 Dec 2017 11:00:18 +0000 (11:00 +0000)]
soc: tegra: Update DMIC maximum frequency

When attempting to capture audio from DMIC3 on Jetson TX1 after boot
with sampling frequencies of 16kHz or greater the following errors
are seen when enabling the DMIC clock and causes the audio capture
to fail.

 tegra-dvfs: rate 12287995 too high for dvfs on dmic3
 tegra210-dmic tegra210-dmic.2: clk_enable failed: -22

The problem is that the Tegra210 DVFS driver is limiting the DMIC
frequency to 12.19MHz, although the DMIC supports a maximum frequency
of 12.288MHz (48kHz * 256 over-sampling). The 12.19MHz limit came from
the Tegra210 DVFS frequency spreadsheet that describes the maximum
frequencies for all interfaces/peripherals. This spreadsheet is being
updated to increase the maximum frequency for the DMIC to 12.288MHz.
Therefore, update the Tegra210 DVFS driver to align with this new
maximum frequency for the DMIC interfaces.

Bug 2029031

Change-Id: I44a49013e67b19ee6ba88c71dbf1f83fcff408bf
Reviewed-on: https://git-master.nvidia.com/r/1612395
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agort_patches: required rebase due to printk change
Arvind M [Tue, 5 Dec 2017 06:18:06 +0000 (22:18 -0800)]
rt_patches: required rebase due to printk change

Rebases rt patches because of changes in kernel core files.

Bug 200365736

Change-Id: If5e1d61be336a7d304450d34e0b47f9aefb27378
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1610942
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoarm64: configs: Enable android for loglevel print
Arvind M [Tue, 5 Dec 2017 05:15:21 +0000 (21:15 -0800)]
arm64: configs: Enable android for loglevel print

1. Sets SERIAL_8250_CONSOLE_FORCE_FORMAT config to 'y' for android.
2. Allows log level to be a part of kernel UART logs.

Bug 200365736

Change-Id: Ic4794b152378c3cd39880430abd597a5add9a0ab
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1610941
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agotty: serial: 8250: supports loglevel print format
Arvind M [Wed, 29 Nov 2017 06:05:51 +0000 (22:05 -0800)]
tty: serial: 8250: supports loglevel print format

1. Introduces KConfig variable SERIAL_8250_CONSOLE_FORCE_FORMAT default to
    value 'n'
2. Modifies the UART8250 output format to include kernel loglevel based on
    configuration

Bug 200365736

Change-Id: I7354481d9a1658ac02fe97108c328301e3a6d33f
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1610940
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agokernel: printk: adds extra print format support
Arvind M [Wed, 29 Nov 2017 06:00:04 +0000 (22:00 -0800)]
kernel: printk: adds extra print format support

Adds feature in printk to include log levels in log message with help of
console flag CON_FORCE_LEVEL

Bug 200365736

Change-Id: I8affb2e2141ce5726ed3d392464e9878dce2ea7b
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1610939
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoASoC: tegra-alt: Add 32-bit and TDM support for I2S3 on Tegra210
Jon Hunter [Mon, 27 Nov 2017 13:07:29 +0000 (13:07 +0000)]
ASoC: tegra-alt: Add 32-bit and TDM support for I2S3 on Tegra210

On Tegra210 Jetson TX1, the audio path which defines the I2S3 interface
as the CPU DAI, only supports 16-bit data formats and 2 channel audio.
This prevents the user from testing other data formats and rates with
this I2S interface..

For Tegra210 Jetson TX1, the I2S3 interface is used by the DAI link
named 'spdif-dit-3'. Improve support for testing the I2S3 interface by
allowing the data format and number of channels for 'spdif-dit-3' DAI
link to be updated.

Bug 2025176

Change-Id: Ia798ac9da099afb6e5be17cf06899ec516b2df41
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1605632
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoxfrm: policy: check policy direction value
Vladis Dronov [Wed, 2 Aug 2017 17:50:14 +0000 (19:50 +0200)]
xfrm: policy: check policy direction value

The 'dir' parameter in xfrm_migrate() is a user-controlled byte which is used
as an array index. This can lead to an out-of-bound access, kernel lockup and
DoS. Add a check for the 'dir' value.

This fixes CVE-2017-11600.

Bug 2000057

Change-Id: I9d7006fd56c8970b833061d80f3821e6ea0c855a
References: https://bugzilla.redhat.com/show_bug.cgi?id=1474928
Fixes: 80c9abaabf42 ("[XFRM]: Extension for dynamic update of endpoint address(es)")
Cc: <stable@vger.kernel.org> # v2.6.21-rc1
Reported-by: "bo Zhang" <zhangbo5891001@gmail.com>
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Reviewed-on: https://git-master.nvidia.com/r/1605445
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Tested-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoBACKPORT: pids: make task_tgid_nr_ns() safe
Oleg Nesterov [Fri, 1 Sep 2017 20:50:39 +0000 (13:50 -0700)]
BACKPORT: pids: make task_tgid_nr_ns() safe

This was reported many times, and this was even mentioned in commit
52ee2dfdd4f5 "pids: refactor vnr/nr_ns helpers to make them safe" but
somehow nobody bothered to fix the obvious problem: task_tgid_nr_ns()
is not safe because task->group_leader points to nowhere after the
exiting task passes exit_notify(), rcu_read_lock() can not help.

We really need to change __unhash_process() to nullify group_leader,
parent, and real_parent, but this needs some cleanups. Until then we
can turn task_tgid_nr_ns() into another user of __task_pid_nr_ns() and
fix the problem.

Reported-by: Troy Kensinger <tkensinger@google.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
(cherry picked from commit dd1c1f2f2028a7b851f701fc6a8ebe39dcb95e7c)

Bug 2000057

Change-Id: Iad19a77f4f0aa9f3b6b0539ac9c549fa64c18550
Reviewed-on: https://git-master.nvidia.com/r/1605402
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
Tested-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoPM / Domains: fix resume sequence in resume_noirq
Joseph Lo [Thu, 29 Jun 2017 07:00:47 +0000 (15:00 +0800)]
PM / Domains: fix resume sequence in resume_noirq

Like the 'commit 09b4621f1835 ("PM / Domains: fix redundant
genpd_save_dev call in suspend_noirq")', we should fix the same in
resume_noirq. So the resume sequence will just reverse the sequence in
the suspend_noirq call. This avoids missing "genpd_start_dev" call in
resuem_noirq phase with the drivers using "GENPD_FLAG_PM_UPSTREAM" flag.

And no impacts with other drivers not using "GENPD_FLAG_PM_UPSTREAM"
flag.

Bug 200323145
Bug 200367242

Change-Id: If899293cd7d217b0fdc0bad5f2373495cd25d53c
Signed-off-by: Joseph Lo <josephl@nvidia.com>
Reviewed-on: https://git-master/r/1510693
(cherry picked from commit 5214c67eac70d3ab4e61a00aaccb26f00f8ad5fc)
Reviewed-on: https://git-master/r/1512355
(cherry picked from commit 47618503482ba51e0b2778f8dccae369d58714c9)
Reviewed-on: https://git-master.nvidia.com/r/1554428
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Tested-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agocrypto: tegra-cryptodev: Remove unused slot info in ecc request structure
Mallikarjun Kasoju [Mon, 27 Nov 2017 09:33:01 +0000 (15:03 +0530)]
crypto: tegra-cryptodev: Remove unused slot info in ecc request structure

Slot information is not used when doing ecc operations. So removed it.

Bug 200367774

Change-Id: I92a704283ba70eaa7fdbf09587439160d098ec08
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1605489
Reviewed-by: Konduri Praveen <kondurip@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agocrypto: se-elp: Remove slot info for elp request structure
Mallikarjun Kasoju [Mon, 27 Nov 2017 09:19:13 +0000 (14:49 +0530)]
crypto: se-elp: Remove slot info for elp request structure

There is no need to store slot information in ecc request structure
as it not used anywhere.

Bug 200367774

Change-Id: Ie366208fd8c56f261b6b71a9baa3b9b9384330ac
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1605488
Reviewed-by: Konduri Praveen <kondurip@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>