Somu Sundaram [Fri, 18 Mar 2016 07:22:59 +0000 (12:52 +0530)]
media: tegra: nvavp: Fix reloc offset check
- Check whether command buffer data offset is 32-bit
aligned
- Check whether relocation offset is 32-bit aligned
and calculated offset is within command buffer size
- Check whether target offset is 32-bit aligned
and derived address is within target buffer size
video: tegra: host: fix out-of-bound access in case of overflow
In nvhost_ioctl_ctrl_module_regrdwr(), we allocate a local buffer
of size (num_offsets * block_size), and use it to store
all the values passed from/to user space
In case erroneous values are passed from user space
(e.g. num_offsets=67108864 and block_size=64), buffer size
passed to kmalloc() overflows and is instead set as 64
And in that case, we end up accessing out-of-bounds values
from local buffer "vals"
To prevent this, allocate buffer "vals" of only one block size
and then copy it from/to user space in loop (i.e. copy the values
for each offset)
Remove variable "p1" and rename variable "remaining" as
"count" as it makes more sense
Add and use new API validate_max_size() to validate size of
register read/write. This API will check if requested read/write
block size is less than the memory resource size of device
kmalloc() might fail for any size > 4KB, hence fall back to
use vmalloc() if kmalloc() fails
Use kvfree() to free buffer allcoated with above
Android commit 535dab900f19881485c4dab344fcf31e7763dbf1 adds a u16
member to the struct sockaddr_sco. This makes the structure different
from the one bluez linux userspace uses. Hence, the check added in
this patch always fails for L4T.
The Android commit actually uses only the minimum of the structure size
between userspace and kernel. So, we do not need the additional check
added in this patch.
plugin-manager: Add support for partial and GE match
Currently the matching of board ID on board is done with exact
match. Add support for partial and >=fab ID support.
Partial match:
==============
If matching string start with '^' or having the '*' in id string
then apply partial match with board ID based on how string provided.
Example: Suppose Board ID is 3310-1000-100, then the matching is
done by saying ^3310-1000, 3310-1000-*, 3310-* etc.
^3310-1000 or 3310-1000-* means all fab ID of 3310-1000-,
3310-* means all SKU and fab ID of 3310.
Greater than-equal to match:
===========================
If matching string start with ">=" then it is applied for all board
of same type of module having fab ID >= sting fab ID.
Example: ">=3310-1000-100" means all fab 3310-1000-100 and later like
3310-1000-200, 3310-1000-300 etc.
rtctest fails because of alarm doesn't set after triggering first
interrupt, to fix setting alarm, need to call "rtc_update_irq" after
calling "rtc_aie_update_irq".
Naveen Kumar S [Mon, 28 Mar 2016 13:51:47 +0000 (19:21 +0530)]
Revert "revert "fbcon: Compare variable screen info instead of modes""
This reverts commit fae8c6c89041afe14aca750b22d5eefcac591d25.
Xserver hang was observed due to the original change, hence reverted
as part of bug 1716596. The hang was root caused to bug 200169212, which
has been resolved by http://git-p4swmirror/r/16930. Hence restoring
the original change.
Jeetesh Burman [Thu, 31 Mar 2016 08:48:29 +0000 (14:18 +0530)]
rtc: tegra: fix setting of multiple alarm
with hwclock more than one time alarm getting set and this is
occured because of triggering of 2 times rtc-tegra interrupts.
To prevent multiple tegra-rtc interrupts, use "rtc_aie_update_irq"
instead of "rtc_update_irq" for alarm interrupts, so that when data
is available, system can wake-up hwclock process
(slept by poll call) instead of triggering rtc-tegra interrupt
and calling "rtc_timer_do_work" continously which is happening in
the case of "rtc_update_irq".
replace alarm setting message from dev_info to dev_dbg.
Bhanu Murthy V [Mon, 21 Mar 2016 21:25:05 +0000 (14:25 -0700)]
drivers: media: camera: Multiple channel support
Fix header references which are no longer needed.
Fix issues in CSI pad configuration for port A
when port B is programmed.
Fix CSI port and num lanes information for CSI
in VI mode when multiple channels are available.
Fix CSI power sequence for TPG mode.
Remove duplicated DPD programming of CSI channels
when sensor is connected. In case of TPG mode,
DPD programming is handled within CSI
power sequence.
Change-Id: Ib748eabb8bb14c7c334c250485d884e749933b15 Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1119336
(cherry picked from commit 0bca0f46fbce0d58306430dd6886fe8ab15bff06)
Reviewed-on: http://git-master/r/1120122 Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Tested-by: Matthew Pedro <mapedro@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
Bhanu Murthy V [Wed, 3 Feb 2016 00:33:15 +0000 (16:33 -0800)]
drivers: media: platform: tegra: VI mode
Adds VI mode for the media controller driver
Adds power and clock settings required for CSI
and VI devices. Adds register programming of
VI/CSI devices based on the configuration
required by the camera module.
Reading RTC registers after immediate write can result in
wrong values as updating shadow registers in APB for RTC
can take nearly another 250us after the write is complete.
Change-Id: I41534a512b6a532c2380e918566ddaa6c75eb135 Signed-off-by: Daniel Fu <danifu@nvidia.com>
Reviewed-on: http://git-master/r/1026333 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: David Dastous St Hilaire <ddastoussthi@nvidia.com> Tested-by: David Dastous St Hilaire <ddastoussthi@nvidia.com> Reviewed-by: Vinayak Pane <vpane@nvidia.com>
Bryan Wu [Fri, 26 Feb 2016 22:47:02 +0000 (14:47 -0800)]
media: tegra_camera: clear status registers
When some error bits are set in status registers, they should be
cleared before read the status register again. Otherwise these status
error bits will be there forever.
Arto Merilainen [Mon, 5 Oct 2015 12:19:50 +0000 (15:19 +0300)]
video: tegra: host: tsec: Get cmdbuf from host as
Currently all buffers are allocated from TSEC address space - including
the command buffer that is read by host1x. This becomes an issue if we
want to use different address spaces for host1x and tsec.
This patch modifies command buffers to be allocated from host1x address
space to allow using different address spaces for host1x and tsec.
- ucode CL http://git-master/r/#/c/1021926/
- EXTERR exception for ZBC L2 regsiters access
during ELPG entry/exit.
FIX : ZBC L2 is not part of GR, so ZBC L2 rigsters
save/restore not required for ELPG entry/exit,
Deepak Nibade [Wed, 16 Mar 2016 10:22:20 +0000 (15:52 +0530)]
devfreq: compare previous_freq only if podgov disabled
In update_devfreq(), we currently get target frequency,
compare it with previous_freq, and set it only if
new freq is different one
But get_target_freq() (nvhost_pod_estimate_freq())
already takes care of such cases in normal conditions
Hence, remove the check with previous_freq in
update_devfreq()
For case when we disable podgov governor, we might still end
up setting max freq all the time
Hence, add a check on previous_freq, and if previous_freq
is already max, do not set it
arm64: dts: Remove wifi firmware country code mapping for Jetson
JetsonE/CV platform does not use location based country selection.
Remove the country code mapping for Jetson platform and keep only
the worldwide safe region code for Jetson.
When gpu rail-gating is enabled, it is possible that
both rail gating code and system shudown can start
executing gk20a_pm_prepare_poweroff() in parallel.
To synchronize this execution, protect gk20a_pm_prepare_poweroff()
with a mutex lock.
Srinivas Anne [Sat, 12 Mar 2016 00:42:57 +0000 (16:42 -0800)]
asoc: es755: add delay b/w route setup & teardown
change Summary:
Audience FW requires atleast 30 msec to setup the PT_VP route properly.
Added 30msec sec delay before stopping the PT_VP route. This should
prevent the Audience FW going into a bad state during fast
plug-in/plug-out
Terje Bergstrom [Fri, 11 Mar 2016 15:55:30 +0000 (07:55 -0800)]
gpu: nvgpu: Disable illegal comptag interrupt
Illegal comptag interrupt is triggered when a page is mapped with
two different kinds with incompatible compression status. This can
be intentional, so disable the interrupt.
Srinivas Anne [Fri, 4 Mar 2016 05:28:21 +0000 (21:28 -0800)]
asoc: es755: Acquire wakelock during hs detection
change Summary:
Acquire wakelocks while processing wired accessory detection.
This should prevent the system from going to LP0 while processing wired
accessory detection.
Ajay Nandakumar [Tue, 23 Feb 2016 12:23:13 +0000 (17:53 +0530)]
platform: tegra: nvadsp: Fix use of mailbox dumps
The mailbox dumps needs to be called before runtime suspend is called.
If called after suspend, the register access become invalid and the
device crashes.
Jeetesh Burman [Fri, 11 Mar 2016 05:23:50 +0000 (10:53 +0530)]
arm64: config: enable RTC_BACKUP_HCTOSYS_DEVICE
without RTC_BACKUP_HCTOSYS_DEVICE=rtc1, hctosys code reads RTCSEC from
tegra-rtc and resetting date to default date (01-01-2013) if date is
set above 2013-year from user.
enable CONFIG_RTC_BACKUP_HCTOSYS_DEVICE and set to rtc1, so that
system reads RTCSEC from pmic-rtc instead of tegra-rtc.
Increase NVAVP_MAX_RELOCATION_COUNT to max. possible value
and add check to return error if num_relocs in
nvavp_pushbuffer_submit_ioctl exceeds
NVAVP_MAX_RELOCATION_COUNT
Eric Miao [Tue, 8 Mar 2016 23:34:26 +0000 (15:34 -0800)]
arm64: dts: foster_e_hdd: update sata firmware partition
As part of the effort not to hardcode the logic of sata firmware
upgrade in the bootloader, nor to hardcode the partition where
the firmware is stored, it was agreed to introduce a chosen
property in the device tree, hence the patch.
On Foster/HDD, this will be on RP4 partition as below:
/chosen/satafw-partition = "RP4";
The sata firmware check/update will be skipped for any platforms
that:
* do not have this property properly
* or simply don't have a SATA storage device
Mihir Thakkar [Wed, 24 Feb 2016 21:46:02 +0000 (13:46 -0800)]
soc_camera: imx230 power on sleep
Change the power on sleep range to 1ms to fix random hangs while
running nvcamera_test. We need min of 1ms before first i2c
access. T6 event in the power up sequence in the reference manual
Gagan Grover [Wed, 2 Mar 2016 11:24:29 +0000 (16:54 +0530)]
ARM: tegra: Disable PMIC WDT at boot
PMIC WDT boot-timeout was 32 (less than Tegra WDT (180 sec)).
So, in case of non-LP0 hangs, PMIC WDT was causing system reset,
instead of Tegra WDT and hence we were missing FIQ dump as well.
Now, Tegra WDT should trigger reset in case of hangs.
Viswanath L [Wed, 9 Mar 2016 07:31:40 +0000 (13:01 +0530)]
tegra-alt:adsp: Allow "Min ADSP Clock" ctl always
"Min ADSP Clock" for the APM is set at the widget ON event, which
sometimes occurs immediately on closing the APM connections (like for
SPKPROT); allowing "Min ADSP Clock" setting only if APM is initialized
causes this to be missed at times
Allowing to set "Min ADSP Clock" before APM is initialized will ensure
that it's always available at the subsequent widget event
lp8557 backlight controller needs to have pwm frequency input less
than 25 KHz. To achieve this, pwm-period needs to increase which gives
23 KHz pwm frequency output from t210.
Sagar Kadamati [Fri, 12 Feb 2016 11:45:34 +0000 (17:15 +0530)]
gpu: nvgpu: recycle the cmdbuf instead of freeing after job done
When adding new job for the channel
Just check, is there any expired cmdbuf from prev jobs
If so simply use the exiting cmdbuf, instead of creating one
If not just create cmdbuf
All allocated cmdbuf's are freed on channel release
we mostly avoid dynamic allocations for cmdbuf
By using this way, we have advantages of both the worlds
So we gain performance in both (app startup and runtime)
Naveen Kumar S [Wed, 10 Feb 2016 13:23:20 +0000 (18:53 +0530)]
arm: tegra: prioritize board-id based panel init
If display board id has been specified by user, it is better
to directly initialize that particular panel instead of
searching for panels which are enabled in DT.
Aly Hirani [Thu, 23 Apr 2015 23:41:15 +0000 (16:41 -0700)]
drivers: video: tegra: Add full range HDMI support
HDMI sinks by default are only expected to support limited range
which restricts each channel to 16-235, rather than 0-255. The spec also
optionally allows sinks to support full range by declaring a
"quantization selectable" bit in the VCDB block in the EDID.
If the quantiazation selectable is marked as true (independent bools for
RGB/YUV), then the source is allowed to select full range by setting the
RGB/YUV limited/full range bits in the avi infoframe.
This patch adds:
1. A new VMODE flag to indicate that the specific mode is limited range
2. A new FB_CAP_* to indicate that the display supports overriding
RGB/YUV and the associated EDID parsing.
3. Applies the new VMODE LIMITED RANGE to the RGB/YUV modes based
on whether the TV supports overriding the quantization in that color
space as the default.
4. Adds the logic in the hdmi modeset to enable CMU iff we are in RGB
and limited range.
5. Adds the logic in the hdmi driver to set the avi infoframe based on
whether the current mode has the limited range flag set or not.
Xiubo Li [Mon, 13 Jan 2014 03:07:28 +0000 (11:07 +0800)]
of: Fix __of_device_is_available check
From IEEE 1275, there defined a standard 'status' property indicating the
operational status of one device. The 'status' property has four possible
values: 'okay/ok', 'disabled', 'fail' and 'fail-xxx'.
If it is absent, that means the status of the device is unknown or okay.
The __of_device_is_available checks the state of the 'status' property of
a device. If the property is absent or set to 'okay/ok', it returns 1.
Otherwise it returns 0.
While in __of_device_is_available:
> status = of_get_property(device, "status", &statlen);
> if (status == NULL)
> return 1;
The status value returned from 'of_get_property()' will be NULL in two cases:
Firstly: the 'device' value (device node) is NULL.
Secondly: the 'status' property is actaully not exist.
If the device node is NULL, the __of_device_is_available will return true,
that will mean the absent state of the 'status' property.
So this add the device node check before checking the 'status' property's
state, and if the device node is not exist, 0 will be returned.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 42ccd781bb206804501ff490fd771bb940ca9969)
Here we are trying to merge linux-3.10.96 with rel-24. For this
we have to revert a downstream change. So, in order to avoid pushing a
separate change for that, we first pushed merge of the upstream change
with the reverted change to a dev branch, and now are merging the dev-branch
with rel-24 TOT.
Shreshtha SAHU [Mon, 22 Feb 2016 09:48:50 +0000 (15:18 +0530)]
tegra: soctherm: fix negative temp debugfs output
soctherm debugfs temperature nodes were not printing negative temperatures.
Fixed attribute from %llu to %lld to print negative values, instead of in
two's complement.
Naveen Kumar S [Wed, 13 Jan 2016 11:05:05 +0000 (16:35 +0530)]
video: tegra: l4t: set dc blank on display timeout
In case of L4T, userspace doesn't take initiative to sync
the windows upon unblank. Driver needs to specifically set
dc to blank state while blanking (normal/powerdown) for
subsequent unblank call to re-sync all the windows. If not
display remains blank.
For mode filtering, use the same timing constraints check function as the one
that will be used when trying to set the mode. This prevents passing invalid
modes to userspace.
Daniel Solomon [Sat, 14 Nov 2015 04:40:37 +0000 (20:40 -0800)]
video: tegra: dc: tag vrr modes using vmode
HDMI VRR is supported only for some resolutions, and the kernel
driver is aware of these restrictions. For VRR monitors, the kernel
driver now duplicates and tags all compatible modes with the
FB_VMODE_VRR flag in the duplicate mode's fb_videomode vmode field.
The same behavior has been added to DSI as well for consistency.
The compatible modes are duplicated before being tagged so as to
not interfere with userspace configurations that do not support
the FB_VMODE_VRR flag.