- 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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/
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.
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>
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>
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>
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.
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>
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.
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.
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
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.
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.
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.
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.
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.
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>
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.
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.
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.
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
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.
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.
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.
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.
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>
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.
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>
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>
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.
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.
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
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.
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.
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>
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>
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.
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
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.
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.
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.
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.
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.
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.
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.
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>
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
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.
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 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)
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.
Josh Kergan [Fri, 10 Nov 2017 23:16:25 +0000 (15:16 -0800)]
drivers:csi:csi2 error reset fix
The csi port code had changed so that only one port
is allocated to a channel no matter how many physical
ports are used. The csi2 error handler was not updated
for this change and was trying to set 2 ports when only
one existed. Change updates the csi to use the port offset
values to index the second csi to clear the buffer after an
error occurs.
Change-Id: Icf497f3d09d5a1aa05d46391469d7704d906738e Cc: <stable@vger.kernel.org> Signed-off-by: Peter Chang <dpf@google.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-on: https://git-master.nvidia.com/r/1605270
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>
Change-Id: I08d9fecf8ad74735021d4e75bbfe7a018c099396 Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-on: https://git-master.nvidia.com/r/1605253
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>