]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/log
hercules2020/nv-tegra/linux-4.4.git
6 years agoBluetooth: hidp: fix possible might sleep error in hidp_session_thread
Jeffy Chen [Thu, 8 Jun 2017 02:00:07 +0000 (19:00 -0700)]
Bluetooth: hidp: fix possible might sleep error in hidp_session_thread

1/ Fix could not wake up by wake attempts on original wait queues.
2/ Remove unnecessary memory barrier before wake_up_* functions.

1/ Make hidp_session_wake_function static.
2/ Remove unnecessary default_wake_function.

Bug 200313399
Bug 200316957

Change-Id: I406345dcb9ba2289a4693600c5641c415fb732ef
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Shobek Sam Attupurath <sattupurath@nvidia.com>
Reviewed-on: http://git-master/r/1498057
Tested-by: Rohit Vaswani <rvaswani@nvidia.com>
Reviewed-by: Gaurav Asati <gasati@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
6 years agonet: eqos: handle rollover of PHC
abhijit [Tue, 13 Jun 2017 17:17:41 +0000 (22:47 +0530)]
net: eqos: handle rollover of PHC

Issue: ptp get_systime is not handling the rollover of nsec counter.

Fix: Handle the nsec rollover by reading the nsec counter twice. if
second read value is lower than first value, read the sec counter
again to handle rollover.

Bug 200317864

Change-Id: Ie9d09203d388656ebf8c18dd263d2d08e5c52467
Reviewed-on: http://git-master/r/1500673
(cherry picked from commit 567d97e7bfeec20cb6a196b0d874d2e0f14f3fa9)
Reviewed-on: http://git-master/r/1503234
GVS: Gerrit_Virtual_Submit
Tested-by: Abhijit . <abhijit@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
6 years agonet: eqos: Register PTP callback at correct place
abhijit [Mon, 29 May 2017 09:31:36 +0000 (15:01 +0530)]
net: eqos: Register PTP callback at correct place

Issue: CAN HW timestamp information is incorrect in case one of the
Tegra is made PTP master.

Fix: CAN HW timestamp is based on get_ptp_hwtime function which is
exported by PTP notifier framework. Above function relies on callback
registered by eqos driver. This callack was registered when adjust
PTP time was called. But adjust is not called for PTP master. Moved
the callback registration to set HWTSTAMP ioctl which is required by
both PTP master and slave.

Bug 1887016

Change-Id: Iaad1d7cdff4fc2aaf3e015ddf7b8c5ef189add3f
Reviewed-on: http://git-master/r/1491662
(cherry picked from commit 1593119045757decc0e3d71fc733d678df8637aa)
Reviewed-on: http://git-master/r/1503233
GVS: Gerrit_Virtual_Submit
Tested-by: Abhijit . <abhijit@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
6 years agonet: eqos: Add ioctl for Timestamp information
abhijit [Fri, 19 May 2017 12:19:36 +0000 (17:49 +0530)]
net: eqos: Add ioctl for Timestamp information

Issue: Required a way to read both HW PTP time and kernel time (either
CLOCK_REALTIME or CLOCK_MONOTONIC) atomically. This read will be done
with periodicity of 1 second.

Fix: Added private ioctl to get the above information. Reading of these
time values is protected by raw spinlock. Also modified ptp_lock spinlock
to be raw spinlock to prevent race conditions under RT kernel.

Bug 1927680

Change-Id: I56bca4f9d1641276b94490e6f98d8e898fda8ccf
Reviewed-on: http://git-master/r/1485916
(cherry picked from commit 13873eece3e22dc6b8cb9d96e20969ba0d6d5507)
Reviewed-on: http://git-master/r/1503232
GVS: Gerrit_Virtual_Submit
Tested-by: Abhijit . <abhijit@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
6 years agomedia:platform:tegra Stop duplicate singleshot
Ian Kaszubski [Thu, 15 Jun 2017 22:43:38 +0000 (15:43 -0700)]
media:platform:tegra Stop duplicate singleshot

Issue: When a capture session is complete an extra singleshot is
sometimes issued causing syncpt timeouts in subsequent sessions.

Fix: When a capture is complete do not issue a single shot if there
is already an active one.

Bug 200291915

Change-Id: I0616978b2144a0539980087fd356d8c30299bcd0
Signed-off-by: Ian Kaszubski <ikaszubski@nvidia.com>
Reviewed-on: http://git-master/r/1503374
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jaspreet Kaur <jkaur@nvidia.com>
Reviewed-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
6 years agomedia: tegra: camera: fix embedded data error
Ahung Cheng [Wed, 10 May 2017 08:33:30 +0000 (16:33 +0800)]
media: tegra: camera: fix embedded data error

Consider the case like HDMI input bridge. There
is no default modes from device tree. It's no
need to allocate memory for embedded data.

bug 200303250

Change-Id: I64efc6a1a81bfb6e6da6912f0cb413739caaf70c
Reviewed-on: http://git-master/r/1478950
Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
(cherry picked from commit 9a82905d7de752dda320f4d84133c5850a856b65)
Reviewed-on: http://git-master/r/1495750
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agonet: eqos: start phy interrupts after MAC reset.
Narayan Reddy [Wed, 14 Jun 2017 05:38:00 +0000 (11:08 +0530)]
net: eqos: start phy interrupts after MAC reset.

Issue: After PHY reset through the GPIO, autonegotion
will start from the PHY side which results in triggering
the PHY interrupts. Through the IRQ handler phy_change
workqueue will be scheduled and which will be trying to
access the PHY registers through MDIO bus. While accessing
the MDIO address/data registers in workqueue context EQOS
MAC is in reset mode which results in APB timeout.

Fix: start phy interrupts once EQOS MAC is out of reset

Bug 200284385

Change-Id: Ia5b48f2b163463f6b4f1f3c0b319b5da0ebccb3e
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: http://git-master/r/1502069
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agolocking, rcu, cgroup: Avoid synchronize_sched() in __cgroup_procs_write()
Peter Zijlstra [Thu, 11 Aug 2016 16:54:13 +0000 (18:54 +0200)]
locking, rcu, cgroup: Avoid synchronize_sched() in __cgroup_procs_write()

The current percpu-rwsem read side is entirely free of serializing insns
at the cost of having a synchronize_sched() in the write path.

The latency of the synchronize_sched() is too high for cgroups. The
commit 1ed1328792ff talks about the write path being a fairly cold path
but this is not the case for Android which moves task to the foreground
cgroup and back around binder IPC calls from foreground processes to
background processes, so it is significantly hotter than human initiated
operations.

Switch cgroup_threadgroup_rwsem into the slow mode for now to avoid the
problem, hopefully it should not be that slow after another commit:

  80127a39681b ("locking/percpu-rwsem: Optimize readers and reduce global impact").

We could just add rcu_sync_enter() into cgroup_init() but we do not want
another synchronize_sched() at boot time, so this patch adds the new helper
which doesn't block but currently can only be called before the first use.

Bug 200300548

Reported-by: John Stultz <john.stultz@linaro.org>
Reported-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Colin Cross <ccross@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rom Lemarchand <romlem@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Todd Kjos <tkjos@google.com>
Link: http://lkml.kernel.org/r/20160811165413.GA22807@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from upstream commit 3942a9bd7b5842a924e99ee6ec1350b8006c94ec)

Conflicts:
kernel/cgroup.c

Change-Id: Ic43990317727692975699676775ca7b1ea0dd9b9
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/1494853
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agolocking/percpu-rwsem: Optimize readers and reduce global impact
Peter Zijlstra [Thu, 14 Jul 2016 18:08:46 +0000 (20:08 +0200)]
locking/percpu-rwsem: Optimize readers and reduce global impact

Currently the percpu-rwsem switches to (global) atomic ops while a
writer is waiting; which could be quite a while and slows down
releasing the readers.

This patch cures this problem by ordering the reader-state vs
reader-count (see the comments in __percpu_down_read() and
percpu_down_write()). This changes a global atomic op into a full
memory barrier, which doesn't have the global cacheline contention.

This also enables using the percpu-rwsem with rcu_sync disabled in order
to bias the implementation differently, reducing the writer latency by
adding some cost to readers.

Bug 200300548

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
[ Fixed modular build. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from upstream commit 80127a39681bd68c959f0953f84a830cbd7c3b1c)

Change-Id: I5636ef98f2bc7ed6143fadffc6fb76e0d2dee5f8
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/1494852
Tested-by: Mubushir Rahman <mubushirr@nvidia.com>
Reviewed-by: Mubushir Rahman <mubushirr@nvidia.com>
Reviewed-by: Ilan Aelion <iaelion@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
6 years agodrivers: media: camera: Add sync op support
Bhanu Murthy V [Fri, 10 Jun 2016 23:17:52 +0000 (16:17 -0700)]
drivers: media: camera: Add sync op support

Add sync file op support in VI driver.
Sub devices will be synchronized when the MFI interrupt
arrives to VI driver. At present this interrupt is
configured when the ROI of focus area ends during the
current frame capture.

Fix vi2 and vi4 differences using fops in addition to
the original commit.
Cleanup MFI code in the active isr flow.

Bug 1754305

Change-Id: I7e96d413e79dbab17c7c4349cef9ef6b78ab983d
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: http://git-master/r/1162764
(cherry picked from commit 8c7c212927f1b1703fe0bf95086605fef48ff89d)
Reviewed-on: http://git-master/r/1327223
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agodrivers: media: lc898212: Focuser sync support
Bhanu Murthy V [Fri, 10 Jun 2016 19:49:17 +0000 (12:49 -0700)]
drivers: media: lc898212: Focuser sync support

Add support for synchronized focuser position writes
w.r.t sensor capture.
Add external sync CID for focuser to enable/disable
external synchronization to set position.

Bug 1754305

Change-Id: Ia41770b960a1f9b3013355983ea074b1c19f55df
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-on: http://git-master/r/1162763
(cherry picked from commit f2ec481a564305d7036c83faebef871b890d09f5)
Reviewed-on: http://git-master/r/1327222
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
6 years agov4l2-core: Add sync op to subdev_core_ops
Bhanu Murthy V [Fri, 10 Jun 2016 23:09:45 +0000 (16:09 -0700)]
v4l2-core: Add sync op to subdev_core_ops

If multiple sub devices need to be synchronized w.r.t one
sub device state, then this op can be used.

For example in camera system, configuring focuser position and
sensor capture have to be synchronized when the ROI for focuser
ends. Writing focus position on improper boundary causes unexpected
output.

Bug 1754305

Change-Id: I09140cac1c2e3a06de78f08b90c35562d2ec2880
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-on: http://git-master/r/1162762
(cherry picked from commit 03ea0e3544d6768cc84d2ff4b90a218caee6d208)
Reviewed-on: http://git-master/r/1327221
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
6 years agoplatform: auto: Initialize pwm as NULL
Junghyun Kim [Thu, 18 May 2017 19:49:03 +0000 (12:49 -0700)]
platform: auto: Initialize pwm as NULL

Initialize pwm variable to NULL and qualify it
before using PWM functions when pwm is not defined
in DT.

Bug 1926727

Change-Id: I2a7ab201645f4a4d3158bbfc281adea19ffd6cb5
Signed-off-by: Junghyun Kim <juskim@nvidia.com>
Reviewed-on: http://git-master/r/1485097
(cherry picked from commit b9f147d439b6f5b0bf28f5f4791ca0e6e862bdcd)
Reviewed-on: http://git-master/r/1485345
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-by: Gajanan Bhat <gbhat@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
6 years agoplatform: auto: disable pwm when isc-mgr released
Junghyun Kim [Tue, 2 May 2017 23:15:00 +0000 (16:15 -0700)]
platform: auto: disable pwm when isc-mgr released

Bug 1926727

Change-Id: I0cb51ce3f2c7df6ede12764deb6abeffcced53f7
Signed-off-by: Junghyun Kim <juskim@nvidia.com>
Reviewed-on: http://git-master/r/1474817
(cherry picked from commit 4f755907fe8a95d36abb0c357a3eb05d66e3f84e)
Reviewed-on: http://git-master/r/1484218
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-by: Gajanan Bhat <gbhat@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
6 years agofbcon: use mode from fbconsole to enable dc
Naveen Kumar S [Thu, 8 Jun 2017 14:34:42 +0000 (20:04 +0530)]
fbcon: use mode from fbconsole to enable dc

fbconsole takes over when a userspace entity (Xorg) gets
killed. But in this scenario, DC was getting enabled
with X's mode instead of using fbconsole's mode. This
lead to DC and fbconsole having different modes if X had
updated its mode earlier. Updated fbconsole unblanking logic
to use fbconsole's mode to enable DC during a switch from
graphical to text mode.

bug 1885932

Change-Id: I8aa63c950fefc23aa2ec1b062ed6648688b6f4bb
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/1498522
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoRevert "fbcon: update mode before enabling controller"
Naveen Kumar S [Thu, 8 Jun 2017 14:27:53 +0000 (19:57 +0530)]
Revert "fbcon: update mode before enabling controller"

This reverts commit 5bdda4518527d11c7e690e39a1ae6a1a9b1bb56a.
This change helped in updating dc mode when a userspace
client got killed abruptly. But it was observed that display
was not unblanking during hotplug. Hence reverting this patch.

bug 200299134
bug 1885932

Change-Id: I5981b08f0fc9c70ce14f895bd66a127a2998147a
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/1498521
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoRevert "net: eqos: fix timeout error"
Rajkumar Kasirajan [Sat, 3 Jun 2017 01:01:02 +0000 (09:01 +0800)]
Revert "net: eqos: fix timeout error"

This reverts commit 27cba59ebedd9ea62947ca697e706926837b2c45 as
it increased osidle power when Ethernet is disabled by software.

Bug 200314903
Bug 200284385

Change-Id: Ibb75e0d72d790ce8239b0beeb989a03d1fede42a
Signed-off-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-on: http://git-master/r/1495165
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ninad Malwade <nmalwade@nvidia.com>
Tested-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
6 years agotegra210-emc: Get max temperature of two DDR die
Shreshtha SAHU [Tue, 9 May 2017 06:30:17 +0000 (12:00 +0530)]
tegra210-emc: Get max temperature of two DDR die

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

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

Bug 1915944
Bug 200306741

Change-Id: I52e9f5507445043545a384a31a02595bd69506a3
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1477999
GVS: Gerrit_Virtual_Submit
Reviewed-by: Martin Chi <mchi@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
6 years agotegra-se: Set IV in UIV slot
Konduri Praveen [Fri, 2 Jun 2017 09:33:21 +0000 (15:03 +0530)]
tegra-se: Set IV in UIV slot

Set IV in UIV slot so that when an IV is not set,
Engine will use updated IV from UIV which is
calculated from previous AES operation.

Bug 200225148

Change-Id: I6f44504d1d21fe8f128ea34fadbfeb32348b0d90
Signed-off-by: Konduri Praveen <kondurip@nvidia.com>
Reviewed-on: http://git-master/r/1494656
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
6 years agofbcon: Block rounding off mode for VT running X.
Saket Sinha [Fri, 26 May 2017 05:55:28 +0000 (11:25 +0530)]
fbcon: Block rounding off mode for VT running X.

When X is active i.e. GNOME/Ubuntu Desktop is running, fb_display
does not get updated and still contain stale values of unplug event.
Rounding mode of stale values causes wrong resolution being picked up
on hotplugging HDMI.

Bug 200295792

Change-Id: Icdd4d1ea06044ac63e3b76d881e4d7ccc65bf5fd
Signed-off-by: Saket Sinha <sakets@nvidia.com>
Reviewed-on: http://git-master/r/1490339
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
6 years agoarm64: mm: remap dma contiguous memory as non executable
Krishna Reddy [Thu, 9 Feb 2017 06:13:32 +0000 (22:13 -0800)]
arm64: mm: remap dma contiguous memory as non executable

Dma buffers shouldn't have executable code. To ensure the security,
Map dma contiguous memory as non executable in kernel.

Bug 1859649

Change-Id: I8b4b6d574477f560e9a43b07287014ed981092d3
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/1301854
(cherry picked from commit e910098f1d91ce82c18de8b5986be0856e5bc942)
Reviewed-on: http://git-master/r/1497681
Reviewed-by: Kamal Balagopalan <kbalagopalan@nvidia.com>
Tested-by: Kamal Balagopalan <kbalagopalan@nvidia.com>
GVS: Gerrit_Virtual_Submit

6 years agotegra: camera: fix ENUM_FRAMESIZES/INTERVALS
Ahung Cheng [Tue, 25 Apr 2017 05:13:09 +0000 (13:13 +0800)]
tegra: camera: fix ENUM_FRAMESIZES/INTERVALS

The compliance test breaks since these always return 0 when they
should return -ENOTTY.

bug 200294896

Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
Change-Id: I3f3e1084aefa4e77a6ed83126947c8ea946c7beb
Reviewed-on: http://git-master/r/1456977
Reviewed-on: http://git-master/r/1469190
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
(cherry picked from commit 556422aa1a75f6a44c5a9265bbfd532a8c15b7dd)
Reviewed-on: http://git-master/r/1496501

6 years agoarm64: tegra18: disable CONFIG_TEGRA_PTP_NOTIFIER
Shreshtha SAHU [Mon, 5 Jun 2017 13:23:05 +0000 (18:53 +0530)]
arm64: tegra18: disable CONFIG_TEGRA_PTP_NOTIFIER

Bug 200301929

Change-Id: I04253a2f3a85ec83c3ea65369246dabd850ba1e4
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1496062
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ruicheng Dai <rdai@nvidia.com>
Tested-by: Ruicheng Dai <rdai@nvidia.com>
GVS: Gerrit_Virtual_Submit

6 years agomisc: nct1008: fix NULL ptr access in get_trend
Srikar Srimath Tirumala [Wed, 24 May 2017 02:10:07 +0000 (19:10 -0700)]
misc: nct1008: fix NULL ptr access in get_trend

Return a stable trend when trend is queried during boot before
all the pointers are initialized.

Bug 200311672

Change-Id: I6b03b266b868ac1bd6e39ea63078d24e273bc327
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1488401
(cherry picked from commit f507b9b74fede1e1adac02c295e0f3666c4a7674)
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1492084
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
6 years agomedia:camera: Fix s_stream and s_power sequence
Wenjia Zhou [Mon, 5 Jun 2017 23:05:00 +0000 (16:05 -0700)]
media:camera: Fix s_stream and s_power sequence

Bug 1920440
Bug 200295634

Change-Id: I1f268b709821f327aad9d426e0544370824beae3
Signed-off-by: Wenjia Zhou <wenjiaz@nvidia.com>
Reviewed-on: http://git-master/r/1479671
(cherry picked from commit 37351f2e9ad9056755b949a59f5c817cddcbb606)
Reviewed-on: http://git-master/r/1490063
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
6 years agomedia:i2c: enter sw standby mode after reset
Wenjia Zhou [Thu, 25 May 2017 23:11:09 +0000 (16:11 -0700)]
media:i2c: enter sw standby mode after reset

Bug 1920440

Change-Id: I02815655b7ff817b543a8ded2929b5d2cf22593b
Signed-off-by: Wenjia Zhou <wenjiaz@nvidia.com>
Reviewed-on: http://git-master/r/1490060
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>
6 years agonet: wireless: bcmdhd: check for kthread_run error
Manikanta [Thu, 1 Jun 2017 10:05:54 +0000 (15:35 +0530)]
net: wireless: bcmdhd: check for kthread_run error

Issue: wifiloader service loads bcmdhd module.
During encryption wifiloader service is kiiled,
when bcmdhd driver is loading. In this scenario
bcmdhd driver is crashing because kthread_run()
failure is not handled.

Fix: Return error code if kthread_run() fails.

bug 200313463

Change-Id: Iac66146f314305940b65060558908b34831696ce
Signed-off-by: Manikanta <mmaddireddy@nvidia.com>
Reviewed-on: http://git-master/r/1493916
(cherry picked from commit c08ef77295c22793baacb6edcf42ce662269f169)
Reviewed-on: http://git-master/r/1496717
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
6 years agofbcon: update mode before enabling controller
Naveen Kumar S [Mon, 5 Jun 2017 09:14:03 +0000 (14:44 +0530)]
fbcon: update mode before enabling controller

When switching from a graphical mode (X) to text mode (fbconsole),
fbconsole enables display controller and then updates screen
resolution. If the previous graphical userspace client's mode was
different from fbconsole's mode, DC and fbconsole will get enabled
with different modes. Hence, first update screen with fbconsole's
resolution and then unblank/enable DC.

bug 1885932

Change-Id: I6772ebf075f5448381a8c8df65da1fd6daec689f
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/1495926
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
6 years agoufs: tegra: Init mphy_force_ls_mode clock handle.
Naveen Kumar Arepalli [Mon, 5 Jun 2017 09:18:42 +0000 (14:48 +0530)]
ufs: tegra: Init mphy_force_ls_mode clock handle.

-Init mphy_force_ls_mode clock handle before using it.

Bug 200278112

Change-Id: I20c1565f7365285539ed7799a2e40102ace09d56
Signed-off-by: Naveen Kumar Arepalli <naveenk@nvidia.com>
Reviewed-on: http://git-master/r/1495911
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
6 years agodrivers: camera: Mode selection logic
Bhanu Murthy V [Fri, 19 Aug 2016 00:08:21 +0000 (17:08 -0700)]
drivers: camera: Mode selection logic

Segregate mode selection logic into standard
and special types. Standard mode selection
will be based on pixel format and special type
selection will depend on sensor settings defined
by controls.

Bug 200214096
Bug 200227485

Change-Id: Ic020017ddf635aa5662370903efd660150d319be
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: http://git-master/r/1204713
(cherry picked from commit f551889dd77b04b095cb4064eea33bf8151fa57a)
Reviewed-on: http://git-master/r/1483448
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Frank Chen <frankc@nvidia.com>
Tested-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Hu He <hhe@nvidia.com>
Reviewed-by: Shantanu Nath <snath@nvidia.com>
6 years agovideo: fbmem: assign bpp value for var_screeninfo
Naveen Kumar S [Wed, 31 May 2017 10:07:45 +0000 (15:37 +0530)]
video: fbmem: assign bpp value for var_screeninfo

bits per pixel is not specified in few scenarios.
E.g.: Modes set through nvdisp_setmode.
In such cases, fbconsole fails during subsequent
operations. Hence assign bpp value from previous mode
if bpp is not set.

bug 200277699

Change-Id: I154ce70b9c67c0ca99b0efc71b2c0cf120b07ef3
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/1492910
GVS: Gerrit_Virtual_Submit
Reviewed-by: Tow Wang <toww@nvidia.com>
Reviewed-by: Santosh Galma <galmar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
6 years agodmaengine: tegra-adma: Fix system suspend handling
Jon Hunter [Tue, 23 May 2017 15:51:25 +0000 (16:51 +0100)]
dmaengine: tegra-adma: Fix system suspend handling

If ADMA is active when system suspend occurs, it is not suspended and
hence, the state and clock configuration is not handled correctly in
the suspend path.

Add proper system suspend and resume callbacks to ensure that the ADMA
is suspended and resumed if active when system suspend occurs.

Finally, make the system suspend callbacks for the ADMA late suspend
callbacks to ensure that the sound core has suspended any on-going
activity, including stopping the ADMA if active, before we attempt to
suspend the ADMA.

Bug 200275736

Change-Id: I7f24b5f21ad8ec76e5c129a1d384d11f6fc040a8
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1488954
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
6 years agoASoC: tegra-alt: Fix system suspend handling
Jon Hunter [Tue, 23 May 2017 15:44:28 +0000 (16:44 +0100)]
ASoC: tegra-alt: Fix system suspend handling

There are a couple issues with system suspend handling in the Tegra
ASoC codec drivers which are:

1. Most drivers the system suspend callback does nothing and this
   means that if the codec device is active when suspend occurs then
   the codec will not be suspended correctly. This has been seen to
   cause system crashes in the I2S driver when the system is suspended
   and resuming while audio playback is active.

2. The codec suspend handlers may be called twice when entering
   suspend. Suspend handlers should only be called once, but currently
   they are called twice; once by the PM core and once when the APE
   power-domain is turned off (if it is on when suspend occurs).

Fix the above two problems by:

a). Adding proper system suspend and resume handlers for all codec
    drivers, to suspend and resume the device if not runtime PM
    suspended on entering suspend.
b). Remove the code to call the PM callbacks from the APE power-domain
    code.

Finally, make the system suspend callbacks for these codec drivers
late suspend callbacks to ensure that the sound core has suspended
any on-going activity, before we attempt to suspend these codec
devices.

Bug 200275736

Change-Id: I09d7e570be4e1866683873591ff76be63fdaf3fb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1488953
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
6 years agovideo:tegra:camera: Cap request at max BW
Peter Mikolajczyk [Wed, 24 May 2017 00:34:43 +0000 (17:34 -0700)]
video:tegra:camera: Cap request at max BW

    Have the camera platform driver cap the
    bw request at max instead of failing if
    a request is too high.

    Bug 1874022

Change-Id: I33d61382248687b30a833d4590b12cb33bc4c7d4
Signed-off-by: Peter Mikolajczyk <pmikolajczyk@nvidia.com>
Reviewed-on: http://git-master/r/1488353
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
6 years agoASoC: tegra-alt: Fix parent runtime PM handling
Jon Hunter [Mon, 22 May 2017 15:02:11 +0000 (16:02 +0100)]
ASoC: tegra-alt: Fix parent runtime PM handling

Linux runtime PM automatically handles the runtime resuming and
suspending of a parent device and therefore, it is not necessary
for a child device to explicitly runtime resume or suspend the
parent.

The various Tegra ASoC codec drivers explicitly runtime resume
and suspend the parent device from within their runtime PM callback
handler. This should not be necessary.

Furthermore, currently the various Tegra ASoC codec drivers are
not suspended correctly if active when system suspend occurs. During
system suspend it is common to directly call the runtime PM callbacks
to suspend and resume the device if active from the system suspend
callbacks. However, the APIs, pm_runtime_get/put(), cannot be called
during system suspend and so the runtime PM callbacks for these codec
drivers cannot be called from the context of the system suspend
callbacks.

Remove the calls to runtime resume and suspend the parent device from
the runtime PM callbacks for the various Tegra ASoC drivers. This will
allow us to fix suspending and resuming of the Tegra ASoC drivers
across system suspend.

Bug 200275736

Change-Id: Ia2c954f206ed0276c6d54627f274e6a713d88a6f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1487805
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
7 years agodrivers: media: vivid: Support packed 10bit bayer
Bhanu Murthy V [Wed, 15 Feb 2017 23:43:25 +0000 (15:43 -0800)]
drivers: media: vivid: Support packed 10bit bayer

Add support for packed 10bit formats in vivid driver.
Add/Modify tpg apis for new format support.

Bug 1879822
Jira CHWI-798

Change-Id: Ib3865f56a11f0f38632b8022faa528408dc1d555
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: http://git-master/r/1484689
(cherry picked from commit 7e2d4d3c5ed82999cac5d942fc478c3a224c00da)
Reviewed-on: http://git-master/r/1493379
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
7 years agoASoC: rt5659: cancel worker queue on suspend
Mohan Kumar [Wed, 31 May 2017 10:51:24 +0000 (16:21 +0530)]
ASoC: rt5659: cancel worker queue on suspend

Cancel the worker queue on the suspend path.

Bug 200309778

Change-Id: I7fab2b49e48200a20778314ff37d4e29f4dd8844
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1492957
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
7 years agommc: tegra: Detect non-removable device presence status
Pavan Kunapuli [Tue, 23 May 2017 06:33:01 +0000 (12:03 +0530)]
mmc: tegra: Detect non-removable device presence status

If detect-non-removable-device dt property is set, enable
support for detection of device presence status for non-removable
devices.

Bug 1855363

Reviewed-on: http://git-master/r/1487871
(cherry picked from commit a9b953a145531061671c991b90382b777ec54a7b)
Change-Id: I3a7c7bcc255c08020720cb0ce8c8cf8584aa8a21
Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-on: http://git-master/r/1491870
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
7 years agonet: wireless: bcmdhd: Allow sdio device rescan
Pavan Kunapuli [Tue, 23 May 2017 11:13:56 +0000 (16:43 +0530)]
net: wireless: bcmdhd: Allow sdio device rescan

SDIO devices are marked as non-removable devices in mmc stack.
To reenumerate SDIO, clear rescan_entered flag before issuing
mmc detect.

Bug 1855363

Reviewed-on: http://git-master/r/1487872
(cherry picked from commit 04673c8d82f4b7b1edebd4cfd06f08890d2a0f3a)
Change-Id: I3b0eee7acab9e1ddace44cd052da65c606643857
Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-on: http://git-master/r/1491869
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
7 years agommc: core: Check non-removable device presence status
Pavan Kunapuli [Tue, 23 May 2017 06:29:14 +0000 (11:59 +0530)]
mmc: core: Check non-removable device presence status

Provide option to check for the presence of non-removable devices.
This would be used for devices like SDIO that are not physically
removed but would have to be re-enumerated when Wifi module is loaded
or unloaded.

Bug 1855363

Reviewed-on: http://git-master/r/1487870
(cherry picked from commit e5024d7fdbad87d6438607505608f0e6a6ee2f5f)

Change-Id: Idd3485e71c10fbb0dfef920deda322a6ee0f7f29
Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-on: http://git-master/r/1491868
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
7 years agogpio: of: Add support for making pin in non-GPIO mode from DT
Laxman Dewangan [Thu, 9 Mar 2017 13:04:21 +0000 (18:34 +0530)]
gpio: of: Add support for making pin in non-GPIO mode from DT

Add support to make the pin to make as non-GPIO mode from DT.
This will help to make the pin in function mode if bootloader
made it to GPIO mode.

Bug 200305703

Change-Id: I8cfc31b551bb16d1eac7c1f8d280655a1f028cb1
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1317924
(cherry picked from commit 6ce5123fd9cfbbb8cac92ec8f8b13cbc206af3c5)
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1491906

7 years agoarm64: config: t210: enable ACTMON
Shreshtha SAHU [Fri, 19 May 2017 15:25:41 +0000 (20:55 +0530)]
arm64: config: t210: enable ACTMON

Bug 200305406

boot.img size is increased by 16816 bytes

Change-Id: I2eae9b0ed4ddf27903e158407d4cb75c149cc779
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1485999
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Puneet Saxena <puneets@nvidia.com>
7 years agodrivers: tegra: t21x: actmon: add bwmgr suport
Shreshtha SAHU [Fri, 19 May 2017 13:14:30 +0000 (18:44 +0530)]
drivers: tegra: t21x: actmon: add bwmgr suport

  Add BWMGR support
  Remove obsolute TEGRA_CLK_FRAMEWORK APIs
  Use COMMON_CLK APIs
  Cleanup of function returns

Bug 200305406

Change-Id: I33ceed2478bca99daf0b6b945dac9aa1d69e0ea0
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1485998
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
7 years agonet: eqos: fix timeout error
Bhadram Varka [Wed, 22 Mar 2017 11:24:42 +0000 (16:54 +0530)]
net: eqos: fix timeout error

Issue: EQOS trying to access the PHY registers through
mdiobus_write/read from the phy_change IRQ handler.
At this stage PHY is not in proper state to respond
to the register read/write which leads to below timeout -

[   18.116266] Decoded FIFO Entry: 0
[   18.116267]  Direction: READ
[   18.116268]  Bridge ID: 0x9
[   18.116270]  Error Type: 0x12 -- Timeout error
[   18.116271]  Length: 0
[   18.116274]  Protection: 0x2 -- Unprivileged, Non-Secure, Data Access
[   18.116276]  Source ID: 0x1 -- CCPLEX
[   18.116277]  AXI_ID: 0x4 -- A57 Core 0
[   18.116279]  Cache: 0x1 -- Device
[   18.116280]  Burst: 0x1
[   18.116310]  Address: 0x2490200 (Unknown Device)

Fix: Start the PHY while bringup the interface and
stop the PHY while the interface is going down.

Bug 200284385

Change-Id: Ib557f49b11f857f214b245e0284e045c8b4981d9
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: http://git-master/r/1488009
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Tested-by: Narayan Reddy <narayanr@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
7 years agoASoC: tegra-alt: Dump APE register for debugging
Mohan Kumar [Wed, 10 May 2017 06:59:49 +0000 (12:29 +0530)]
ASoC: tegra-alt: Dump APE register for debugging

Add support with a mixer control using which APE register
status can be dumped from userspace during an error or
while debugging.

Bug 200307023

Change-Id: I489bdaeeec16975a872b9b145a1672f3f4ef1928
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1478879
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
7 years agofirmware: tegra: do not fail probe if debugfs is missing
Sivaram Nair [Wed, 24 May 2017 17:29:14 +0000 (10:29 -0700)]
firmware: tegra: do not fail probe if debugfs is missing

There is no reason to fail probe (and thereby deny all bpmp services to
kernel) when debugfs is absent (or its creation failed).

Bug 1929129

Change-Id: I28d6632945afdac00815caf71e51fff90e31c6bc
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/1489030
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arun Kannan <akannan@nvidia.com>
Tested-by: Arun Kannan <akannan@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
7 years agosoc: tegra: pmc: DT add wake fix
Bitan Biswas [Wed, 26 Apr 2017 12:37:08 +0000 (18:07 +0530)]
soc: tegra: pmc: DT add wake fix

tegra_of_device_add_pmc_wake was ignoring
device's own nvidia,pmc-wakeup attribute when
child nodes were present. Process own attribute
first before processing child nodes.
 - T21x wake support is through DT
   and does not use built-in wakeups table
 - tegra210-comms-p2530-0930.dtsi has
   WAKE8 in bcmdhd_wlan node

Bug 200298115
Bug 1811733
Bug 200306539

Change-Id: Id14cca693c7eb05c09969fdd8256aa72e2067327
Reviewed-on: http://git-master/r/1470483
(cherry picked from commit aa931b2cb27cad77d5b83e928f5402bbb9a682dc)
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: http://git-master/r/1488524
Tested-by: R Raj Kumar <rrajk@nvidia.com>
Reviewed-by: Joseph Lo <josephl@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
7 years agoi2c: tegra: flush fifos after enabling the clock
Shardar Shariff Md [Mon, 22 May 2017 08:00:04 +0000 (13:30 +0530)]
i2c: tegra: flush fifos after enabling the clock

I2C controller registers should be accessed after enabling the clock
but during multi packet feature addition (commit: 3af1f17167)
mistakenly i2c registers (fifo flush) access is done before clock is
enabled. This issue was missed as clock never disabled once clock got
enabled. Moving flushing fifos(accessing controller registers) after
clock enable to fix this issue.

Bug 200267979

Change-Id: I731b05c0a57b377e6780b4359c401f728b92542b
Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
(cherry picked from commit 785da1bf8a88c0ea7a50a7172c055b87c744a223)
Reviewed-on: http://git-master/r/1489038
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
7 years agogpio: tegra: add early_resume support
Suresh Mangipudi [Tue, 16 May 2017 10:30:37 +0000 (16:00 +0530)]
gpio: tegra: add early_resume support

GPIO resume needs to happen early in the resume process
to ensure proper functioning of the peripheral drivers.

This change moves the GPIO resume to early_resume.

Bug 200298115

Change-Id: Ifda130b2c031dfc605dd7c0a297f5389dc8f4b23
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/1482938
(cherry picked from commit fe8ced21e938523484fffc5890478f7994a73628)
Reviewed-on: http://git-master/r/1487957
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
7 years agopm/resume: Add support for early resume
Suresh Mangipudi [Tue, 16 May 2017 10:26:11 +0000 (15:56 +0530)]
pm/resume: Add support for early resume

Sometimes, there is a need to sequence the resume of different
drivers regardless of their registration. For example, for Tegra
platform, GPIO resume should be before the pinmux resume to avoid
glitch. On this, GPIO resume will configure the GPIO control
register before pins are enable after resume.

Add support to have the early_resume() callback which get called
before resume() so that respective driver's resume can be sequenced
over other drivers.

Bug 200298115

Change-Id: I794f6aea613a30cda8ba5decbf8ce62571c8e44b
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/1482937
(cherry picked from commit 73fa1fcde1982ea05f83b39f6d0281d8b10c968e)
Reviewed-on: http://git-master/r/1487954
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
7 years agoAdding NOTASSOCIATED FW error to disconnect wifi
Mahesh Patil [Mon, 27 Mar 2017 20:05:09 +0000 (13:05 -0700)]
Adding NOTASSOCIATED FW error to disconnect wifi

Adding NOTASSOCIATED error from FW to Disconnect wifi and
setting disconnect timer to 5 sec

Bug 200215502
Bug 200305758
Bug 200308970

Change-Id: I205f6a73780f5a5980851cb805c263e2ed9270c1
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
(cherry pick from commit f3e9994f9d2a12dea5a65df10a268dda5351c5a8)
Reviewed-on: http://git-master/r/1482285
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
7 years agonet: wireless: bcmdhd: Integrate following changes
Srinivas Ramachandran [Sat, 15 Apr 2017 01:19:58 +0000 (18:19 -0700)]
net: wireless: bcmdhd: Integrate following changes

e1a3aa1 net: wireless: bcmdhd: Re-set country code on CSA completion
5d50d5b net: wireless: bcmdhd: Re-set country code on disconnection

Bug 1883430
Bug 200305758
Bug 200308970

Change-Id: Ib3a88debe88b3e8df2613b4f1dc8d043b2bf1a31
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: http://git-master/r/1467783
(cherry picked from commit b705e20dc4c54288db1f20d8de39c68d0357929a)
Reviewed-on: http://git-master/r/1482315
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
7 years agoASoC: tegra-alt: update buffer size in HW params
Ahung Cheng [Mon, 22 May 2017 07:04:16 +0000 (15:04 +0800)]
ASoC: tegra-alt: update buffer size in HW params

Update buffer_bytes_max in HW params to match
the pre-allocated dma size.

bug 200299289

Change-Id: I8a74b053f3f811287506d5417bd7452a73d40ac0
Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
Reviewed-on: http://git-master/r/1486857
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
7 years agoRevert "Revert "Revert "TEMP: crypto: tegra-se: disable suspend-resume handlers"""
Shravani Dingari [Thu, 20 Apr 2017 08:59:01 +0000 (01:59 -0700)]
Revert "Revert "Revert "TEMP: crypto: tegra-se: disable suspend-resume handlers"""

This reverts commit 708ddc371c5111de11a498012cdf3dd00cc882aa.

Revert this patch to enable SE suspend/resume handlers

Bug 200292437
Bug 200298273
Bug 200305065
Bug 200305051

Change-Id: I1be9abd635e269ce8c235f2c7ad6eb36642023b9
Signed-off-by: Shravani Dingari <shravanid@nvidia.com>
Reviewed-on: http://git-master/r/1466588
(cherry picked from commit 0b2321a2672a04287315f73733c8e8e4a424dd77)
Reviewed-on: http://git-master/r/1482867
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
7 years agotegra-se: use GFP_DMA instead of GFP_DMA32
Shravani Dingari [Wed, 10 May 2017 05:13:30 +0000 (10:43 +0530)]
tegra-se: use GFP_DMA instead of GFP_DMA32

Use GFP_DMA while allocating dma buffers
as DMA32 flag is depreciated

Bug 200292437

Change-Id: I6ce5608fa9a2eaf313940b6dec35bb0dc255ab54
Signed-off-by: Shravani Dingari <shravanid@nvidia.com>
Reviewed-on: http://git-master/r/1478788
(cherry picked from commit 8f3f1827fa2f846aeec33626ca7bb07f67caff0e)
Reviewed-on: http://git-master/r/1482879
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
7 years agoadma: tegra: fix the adma get position
Mohan Kumar [Tue, 16 May 2017 05:59:32 +0000 (11:29 +0530)]
adma: tegra: fix the adma get position

The two adma registers for dma position are read while
adma is transferring data. That might be a case when we
read the second register "TRANSFER_STATUS", the first
register "TRANSFER_DONE_COUNT" gets increment.

Bug 200265734

Change-Id: I252d3b1e384e3aaa937bd7318b0d217abe1e5b41
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1482558
Reviewed-by: Ahung Cheng <ahcheng@nvidia.com>
Tested-by: Ahung Cheng <ahcheng@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
7 years agoARM64: config: t186: Enable MTD and TIGON3
Jeetesh Burman [Wed, 17 May 2017 05:56:30 +0000 (11:26 +0530)]
ARM64: config: t186: Enable MTD and TIGON3

Enable below configs to support MTD:

CONFIG_MTD=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_QSPI_FLASH=y
CONFIG_MTD_UBI=m

And enable Broadcom gigabit Etheret PCIe cards:
CONFIG_TIGON3=y

boot.img size is increased by 216680 bytes

Bug 200284769

Change-Id: I716d477a8d973bf0847ba486279543bbc4356656
Signed-off-by: Jeetesh Burman <jburman@nvidia.com>
Reviewed-on: http://git-master/r/1483677
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
7 years agopcie: host: disable AFI dynamic clock gating
Ken Chang [Tue, 25 Apr 2017 04:46:02 +0000 (12:46 +0800)]
pcie: host: disable AFI dynamic clock gating

Override AFI clock enable to disable dynamic clock gating logic.

Bug 1885717
Bug 200285927
Bug 200267819

Change-Id: I15a4f67f0a0fd0fb5d28504f9317a9228fca9531
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: http://git-master/r/1469192
(cherry picked from commit fbacedca8e25ebc5400191156316efc52edc3888)
Reviewed-on: http://git-master/r/1482582
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
7 years agoclocksource: arm64: register unsecure timer only
Bo Yan [Thu, 27 Apr 2017 22:59:25 +0000 (15:59 -0700)]
clocksource: arm64: register unsecure timer only

Only register non-secure timer for ARM64 kernel. This is to
eliminate the conflict between kernel and secure OS.

Since ARM kernel can run in secure state, leave it unchanged.

bug 1838070

Change-Id: I1aa9fcaab4c818c6badb3a7040723cf743484fb3
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/1471666
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
(cherry picked from commit 88cb8e8bb6376d28c17df6e580681707a6b5dfa6)
Reviewed-on: http://git-master/r/1484960

7 years agoarm64: config: enable more USB gadget drivers
Stephen Warren [Wed, 19 Apr 2017 16:47:13 +0000 (10:47 -0600)]
arm64: config: enable more USB gadget drivers

This enables all options required to implement the USB protocols that L4T
wishes to expose over the USB flashing port in device mode.

- ACM for serial port access.
- RNDIS for Ethernet access from Windows (or Linux).
- ECM for Ethernet access from MacOS (or Linux).
- Bridge support to bridge the two Ethernet interfaces to a single IP
  address so users don't require different IPs depending on the protocol
  their OS uses. This also simplifies documentation.
- Loop block device support so that the L4T system can also mount the
  filesystem image that is exported over USB Mass Storage.

boot.img size increased by 140384 (T210), 120552 (T186).
(Note: boot.img taken as L4T's Image file, since these are L4T defconfigs)

Bug 1882292

Change-Id: I77cc313dcad505d5d8056c76a55a08a800c676f7
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: http://git-master/r/1469845
(cherry picked from commit 0a36077dea7cdedace721b33c38ba9b0c9b69e09 in dev-kernel)
Reviewed-on: http://git-master/r/1484123
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
7 years agoclk: tegra: Fix shared bus connector rate update
Alex Frid [Tue, 25 Apr 2017 01:51:00 +0000 (18:51 -0700)]
clk: tegra: Fix shared bus connector rate update

When connector rate is updated the result cannot be used directly to
set new rate, since it represents only users of this connector, and
does not take into account rates of the sibling connector (if any).
Instead, rate update of the parent (top level bus) should be called
recursively.

Bug 1903909
Bug 200269751

Change-Id: Ic2b36767c3a53c6ed584e4f5199ff4ebdf02e92e
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/1469100
(cherry picked from commit 9c854a599810da951613012a4b461b16cb1d501c)
Reviewed-on: http://git-master/r/1480205
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
7 years agommc: tegra: add nvquirk to skip RTPM forbid call
R Raj Kumar [Tue, 21 Mar 2017 05:06:21 +0000 (10:36 +0530)]
mmc: tegra: add nvquirk to skip RTPM forbid call

Add new nvquirk to skip RTPM forbid call on
t21x platforms.
pm_runtime_forbid() added in driver to ensure
that minimum clk supplied to sdhci instances
even in device shutdown state.

Bug 200296714
Bug 200286161
Bug 200290400

Change-Id: Ieb7da83589381d8c1bbcfd0d79150bc5db09850a
Signed-off-by: R Raj Kumar <rrajk@nvidia.com>
Reviewed-on: http://git-master/r/1324875
(cherry picked from commit ecfd0ea3e7e2583126c6b24e5ff7726fdcb13b0e)
Reviewed-on: http://git-master/r/1483823
Tested-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
7 years agoplatform: tegra: mc: mcerr: Refactor mcerr code
Krishna Reddy [Wed, 17 May 2017 03:48:05 +0000 (20:48 -0700)]
platform: tegra: mc: mcerr: Refactor mcerr code

Refactor the mcerr code to make the abstraction across SOC's cleaner
and readable.

Bug 1915984

Change-Id: I41ebf722f8e8927389a13a85c581d4be8b5ea3d9
Reviewed-on: http://git-master/r/1473034
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/1483617
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
7 years agoplatform:tegra:camera: changed vi4_init
Hien Goi [Mon, 15 May 2017 21:58:13 +0000 (14:58 -0700)]
platform:tegra:camera: changed vi4_init

-writes to CFG_INTERRUPT_MASK and CFG_INTERRUPT_STATUS were causing
vi master error messages and the writes to stall
-removed those writes in vi4_init as they are not needed
-moved vi4_init below check for bypass

Bug 1906966

Change-Id: I6552eebc8f10e8059bcdf7de4aa883f55d607047
Signed-off-by: Hien Goi <hgoi@nvidia.com>
Reviewed-on: http://git-master/r/1482282
(cherry picked from commit ad0dc28fbd03d005500b5bd3b821c730bcaa4a0e)
Reviewed-on: http://git-master/r/1483480
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nathan Lord <nlord@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
7 years agodriver: i2c: Disable dma in I2C-VI by default
Jacob Rampertab [Wed, 10 May 2017 17:54:50 +0000 (10:54 -0700)]
driver: i2c: Disable dma in I2C-VI by default

Sets Dma in I2C-VI driver to disabled by default. Removes double
negative by changing var name.

Bug 200302441

Change-Id: Ic56b760f22bc97c90d3fc1cb7a36f7cf217f5640
Reviewed-on: http://git-master/r/1479306
Tested-by: Jacob Rampertab <jrampertab@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: David Wang (SW-TEGRA) <davidw@nvidia.com>
Reviewed-by: Bhanu Murthy V <bmurthyv@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
7 years agomisc: tegra-profiler: fix crash in power_clk stop
Igor Nabirushkin [Fri, 5 May 2017 11:56:59 +0000 (15:56 +0400)]
misc: tegra-profiler: fix crash in power_clk stop

Fix crash in profiler when using gpu and emc clocks: using
the freed clock source can cause the kernel panic.
Remove redundant clk_get_sys calls.

Bug 1918185

Change-Id: I421049c7a30fad6356f7300226e84794cecf0673
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/1476299
(cherry picked from commit 8b0d7e1748b31dd87ab2837a6b9f0a1d2e3d6ecc)
Reviewed-on: http://git-master/r/1482967
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dmitry Antipov <dantipov@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
7 years agoRevert "tegra-profiler: workaround for clks"
Igor Nabirushkin [Tue, 16 May 2017 10:31:40 +0000 (14:31 +0400)]
Revert "tegra-profiler: workaround for clks"

Revert this workaround since the main problem was resolved.
This reverts commit 8c74f1d64dc906ea66ad539ed45b86ac418a5491.

Bug 1918185

Change-Id: I8e30f4d5d4f4706d81fc470e44cd515baa38f613
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/1482966
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dmitry Antipov <dantipov@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
7 years agommc: core: Add power_restore and power_save func
Anubhav [Thu, 6 Apr 2017 11:47:32 +0000 (17:17 +0530)]
mmc: core: Add power_restore and power_save func

-Add definition of power_restore and power_save function.
In power_save function, disabling ESM.

Bug 200215393

Change-Id: Ied94fb95ee30989f5f3f4def05e1c7ac6c8c834b
Signed-off-by: Anubhav <anubhavj@nvidia.com>
Reviewed-on: http://git-master/r/1480648
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
7 years agommc: card: switching form CQ mode to normal mode
Anubhav [Wed, 12 Apr 2017 13:03:44 +0000 (18:33 +0530)]
mmc: card: switching form CQ mode to normal mode

-Since CQ needs to be disabled before invoking FFU, so
switching to normal mode from CQ mode before invoking FFU.

Bug 200215393

Change-Id: Idacf23b4dc16da1a7c1f061b1d35f337350e5107
Signed-off-by: Anubhav <anubhavj@nvidia.com>
Reviewed-on: http://git-master/r/1480647
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
7 years agoarm64: configs: t18x: enable FFU
Anubhav [Tue, 25 Apr 2017 17:27:59 +0000 (22:57 +0530)]
arm64: configs: t18x: enable FFU

boot.img size is increased by 2048 bytes

Bug 200215393

Change-Id: I31446c330258a9ee421f5fed5af95e856eb96191
Signed-off-by: Anubhav <anubhavj@nvidia.com>
Reviewed-on: http://git-master/r/1480646
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
7 years agonet: wireless: bcmdhd: fix buffer overrun in wl_android_set_roampref
Insun Song [Wed, 1 Feb 2017 00:18:40 +0000 (16:18 -0800)]
net: wireless: bcmdhd: fix buffer overrun in wl_android_set_roampref

added boundary check not to override allocated buffer.
Specially when user input corrupted or manipulated.

Signed-off-by: Insun Song <insun.song@broadcom.com>
Change-Id: Id6196da10111517696eda5f186b1e2dd19f66085
Bug: 34469904
Reviewed-on: http://git-master/r/1478926
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gagan Grover <ggrover@nvidia.com>
Tested-by: Sunny Li <sunnyl@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agonet: wireless: bcmdhd: fix buffer overrun in wlfc reordering
Insun Song [Wed, 25 Jan 2017 19:41:49 +0000 (11:41 -0800)]
net: wireless: bcmdhd: fix buffer overrun in wlfc reordering

added boundary check not to override allocated buffer

Signed-off-by: Insun Song <insun.song@broadcom.com>
Change-Id: Iad44141ba4e4cd224eda292c05ffe525bf74227d
Bug: 34203305
Reviewed-on: http://git-master/r/1478923
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gagan Grover <ggrover@nvidia.com>
Tested-by: Sunny Li <sunnyl@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agosdcardfs: limit stacking depth
Andrew Chant [Wed, 8 Feb 2017 23:33:48 +0000 (15:33 -0800)]
sdcardfs: limit stacking depth

Limit filesystem stacking to prevent stack overflow.

Bug: 32761463
Change-Id: I8b1462b9c0d6c7f00cf110724ffb17e7f307c51e
Signed-off-by: Andrew Chant <achant@google.com>
Reviewed-on: http://git-master/r/1478888
GVS: Gerrit_Virtual_Submit
Tested-by: Sunny Li <sunnyl@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agonet: wireless: bcmdhd: fix buffer overrun in wl_cfg80211_add_iw_ie
Insun Song [Wed, 1 Feb 2017 03:57:20 +0000 (19:57 -0800)]
net: wireless: bcmdhd: fix buffer overrun in wl_cfg80211_add_iw_ie

added boundary check not to override allocated buffer.

Signed-off-by: Insun Song <insun.song@broadcom.com>
Change-Id: I76211db7ef595fc41cf5d5d58de79cedfe80e521
Bug: 32125310
Reviewed-on: http://git-master/r/1478872
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gagan Grover <ggrover@nvidia.com>
Tested-by: Sunny Li <sunnyl@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agoFROMLIST: CHROMIUM: usb: gadget: configfs: Fix KASAN use-after-free
Jim Lin [Fri, 13 Jan 2017 08:07:58 +0000 (16:07 +0800)]
FROMLIST: CHROMIUM: usb: gadget: configfs: Fix KASAN use-after-free

When gadget is disconnected, running sequence is like this.
. android_work: sent uevent USB_STATE=DISCONNECTED
. Call trace:
  usb_string_copy+0xd0/0x128
  gadget_config_name_configuration_store+0x4
  gadget_config_name_attr_store+0x40/0x50
  configfs_write_file+0x198/0x1f4
  vfs_write+0x100/0x220
  SyS_write+0x58/0xa8
. configfs_composite_unbind
. configfs_composite_bind

In configfs_composite_bind, it has
"cn->strings.s = cn->configuration;"

When usb_string_copy is invoked. it would
allocate memory, copy input string, release previous pointed memory space,
and use new allocated memory.

When gadget is connected, host sends down request to get information.
Call trace:
  usb_gadget_get_string+0xec/0x168
  lookup_string+0x64/0x98
  composite_setup+0xa34/0x1ee8
  android_setup+0xb4/0x140

If gadget is disconnected and connected quickly, in the failed case,
cn->configuration memory has been released by usb_string_copy kfree but
configfs_composite_bind hasn't been run in time to assign new allocated
"cn->configuration" pointer to "cn->strings.s".

When "strlen(s->s) of usb_gadget_get_string is being executed, the dangling
memory is accessed, "BUG: KASAN: use-after-free" error occurs.

BUG=chrome-os-partner:58412
TEST=After smaug device was connected to ubuntu PC host, detached and attached
type-C cable quickly several times without seeing
"BUG: KASAN: use-after-free in usb_gadget_get_string".

Bug 31614969
Change-Id: I58240ee7c55ae8f8fb8597d14f09c5ac07abb032
Signed-off-by: Jim Lin <jilin@nvidia.com>
Signed-off-by: Siqi Lin <siqilin@google.com>
(am from https://chromium-review.googlesource.com/#/c/428059/3)
Reviewed-on: http://git-master/r/1475581
Tested-by: Sunny Li <sunnyl@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agoenable ARCH_HAS_ELF_RANDOMIZE again
Sahara [Sun, 4 Dec 2016 08:50:18 +0000 (12:50 +0400)]
enable ARCH_HAS_ELF_RANDOMIZE again

The patch e4622e4 somehow accidentally removed ARCH_HAS_ELF_RANDOMIZE.
Without this option, arch_mmap_rnd(), called by load_elf_binary(), does
not work properly and just returns 0 instead even though a process has
PF_RANDOMIZE flag. As a result, dynamic program's mmap base is not
randomized at all.

Bug 33351919
Change-Id: Ice2df132dc436b647fa0312dd7453f9ed6160a2a
Signed-off-by: Sahara <keun-o.park@darkmatter.ae>
Reviewed-on: http://git-master/r/1475549
Tested-by: Sunny Li <sunnyl@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agoandroid: fiq_debugger: restrict access to critical commands.
Mark Salyzyn [Tue, 20 Dec 2016 23:59:19 +0000 (15:59 -0800)]
android: fiq_debugger: restrict access to critical commands.

Sysrq must be enabled via /proc/sys/kernel/sysrq as a security
measure to enable various critical fiq debugger commands that
either leak information or can be used as a system attack.

Default disabled, this will leave the reboot, reset, irqs, sleep,
nosleep, console and ps commands.  Reboot and reset commands
will be restricted from taking any parameters.  We will also
switch to showing the limited command set in this mode.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug 32402555
Change-Id: I3f74b1ff5e4971d619bcb37a911fed68fbb538d5
Reviewed-on: http://git-master/r/1475531
Tested-by: Sunny Li <sunnyl@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agonet: wireless: bcmdhd: remove unsed WEXT file.
Insun Song [Wed, 4 Jan 2017 00:21:01 +0000 (16:21 -0800)]
net: wireless: bcmdhd: remove unsed WEXT file.

WEXT API was already obsoleted and should be removed.

Change-Id: Iffb1c81afb9874120c64008c1072eebb8695c65f
Signed-off-by: Insun Song <insun.song@broadcom.com>
Bug 32124445
Reviewed-on: http://git-master/r/1475518
Tested-by: Sunny Li <sunnyl@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agoARM64: config: t186: Enable BLK_DEV_LOOP
Jeetesh Burman [Fri, 28 Apr 2017 11:13:43 +0000 (16:43 +0530)]
ARM64: config: t186: Enable BLK_DEV_LOOP

Enable CONFIG_BLK_DEV_LOOP to support mount.

Below failure observed without CONFIG_BLK_DEV_LOOP:
mount: /mnt/: mount failed: Unknown error -1

boot.img size not changed.

Bug 200301497

Change-Id: I90ffc26d032408007573bc63ab58fc0cc417891d
Signed-off-by: Jeetesh Burman <jburman@nvidia.com>
Reviewed-on: http://git-master/r/1472114
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
7 years agovideo: modedb: update vmode comparision
Naveen Kumar S [Wed, 10 May 2017 11:20:42 +0000 (16:50 +0530)]
video: modedb: update vmode comparision

To select full range quantization, userspace clears
LIMITED_RANGE flag in vmode. This shouldn't lead to
mode mismatch because the modes are still the same
even if LIMITED_RANGE flag doesn't match. Hence ignore
LIMITED_RANGE bit in vmode comparision while finding a
matching mode from modelist.

bug 200306471

Change-Id: I2b30e5232c5e0f2e2100adb674a6706a491d958a
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/1479088
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
7 years agoarch:arm64:config:Enable ISC and RTCPU defconfig
Aniket Bahadarpurkar [Tue, 4 Apr 2017 08:55:50 +0000 (14:25 +0530)]
arch:arm64:config:Enable ISC and RTCPU defconfig

This change adds CONFIG_VIDEO_ISC and CONFIG_TEGRA_CAMERA_RTCPU
to early boot defconfig. It enables to run capture from sys
partition using rtcpu

boot.img size increased by 101760 bytes

Bug 200288209

Change-Id: Ib731d16e0e037ccf4fd45629e0b72aef77f20b3d
Signed-off-by: Aniket Bahadarpurkar <aniketb@nvidia.com>
Reviewed-on: http://git-master/r/1454707
(cherry picked from commit 3f0b3c707f6e1c5aa9c400dcdf165434b98feeb5)
Reviewed-on: http://git-master/r/1470084
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Ranjith Kannikara <rkannikara@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
7 years agosound: tegra-alt: register ape-adma ISO_CLIENT only for t18x
Shreshtha SAHU [Mon, 17 Apr 2017 11:23:32 +0000 (16:53 +0530)]
sound: tegra-alt: register ape-adma ISO_CLIENT only for t18x

Bug 200285287

Change-Id: I93a4cac1b5824db6c74fd833e83987c5c82cbbc9
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1476380
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
7 years agoASoC: tegra-alt: add dma buffer size parse
Ahung Cheng [Tue, 18 Apr 2017 09:01:51 +0000 (17:01 +0800)]
ASoC: tegra-alt: add dma buffer size parse

Add dma-buffer-size parsing in device tree for pcm
driver to allocate required size for each pcm node

Bug 200299289

Change-Id: Ia579c66413912dd0ef7fda34cd47887eec3599f7
Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
Reviewed-on: http://git-master/r/1478988
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
7 years agoDon't show empty tag stats for unprivileged uids
Mohamad Ayyash [Fri, 10 Mar 2017 07:20:31 +0000 (15:20 +0800)]
Don't show empty tag stats for unprivileged uids

BUG: 27577101
BUG: 27532522
(cherry picked from commit d85e322ff3bc8d7aa872ad12df6427dd236e540a)

Bug 1806975

Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
Change-Id: I4451e6c3a1ccf0293a8ea4ffdf1822c8486ed605
Reviewed-on: http://git-master/r/1456874
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bobby Wang (SW-TEGRA) <bobwang@nvidia.com>
Reviewed-on: http://git-master/r/1478040
Reviewed-by: David Pearce <dpearce@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agoufs: tegra: Enable and Disable mphy_force_ls_mode.
Naveen Kumar Arepalli [Tue, 2 May 2017 06:23:31 +0000 (11:53 +0530)]
ufs: tegra: Enable and Disable mphy_force_ls_mode.

-Enable and Disable mphy_force_ls_mode to keep clocks
in default state.

Bug 200278112

Change-Id: Icc7a61d39976f48873694a5d61eec62a14271ee2
Signed-off-by: Naveen Kumar Arepalli <naveenk@nvidia.com>
Reviewed-on: http://git-master/r/1478096
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
7 years agodrivers: tegra: aotag: use dev_info for info
Shreshtha SAHU [Wed, 10 May 2017 04:04:54 +0000 (09:34 +0530)]
drivers: tegra: aotag: use dev_info for info

"Bound to TZ" and Probe messages are made info.

Bug 200300191

Change-Id: Ic13190d704d67683b2a4b7441a27e341bac50b85
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1478746
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
7 years agoarm64: configs: Enable EDP to LVDS config
Gaurav Singh [Tue, 9 May 2017 16:42:37 +0000 (22:12 +0530)]
arm64: configs: Enable EDP to LVDS config

Enable config TEGRA_EDP2LVDS_PS8625 to enable
EDP to lvds bridge. PS8625 is i2c slave chip
which has EDP to LVDS support. For L4T, the
display head will be treated as EDP, this chip
takes care of converting edp to lvds signals.

boot.img size is increased by 256 bytes

Bug 200278783

Change-Id: I6b805cc7cecd773a48c8ee6fad862bd52f97740a
Signed-off-by: Gaurav Singh <gaursingh@nvidia.com>
Reviewed-on: http://git-master/r/1477280
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
7 years agoASoC: tegra-alt: Avoid reg access after shutdown
Mohan Kumar [Thu, 4 May 2017 06:45:02 +0000 (12:15 +0530)]
ASoC: tegra-alt: Avoid reg access after shutdown

Below are the hypothetical scenarios
- Drivers are in suspend state while reboot and PCM Open call from
  userspace is received after driver shutdown [APE is power gated
  already]
- PM domain handling doesn't ensure proper functionality after driver
  shutdown is called

The change handles with the below fix
- ALSA PCM Open API first executes runtime resume of each driver.
  So need to prevent any reg access in runtime resume of drivers.
- ALSA PCM Open executes ADMAIF startup after runtime resume of
  each driver. If ADMAIF startup returns failure based on shutdown,
  PCM Open operation will fail, this will break PCM Open path and
  will ensure no further ALSA APIs/Callbacks are called.

Bug 200289815

Change-Id: Ia03e035569375f37ae4b0faa1a4593ce121d2354
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1475208
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
7 years agomedia: i2c: IMX185: Disable HSYNC output
Frank Chen [Mon, 1 May 2017 17:58:21 +0000 (10:58 -0700)]
media: i2c: IMX185: Disable HSYNC output

Disable HSYNC output by default, if frame sync
with other sensor is not needed. This will keep
XHS signal high and not generating interrupts.

Bug 200252886

Change-Id: Ibf97f6edf361f286b67c4cf61d4afc7a38ed8d18
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: http://git-master/r/1473063
(cherry picked from commit 1b9993919340dc3d2657ff6d4bd4a04f5ef8ed3e)
Reviewed-on: http://git-master/r/1474075
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Esen Chen <esenc@nvidia.com>
Reviewed-by: Saurabh Maniktala <smaniktala@nvidia.com>
7 years agodrivers: tegra: Fix build issues
Bhanu Murthy V [Thu, 4 May 2017 22:20:57 +0000 (15:20 -0700)]
drivers: tegra: Fix build issues

Remove vi4.h references in camera framework

Bug 200305322

Change-Id: I5e48551b272783b36e6ce1fa846c4e6c04480dcf
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: http://git-master/r/1476591
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhushan Rayrikar <brayrikar@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
7 years agotegra: platform: camera: fix channel open error
David Wang [Fri, 5 May 2017 19:59:11 +0000 (12:59 -0700)]
tegra: platform: camera: fix channel open error

Channel open error path calls close with out power on,
causing unbalanced power off call. Fixed by only closing
file handle.

Bug 200295163

Change-Id: I9c70aeea8a2220006ba3f958532ea0dac5ae71cb
Signed-off-by: David Wang <davidw@nvidia.com>
Reviewed-on: http://git-master/r/1475849
(cherry picked from commit d40ca4c535c8fadf77fb966977cac83ec671f121)
Reviewed-on: http://git-master/r/1476553
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
7 years agovideo: add DT node documentation for bridge chips
Deepak Bhosale [Thu, 27 Apr 2017 22:45:04 +0000 (15:45 -0700)]
video: add DT node documentation for bridge chips

- Documentation is added for following chips
  - SN65DSI86: DSI to eDP bridge
  - SN65DSI85: DSI to LVDS bridge
  - MAX9291:   HDMI to GMSL bridge
  - DS90UB948: FPDLINK to LVDS bridge
  - DS90UH949: HDMI to FPDLINK bridge

Bug 200295087
JIRA EVLR-1240

Change-Id: Icae438030b2b047c76d24bb5bf716d375054147d
Signed-off-by: Deepak Bhosale <dbhosale@nvidia.com>
Reviewed-on: http://git-master/r/1471662
(cherry picked from commit d9cd3f00609d2a1858395b884e079a9938324f55)
Reviewed-on: http://git-master/r/1476439
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vladislav Buzov <vbuzov@nvidia.com>
7 years agodrivers: nvadsp: dump current thread and last irq
Nitin Kumbhar [Thu, 4 May 2017 15:20:27 +0000 (20:50 +0530)]
drivers: nvadsp: dump current thread and last irq

Dump name (first 4 chars) of current thread and irq
number of last interrupt handled from hwmbox reg 4 and 7
respectively.

Bug 200295526

Change-Id: I4b53521cbfece2177e3cf6ed80b559b58e1d1c0a
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/1475487
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
7 years agodrivers: nvadsp: dump msgs for logs from suspend
Nitin Kumbhar [Thu, 4 May 2017 11:35:11 +0000 (17:05 +0530)]
drivers: nvadsp: dump msgs for logs from suspend

Add messages for states logged during ADSP suspend and
resume path.

Bug 200295526

Change-Id: I2b039744e6abfd8d30b6b78ec4f9c4acda7a13aa
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/1475428
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
7 years agoASoC: ad193x: Add support for more sampling rates
Jon Hunter [Thu, 27 Apr 2017 16:11:18 +0000 (17:11 +0100)]
ASoC: ad193x: Add support for more sampling rates

Currently, the AD193x codec only supports 48kHz sampling rates. The
orca-viper platform needs to support 44.1kHz, 48kHz and 96kHz. Update
the driver to add support for the various sample rates supported by the
codec. Please note that it is also necessary to update the list of
sysclk frequencies that is required to support these sample rates.

Finally add some more error checking for detecting any supported audio
configurations.

Bug 200286098

Change-Id: I10fa5f628f3d5db0c11550aae51324fcc44dfad0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1472225
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
7 years agoAsoc: tegra-alt: Allow machines to specify the fs-to-mclk ratio
Jon Hunter [Thu, 27 Apr 2017 16:09:44 +0000 (17:09 +0100)]
Asoc: tegra-alt: Allow machines to specify the fs-to-mclk ratio

For Tegra186 the Tegra utilities assumes that the codec MCLK frequency
is always 256x the sample-rate (fs). For the AD193x codecs this is not
always the case and for example, to support a 96kHz sampling rate, the
MCLK must be 128x the sample-rate. Therefore, add a new parameter,
'mclk_scale' to the Tegra clock data that specifies the scaling factor
that is used to calculate the MCLK frequency from the sample rate,
where the default is 256. This allows machine drivers to override this
default scale factor as necessary to support various sample rates.

Bug 200286098

Change-Id: Icba3116d80c3695a5575bfcd7cf202a724bd65d8
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1472224
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
7 years agoplatform: tegra: nvadsp: add adma reg dump
Nitin Kumbhar [Wed, 19 Apr 2017 11:22:43 +0000 (16:52 +0530)]
platform: tegra: nvadsp: add adma reg dump

Add ADMA regs as part of dump_adsp_sys() which is called
on irrecoverable errors on ADSP.

Bug 200295526

Change-Id: Iacb315d6b188d1b98085e59a86c74212246308da
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/1466422
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
7 years agoASoC: tegra-alt: support to dump adma register
Mohan Kumar [Wed, 19 Apr 2017 09:38:26 +0000 (15:08 +0530)]
ASoC: tegra-alt: support to dump adma register

Add support to dump all adma ch registers during hung trigger.

Bug 200295526

Change-Id: Ia59fe4d20fbee6471023084b7a779f0d70cdc5d5
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1466451
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Nitin Kumbhar <nkumbhar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
7 years agonvadsp: dump adsp state from hwmbox reg
Nitin Kumbhar [Fri, 30 Sep 2016 09:15:55 +0000 (14:45 +0530)]
nvadsp: dump adsp state from hwmbox reg

The state of ADSP is logged by writing to a mailbox
register. Adding support to kernel driver to dump ADSP
state when crash happens.

Jira EMA-404
Bug 1901511
Bug 1893324
Bug 200239577

Change-Id: Ia2beb84a7d5bc871f7062bd6a661333af0b0e24d
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: http://git-master/r/1229864
(cherry picked from commit 0027e7a51f6134b4a7b332c17f7c7c26ac727ebc)
Reviewed-on: http://git-master/r/1475093
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
7 years agoASoC: ad193x: Correct the bit-shift for the serial format field
Jon Hunter [Fri, 28 Apr 2017 11:07:46 +0000 (12:07 +0100)]
ASoC: ad193x: Correct the bit-shift for the serial format field

The bit-shift for the serial format field is incorrect for the 'AUX'
configuration and so correct this bit-shift.

Change-Id: Ie284e4612583d3fca80073d7d30cb07eb3b48bef
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1472226
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>