Zheng Liu [Mon, 6 Oct 2014 23:49:08 +0000 (16:49 -0700)]
arm: tegra12_defconfig: set 3GB-16MB task size
The previously used 3GB-24MB task size caused relocation failures when
loading kernel modules. This happened because part of the module loading
area got beyond the 32MB relocation range from kernel .text segment.
This problem is ARM32-specific and does not affect ARM64.
Zheng Liu [Tue, 7 Oct 2014 18:17:49 +0000 (11:17 -0700)]
arm: tegra12_defconfig: make audio drivers inbuilt
Revert previous changes to modularize the audio drivers. The module
probe/remove paths of these drivers are untested and buggy. Make these
drivers built-in until the bugs are worked out, and schedule allows
for thorough testing.
video: tegra: nvmap: remove support for Deprecated GET_ID/FROM_ID ioctl's
Remove support and add warning message for deprecated IOCTL's -
NVMAP_IOC_FROM_ID and NVMAP_IOC_GET_ID. These ioctl calls
are deprecated by corresponding FD ioctl calls.
Incremented nvmap_handle ref count in utility function
nvmap_get_id_from_dmabuf_fd() before the function release reference
to dma buffer. This is required to avoid race conditions in nvmap
code where nvmap_handle returned by this function could be freed
concurrently while the caller is still using it.
As a side effect of above change, every caller of this utility
function must decrement nvmap_handle ref count after using the
returned nvmap_handle.
Matt Longnecker [Tue, 19 Aug 2014 00:00:01 +0000 (17:00 -0700)]
edp: sysedp : CPU/GPU priority depends on fGPU
Provide sysedp_dynamic_capping with the instantaneous GPU frequency
when notifying it of the GPU load. Modify the gpu/cpu priority
decision logic to choose CPU priority until GPU frequency gets "near"
the CPU-priority-limited-GPU-fmax. Introduce the priority_bias debugfs
parameter to facilitate tuning of "near". priority_bias takes a value
from 0 to 100.
Daniel Solomon [Fri, 15 Aug 2014 00:50:15 +0000 (17:50 -0700)]
video: tegra: dc: Avoid FRAME_END_INT conflict
Allowing for dc->lock to be acquired by the
caller in function tegra_dc_config_frame_end_intr
can result in FRAME_END_INT mask register being
overwritten if the lock is actually acquired by
another thread.
Refactor the critical section into its own function
and allow callers to call either function. Also
Change the name of tegra_dc_wait_for_frame_end
to indicate that it should be called with dc->lock
locked.
Daniel Solomon [Tue, 5 Aug 2014 21:48:42 +0000 (14:48 -0700)]
video: tegra: dc: Fix and refactor FRAME_END_INT
- Fix a conflict with other DC interrupt masks
when the DSI driver waits on FRAME_END_INT
- Move generic FRAME_END_INT mask/unmask and
wait-for functions to dc.c
Change-Id: I71ed7891aaff48f0b87438ad029b22ced9be0f04 Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/494787 Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Tested-by: Matthew Pedro <mapedro@nvidia.com>
PCIe powergating dependency is now handled internally in the powergating module
for t12x/t13x. This patch removes PCIe related powergating calls from XHCI
driver for tegra.
arm: tegra: power: add pcie dependency to xusb ops
Due to a HW bug 1320346 in t12x/t13x, PCIE needs to be unpowergated when XUSB
is to be accessed. Currently PCIE powergating ops need to be invoked from XUSB
driver since powergating module doesn't internally handle this dependency.
This patch implements this dependency within the powergating module so that
xhci-tegra driver can stay chip-agnostic.
arm: tegra: power: add reference counters for pcie
Due to HW Bug 1320346, both XUSB and PCIE modules need to control powergating
on PCIE block. Implement reference counter mechanism so that powergating is
done only when neither of these two drivers are active.
Change-Id: I6866ba0fb47433e211360b722abbb1b2c1a05c35
Reviewed-on: http://git-master/r/418060
(cherry picked from commit 70be55b824632252be36f6ee0d495d4c0f4e507c) Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-on: http://git-master/r/498659 Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Tested-by: Matthew Pedro <mapedro@nvidia.com>
PMC should be suspended as soon as interrupt-
controller bus is suspended so that no wake signal
is entertained in between leading to abnormal
system behaviour
Change-Id: I4de7462a8c0588f8cecde270a97c39040748a4b6 Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/498280 Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Tested-by: Matthew Pedro <mapedro@nvidia.com>
Change-Id: I55d5a5c1a1570c16d8332ba224e0ed9a1f7c257c Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/412630
(cherry picked from commit 463019f3158b58906f5b4c81463e5b0b1067576f)
Reviewed-on: http://git-master/r/498813 Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Tested-by: Matthew Pedro <mapedro@nvidia.com>
If pin is configured on gpio mode and set for input direction
then set e_input = 1 and if pin is set for output direction
then set tristate = 0 for that pin.
Laxman Dewangan [Wed, 21 May 2014 14:09:35 +0000 (19:39 +0530)]
gpio: tegra: call pinctrl dirctions apis on direction input/output
Set the pins in different direction based on client request from gpio.
This will help to non-tristate the pin on gpio output mode or enable
input on gpio input mode without any explicit condition.
In the absence of hotplug, monitor data and mode database is removed
and DC is switched off. However, fbcon is unaware.
This patch adds the change to fb_info state to suspend while updating
monitor specs. This state will denote that the hardware is unavailable.
Info will be restored to state running once modelist is available.
Zheng Liu [Wed, 3 Sep 2014 00:08:51 +0000 (17:08 -0700)]
arm: tegra12_defconfig: modularize kernel bits
Modularize some components to shrink the kernel. The target is
a .text section <=8MB in order to ensure successful relocations
from the 22MB module loading segment.
This gets us to about 10MB which may suffice for now.
Zheng Liu [Tue, 2 Sep 2014 21:51:33 +0000 (14:51 -0700)]
arm: tegra12_defconfig: renormalize the defconfig
No actual configuration changes. Config items have shifted around,
causing confusion when making actuall configuration changes.
This defconfig is generated with the following process under the
kernel directory:
make tegra12_defconfig
make oldconfig
make savedefconfig
cp defconfig arch/arm/configs/tegra12_defconfig
Change-Id: Ic0c197cf6bad4cb4ddd7742215fab8a1e8d30a50 Signed-off-by: Zheng Liu <zhliu@nvidia.com>
Reviewed-on: http://git-master/r/494897 Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit Reviewed-by: Allen Martin <amartin@nvidia.com>
Change-Id: I86fa8800df1988f630b4e45d4cbf1733c039c837 Signed-off-by: Zheng Liu <zhliu@nvidia.com>
Reviewed-on: http://git-master/r/494120
GVS: Gerrit_Virtual_Submit Reviewed-by: Allen Martin <amartin@nvidia.com>
Add a simple sysfs interface to the generic PWM framework.
/sys/class/pwm/
`-- pwmchipN/ for each PWM chip
|-- export (w/o) ask the kernel to export a PWM channel
|-- npwm (r/o) number of PWM channels in this PWM chip
|-- pwmX/ for each exported PWM channel
| |-- duty_cycle (r/w) duty cycle (in nanoseconds)
| |-- enable (r/w) enable/disable PWM
| |-- period (r/w) period (in nanoseconds)
| `-- polarity (r/w) polarity of PWM (normal/inversed)
`-- unexport (w/o) return a PWM channel to the kernel
Bibek Basu [Mon, 4 Aug 2014 07:27:21 +0000 (12:57 +0530)]
tegra: dc: dont synchronize irq from irq thread
Synchronizing IRQ from irq thread context will never return
because the thread will sleep forever.And thats the reason
for DPM timeout and kernel crash when suspend hook also
tries to do so.
[ 204.471652] tegradc tegradc.1: **** DPM device timeout ****
[ 204.484865] [<c07a58a8>] (__schedule+0x3b4/0x6e0) from [<c00ccf94>] (synchronize_irq+0xac/0xe4)
[ 204.501399] [<c00ccf94>] (synchronize_irq+0xac/0xe4) from [<c0341628>] (tegra_dc_suspend+0xcc/0x15c)
[ 204.518507] [<c0341628>] (tegra_dc_suspend+0xcc/0x15c) from [<c03da574>] (platform_pm_suspend+0x58/0x64)
[ 204.536166] [<c03da574>] (platform_pm_suspend+0x58/0x64) from [<c0032c00>] (tegra_pd_suspend_dev+0x34/0x9c)
[ 204.554226] [<c0032c00>] (tegra_pd_suspend_dev+0x34/0x9c) from [<c03e5384>] (pm_genpd_default_suspend+0x24/0x30)
[ 204.572942] [<c03e5384>] (pm_genpd_default_suspend+0x24/0x30) from [<c03e5864>] (pm_genpd_suspend+0x58/0xa4)
[ 204.591515] [<c03e5864>] (pm_genpd_suspend+0x58/0xa4) from [<c03dfb30>] (dpm_run_callback+0x34/0x54)
[ 204.609552] [<c03dfb30>] (dpm_run_callback+0x34/0x54) from [<c03dffe4>] (__device_suspend+0x16c/0x380)
Added new file "maps" for nvmap heaps. In addition to data given by
existing "allocations" file, this also shows the client's virtual
mappings and total amount of handle physical memory that is actually
mapped to a client's virtual address space.
This change will help in tracking nvmap memory usage of processes.
cpufreq: governors: Remove duplicate check of target freq in supported range
Function __cpufreq_driver_target() checks if target_freq is within
policy->min and policy->max range. generic_powersave_bias_target() also
checks if target_freq is valid via a cpufreq_frequency_table_target()
call. So, drop the unnecessary duplicate check in *_check_cpu().
Viresh Kumar [Tue, 6 Aug 2013 17:23:03 +0000 (22:53 +0530)]
cpufreq: Clean up header files included in the core
This patch addresses the following issues in the header files in the
cpufreq core:
- Include headers in ascending order, so that we don't add same
many times by mistake.
- <asm/> must be included after <linux/>, so that they override
whatever they need to.
- Remove unnecessary includes.
- Don't include files already included by cpufreq.h or
cpufreq_governor.h.
cpufreq: ondemand: Change the calculation of target frequency
The ondemand governor calculates load in terms of frequency and
increases it only if load_freq is greater than up_threshold
multiplied by the current or average frequency. This appears to
produce oscillations of frequency between min and max because,
for example, a relatively small load can easily saturate minimum
frequency and lead the CPU to the max. Then, it will decrease
back to the min due to small load_freq.
Change the calculation method of load and target frequency on the
basis of the following two observations:
- Load computation should not depend on the current or average
measured frequency. For example, absolute load of 80% at 100MHz
is not necessarily equivalent to 8% at 1000MHz in the next
sampling interval.
- It should be possible to increase the target frequency to any
value present in the frequency table proportional to the absolute
load, rather than to the max only, so that:
Target frequency = C * load
where we take C = policy->cpuinfo.max_freq / 100.
Tested on Intel i7-3770 CPU @ 3.40GHz and on Quad core 1500MHz Krait.
Phoronix benchmark of Linux Kernel Compilation 3.1 test shows an
increase ~1.5% in performance. cpufreq_stats (time_in_state) shows
that middle frequencies are used more, with this patch. Highest
and lowest frequencies were used less by ~9%.
[rjw: We have run multiple other tests on kernels with this
change applied and in the vast majority of cases it turns out
that the resulting performance improvement also leads to reduced
consumption of energy. The change is additionally justified by
the overall simplification of the code in question.]
Charlie Huang [Fri, 11 Jul 2014 23:19:32 +0000 (16:19 -0700)]
media: platform: tegra: support 64 bit user code
Since the user space code may works in either 32 or 64 bit mode,
attentions should be taken while passing pointers from user space to
the kernel. In this case, the p_value of struct nvc_param and
power_on/power_off of struct virtual_device received from the user
space should be handled properly.
The solution is to create a set of 32 bit version of structures
nvc_param and virtual_device along with some dedicated 32 bit mode
ioctl commands, then in the ioctl functions, the 32 bit user mode
access will be handled separately.
Krishna Reddy [Tue, 5 Aug 2014 21:43:37 +0000 (14:43 -0700)]
video: tegra: nvmap: clean cache during page allocations into page pool
Clean cache during page allocations into page pool to
avoid cache clean overhead at the time of allocation.
Increase page pool refill size to 1MB from 512KB.
Patch includes following nvmap changes:
- added "pid" field in nvmap_vma_list so now looking at handle's vma list,
we can say which vma belongs to which process.
- sorted handle's vma list in ascending order of handle offsets.
Krishna Reddy [Thu, 19 Jun 2014 23:10:23 +0000 (16:10 -0700)]
video: tegra: nvmap: don't count shared memory in full
Don't count shared memory in full in iovmm stats.
Add SHARE field to allocations info to show how many
processes are sharing the handle.
Update few comments in the code.
Remove unnecessary iovm_commit accounting.
Krishna Reddy [Fri, 20 Jun 2014 00:34:01 +0000 (17:34 -0700)]
video: tegra: nvmap: add handle share count to debug stats
handle share count provides info on how many processes are sharing
the handle. IOW, how many processes are holding a ref on handle.
Update the comments for umap/kmap_count.
Based on the capability of card, we should dynamically
set the mselect, pciex clock and link speed selection.
Clocks will be set to support the highest capable card
This patch:
1. enable the clocks to minimal value during boot
2. Based on card capability, it boosts the clocks
3. And train the link
gpu: nvgpu: fix error handling for mutex_acquire()
Currently if pmu_mutex_acquire() fails, we disable ELPG
and move ahead. But it is not clear why it is required
to disable ELPG in case where we fail to acquire mutex.
Hence skip disabling ELPG if mutex_acquire() fails
Alex Frid [Wed, 16 Jul 2014 01:28:15 +0000 (18:28 -0700)]
ARM: tegra: dvfs: Don't protect dvfs data in early reasume
Don't protect dvfs data with mutex in late suspend/early resume.
DVFS operations are suspended at that time, but during syscore resume
it may be necessary to update DVFS data to changes happened while the
system was in suspend (in praticular memory configuration was changed
by boot-rom on suspend wake).
Change-Id: I8df278dc2e58e5ea1508d187afe0b8f4d8ccbe22 Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/438903
(cherry picked from commit 9008a4ad3ee979445b42bc52b8d1619da82badbb)
Reviewed-on: http://git-master/r/440505
GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Reviewed-by: Venkat Moganty <vmoganty@nvidia.com> Tested-by: Gaurav Sarode <gsarode@nvidia.com>
ARM: tegra: clock:Fix Sleeping while atomic in LP0
After enabling CONFIG_DEBUG_ATOMIC_SLEEP,during LP0 we see warning
regarding sleep in atomic region for clk_enable and clk_disable.
To fix this, we need to use clk_enable_locked and clk_disable_locked
instead.These functions do not acquire locks.
Change-Id: Ia654783de0cf72abac6847ac9630236f9f0d6ebb Signed-off-by: Peng Du <pdu@nvidia.com>
Reviewed-on: http://git-master/r/441348
(cherry picked from commit 518317f3e09c794e14de49f1afe47a93f92787ab)
Reviewed-on: http://git-master/r/448179 Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Tested-by: Matthew Pedro <mapedro@nvidia.com>
gpu: nvgpu: return error from mutex_acquire() if pmu not initialized
In pmu_mutex_acquire(), we return zero (success) if
pmu->initialized is not set
Since mutex_acquire() was successful, we then call
pmu_mutex_release()
If now pmu->initialized is set in some other thread
then we proceed to validate the mutex owner and
end up causing below warning :
pmu_mutex_release: requester 0x00000000 NOT match owner 0x00000008
Hence to fix this return error from mutex_acquire()
and mutex_release() if pmu->initialized is not yet set
and in that case we proceed to call elpg enable/disable
Change-Id: Ib132b9feeb85a7b7bacfa7aeceb646aa89d54ece Signed-off-by: Zheng Liu <zhliu@nvidia.com>
Reviewed-on: http://git-master/r/440520
GVS: Gerrit_Virtual_Submit Tested-by: Mike Thompson <mikthompson@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Change-Id: If0f769bceaf6edcd8fe5d2fbd067a2ed3a81cca2 Signed-off-by: Zheng Liu <zhliu@nvidia.com>
Reviewed-on: http://git-master/r/440519
GVS: Gerrit_Virtual_Submit Tested-by: Mike Thompson <mikthompson@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Change-Id: I842150ecccb722a93b7b80b3c87dcf1ceb13e7b5 Signed-off-by: Zheng Liu <zhliu@nvidia.com>
Reviewed-on: http://git-master/r/440518 Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit Tested-by: Mike Thompson <mikthompson@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Change-Id: I8c1acb14d62df51cac535b2b78df0070744a5b66 Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/436700
(cherry picked from commit 6eff7bd5a3a858e92c1088c102b21e86e12bf35b)
Reviewed-on: http://git-master/r/439915 Tested-by: Jong Kim <jongk@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Change-Id: If5db728a0bca436f0c12ec3de56c4fec9b3d3328 Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/436316
(cherry picked from commit bec916df2e450d763a912be37b783450aaf5b862)
Reviewed-on: http://git-master/r/439914 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Jong Kim <jongk@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Jon Mayo [Wed, 18 Jun 2014 23:01:10 +0000 (16:01 -0700)]
video: tegra: dc: move cursor into core driver
Move cursor routines into the core driver, provide a small abstraction
layer to update the cursor.
Change-Id: Idfa1c6b313806de6a5d34f9f05592574f5829933 Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/436315
(cherry picked from commit 14e65ae70661462aa50f424a04a65a7c0efd9ff9)
Reviewed-on: http://git-master/r/439913 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Jong Kim <jongk@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Roger Hsieh [Mon, 7 Jul 2014 07:42:39 +0000 (15:42 +0800)]
ARM: ardbeg: enable throttle only with compatible machines
Mostly we enabled different machines in defconfig. The calls in
the board file should ensure it's executing with the compatible
machines, or race condition will be happened.
usb: gadget: tegra: handle the case when host reboots
Some hosts during booting first supply vbus and then
send setup packets after x seconds. In this case we detect
as non-standard. Handle this case by setting to SDP.
Also adding condition to avoid unnecessary icon
notifications.
Philip Rakity [Wed, 4 Jun 2014 11:37:30 +0000 (12:37 +0100)]
usb: phy: tegra: QC2 speed up charger recogniion
The QC2 Wall Charger needs to be reset only when
we boot or reboot the system. This is because
the wall charger will have already defaulted to a DCP.
Since the internal logic in the Wall Charger will not
see D+/D- programmed during the time available.
If we just plug in the charger then it will be recognised
in time so no reset is necessary. Removes 1.5s of delay.
Arto Merilainen [Mon, 7 Jul 2014 12:50:21 +0000 (15:50 +0300)]
devfreq: Account only powered time in trans_stat
This patch modifies devfreq to account only the time a device is
powered in trans_stat. In addition, this patch also fixes a race
in trans_stat maintenance in cases where the node is readed at
the same time the transition table is being updated by frequency
re-estimation.
Change-Id: I6e4341317b6dda88d69028c9f67785400e5a7a65 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/435174 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Prajakta Gudadhe <pgudadhe@nvidia.com> Reviewed-by: Samuel Russell <samuelr@nvidia.com> Tested-by: Samuel Russell <samuelr@nvidia.com> Reviewed-by: Ilan Aelion <iaelion@nvidia.com>
Timo Alho [Mon, 7 Jul 2014 05:44:56 +0000 (08:44 +0300)]
tegra: dtb: sysedp: enable sysedp only on P1761 with battery
Previously, sysedp was attempted to enabled on non-battery versions of
P1761. This caused sysedp_batmon_calc to fail with -EFAULT during
probing as battery power supply was not available.