Pekka Väänänen [Thu, 27 Aug 2015 15:03:41 +0000 (18:03 +0300)]
video: tegra: dc: enable YUV 1000/1001 modes
YUV modes' refresh rates are not nice multiples of 1000.
That means we need an epsilon check to generate 1000/1001 modes
correctly. Since we now match more modes than before, the mode list
needs to be larger too.
Change-Id: I49c4c65651bde2f272af98a10cd8a47e2b03022c Signed-off-by: Pekka Väänänen <pvaananen@nvidia.com> Signed-off-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-on: http://git-master/r/790400
GVS: Gerrit_Virtual_Submit Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Aly Hirani [Tue, 18 Aug 2015 09:48:42 +0000 (02:48 -0700)]
video: tegra: dc: enable 1000/1001 modes
This change enables the 1000/1001 modes for T210. On T210, we have a fractional
divider available for DC. This allows us to generate pclks almost closely
accurate to the common 1000/1001 modes such as 23.976, 29.97 and 59.94 Hz.
This change:
1. Adds a new VMODE flag to signify modes which are * 1000 / 1001
2. Filters exclusively for 24/30/60 Hz modes in the EDID parser, duplicates
these modes and changes them to be the 1000 / 1001 modes
3. Changes the dc pclk calculation to take into account these modes during the
rounding
Change-Id: I2cc762b2338ce5662d85891859327015e88b670b Signed-off-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-on: http://git-master/r/786281
GVS: Gerrit_Virtual_Submit Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Deepak Nibade [Mon, 17 Aug 2015 10:49:09 +0000 (16:19 +0530)]
gpu: nvgpu: wakeup semaphores after clearing CE2 interrupt
In gk20a_ce2_nonstall_isr(), we first invoke semaphore workqueue
on all channels and then clear the interrupt
This delay in clearing the interrupt can sometimes lead to
dropping of new interrupt
If that happens, we never invoke gk20a_channel_semaphore_wakeup()
for new semaphore interrupts and semaphore waiting
never completes.
Fix this by moving gk20a_channel_semaphore_wakeup() after
we clear the interrupt
sujeet baranwal [Tue, 11 Aug 2015 23:40:54 +0000 (16:40 -0700)]
gpu: nvgpu: wakeup semaphores after clearing the interrupt
Currently, we first invoke semaphore workqueue on all channels
and then clear the interrupt
This delay in clearing the interrupt can sometimes lead to
dropping of new interrupt
If that happens, we never invoke gk20a_channel_semaphore_wakeup()
for new semaphore interrupts and semaphore waiting
never completes.
Fix this by moving gk20a_channel_semaphore_wakeup() after
we clear the interrupt
Riley Andrews [Thu, 28 May 2015 19:10:05 +0000 (12:10 -0700)]
android: drivers: workaround debugfs race in binder
If a /d/binder/proc/[pid] entry is kept open after linux has
torn down the associated process, binder_proc_show can deference
an invalid binder_proc that has been stashed in the debugfs
inode. Validate that the binder_proc ptr passed into binder_proc_show
has not been freed by looking for it within the global process list
whilst the global lock is held. If the ptr is not valid, print nothing.
Aly Hirani [Tue, 14 Jul 2015 02:17:09 +0000 (19:17 -0700)]
video: tegra: dc: Remove DPAUX powerdown
This removes the explicit dpaux pad powerdown that was being called from
tegra_dc_controller_enable. Dpaux pads are meant to be refcounted using
the ddc_enable and ddc_disable functons. When the refcounts drop to
zero, they are responsible for calling the powerdown function.
For some unknown reason, dc_controller_enable was explicitly powering
down the pads (without going through the refcounting). This meant that
it is possible for the refcounting system to think that the pads are
powered, when in fact they were not.
In rel-22, it seems like it hardcodes the DPAUX (not DPAUX1) pads to be
powered off. This is a bug and we should never be doing this.
Aly Hirani [Tue, 28 Jul 2015 07:00:33 +0000 (00:00 -0700)]
video: fbmon: Fix and extend dmt_modes table
This change:
1. Fixes the upstream bug in the dmt_modes table. The 0x2e mode does not
have a 2-byte code of 0x9500. Instead, it is actually N/A as per the
VESA DMT v1.0 Rev 13 spec (February 8, 2013).
2. Adds all the remaining vesa_modes that were missing from the upstream
list.
Change-Id: I946e661038b10d6871258d7c6228a589da612afd Signed-off-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-on: http://git-master/r/776394 Reviewed-by: David Ung <davidu@nvidia.com> Reviewed-by: Animesh Kishore <ankishore@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Aly Hirani [Tue, 28 Jul 2015 06:54:30 +0000 (23:54 -0700)]
video: fbdev: Add additional vesa modes
Add high resolution modes to vesa_modes struct.
(This change backports the upstream commit from linux-next.
Specifically, the change is backported from the modedb.c which has
been moved from drivers/video/ to drivers/video/fbmon/core/.
Also fixes a minor whitespace issue.)
Change-Id: I302816b1e6d8550bac65d443cc62f0551aaac3e3 Signed-off-by: David Ung <davidu@nvidia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Aly Hirani <ahirani@nvidia.com>
(cherry picked from upstream commit 37715f556a0776356300391f8ac41ace91bea447)
Reviewed-on: http://git-master/r/776393 Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Aly Hirani [Tue, 28 Jul 2015 07:05:32 +0000 (00:05 -0700)]
video: fbdev: Check Standard Timing against DMT
Add the VESA Display Monitor Timing (DMT) table.
During parsing of Standard Timings, it compare the 2 byte STD code
with DMT to see what the VESA mode should be. If there is no entry
in the vesa_modes table or no match found, it fallsback to the
GTF timings.
(This change backports the upstream commit from linux-next.
Specifically, the change is backported from the modedb.c which has been
moved from drivers/video/ to drivers/video/fbmon/core/)
Change-Id: Ibc99bd12667ea0f18f0918d1abdd04805a8e0f13 Signed-off-by: David Ung <davidu@nvidia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Aly Hirani <ahirani@nvidia.com>
(cherry picked from upstream commit a2eec5a5ea12fb50e073b322ca9d948818179968)
Reviewed-on: http://git-master/r/776392 Reviewed-by: Animesh Kishore <ankishore@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Aly Hirani [Wed, 22 Jul 2015 20:52:23 +0000 (13:52 -0700)]
video: tegra: hdmi: Fix locks and race condition
The HDMI driver had a couple of race conditions that this change
attempts to fix.
1. ddc_enable/ddc_disable
tegra_hdmi_ddc_enable() and _ddc_disable() functions need to be
called before performing any ddc/i2c transactions on T210. These are
called at least from (1) edid thread, (2) scdc thread, (3) hdcp thread,
(4) from userspace by crc checker. The enable and disable functions
makes sure that the pads are powered on or powered off (with refcounting).
The hdmi driver was using a standard int with no locking around it,
causing typical race conditions and refcounting to go bad. This change
adds a new mutex to protect ddc_refcount.
2. clock_refcount_lock
The hdmi clocks are also refcounted with tegra_hdmi_get() and
tegra_hdmi_put(). They also make sure that the hdmi clocks are only
enabled and configured on the first enable() and turned off on the last
disable(). It was also using a standard int with no refcounting. This
change also adds a new mutex to protect clock_refcount_lock.
3. ddc_lock
ddc_lock was being held across some scdc transactions. However, this
is not needed. The i2c_transfer() function should be responsible for
maintaining the bus lock. Also, this is made worse by the fact that not
all ddc transactions were holding this lock.
ARM64: dtsi: t210: Update dqs-trim-delay for sdmmc.
-Update dqs-trim-delay for sdmmc.
-Set dqs trim value to 40 for HS400 mode.
-Set dqs trim delay to 24 for HS533 mode.
-http://nvbugs/1475512/96 has data from ASIC team.
Arto Merilainen [Wed, 13 May 2015 08:04:18 +0000 (11:04 +0300)]
platform: tegra: powergate: Fix race in refcount
Currently power partition refcount variable is a single integer
without any protection. This causes various possible issues:
- the refcount variable in itself may get outdated when if two
threads are making increments/decrements at the same time
- if one thread is requesting a reference while another is dropping
it, power-up may get canceled.
Martin Gao [Mon, 20 Jul 2015 19:35:56 +0000 (12:35 -0700)]
platform: tegra: pmc: add driver to configure PMC
Add driver to configure PMC for bootrom command
- Tegra210 bootrom has the feature to issue i2c commands to
external device like PMIC to send commands. These commands
are needed to pass through PMC on specific format.
- Allow driver to read the required platform specific commands
from DT under PMC node and format it as per bootrom need.
- Allow driver to configure the PMC bootrom command scratch
register as per the platform specific commands to issue write
i2c commands when it boots through bootrom
Martin Gao [Mon, 20 Jul 2015 20:24:09 +0000 (13:24 -0700)]
arch64: boot: set core voltage to 1.0 V by bootrom
Bootrom has capability to issue i2c command to device Provide i2c
command for PMIC to set core voltage to 1.0V before bootrom jump for
higher frequency. Add this configuration properties on power tree files
for loki and foster.
Igor Nabirushkin [Mon, 13 Apr 2015 13:00:37 +0000 (17:00 +0400)]
misc: tegra-profiler: fix stop error
Do not verify the existence of profiled process after
start of session.
It fixes the stop error on non-rooted devices when
application is terminated during the profile session.
Scott Long [Wed, 27 May 2015 16:44:46 +0000 (09:44 -0700)]
security: tlk_driver: fix te_open_session
If do_smc() fails in te_open_session() we free
the session pointer but then reference it after
that point when freeing temp mem buffers which
can lead to a crash.
In gk20a_cde_remove_ctx(), current sequence is as below
- gk20a_channel_close()
- gk20a_deinit_cde_img()
- gk20a_free_obj_ctx()
But gk20a_free_obj_ctx() needs reference to channel and hence
below crash is seen :
[ 3901.466223] Unable to handle kernel paging request at virtual address 00001624
...
[ 3901.535218] PC is at gk20a_free_obj_ctx+0x14/0xb0
[ 3901.539910] LR is at gk20a_deinit_cde_img+0xd8/0x12c
Fix this by closing the channel after gk20a_deinit_cde_img()
Konsta Holtta [Fri, 6 Mar 2015 14:33:43 +0000 (16:33 +0200)]
gpu: nvgpu: add per-channel refcounting
Add reference counting for channels, and wait for reference count to
get to 0 in gk20a_channel_free() before actually freeing the channel.
Also, change free channel tracking a bit by employing a list of free
channels, which simplifies the procedure of finding available channels
with reference counting.
Each use of a channel must have a reference taken before use or held
by the caller. Taking a reference of a wild channel pointer may fail, if
the channel is either not opened or in a process of being closed. Also,
add safeguards for protecting accidental use of closed channels,
specifically, by setting ch->g = NULL in channel free. This will make it
obvious if freed channel is attempted to be used.
The last user of a channel might be the deferred interrupt handler,
so wait for deferred interrupts to be processed twice in the channel
free procedure: once for providing last notifications to the channel
and once to make sure there are no stale pointers left after referencing
to the channel has been denied.
Finally, fix some races in channel and TSG force reset IOCTL path,
by pausing the channel scheduler in gk20a_fifo_recover_ch() and
gk20a_fifo_recover_tsg(), while the affected engines have been identified,
the appropriate MMU faults triggered, and the MMU faults handled. In this
case, make sure that the MMU fault does not attempt to query the hardware
about the failing channel or TSG ids. This should make channel recovery
more safe also in the regular (i.e., not in the interrupt handler) context.
Allow messages to /dev/kmsg to have a different loglevel other than
the default_message_loglevel, which is the one kernel printk() uses
when no loglevel is specified.
Change-Id: I340d20693d87cfea9aaea51845caf32b4cbd62fa Signed-off-by: Eric Miao <emiao@nvidia.com>
Reviewed-on: http://git-master/r/756603 Reviewed-by: Li Li (SW-TEGRA) <lli5@nvidia.com> Tested-by: Li Li (SW-TEGRA) <lli5@nvidia.com> Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
David Lock [Fri, 17 Apr 2015 21:59:31 +0000 (14:59 -0700)]
drivers: cpuquiet: Change hotplug core order
Turn cores off in reverse order in which we turn them on
from last core to first. This makes hotplug behavior more
predicatable to system components trying to optimize
scheduling.
Sai Gurrappadi [Wed, 22 Apr 2015 00:20:30 +0000 (17:20 -0700)]
drivers: cpuquiet: Plug/unplug CPUs in order
When satisfying the min/max constraints on online cpus, plug/unplug the
CPUs in order to make system behavior more predictable. There is
slightly higher penalty for the max case now as we need to find the last
online CPU but this shouldn't be significant. Also cleanup some code
while at it.
Change-Id: Ief4e4a76bbb960e476d6534bab30118b7326c91f Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/740425 Tested-by: David Lock <dlock@nvidia.com>
GVS: Gerrit_Virtual_Submit Reviewed-by: Ilan Aelion <iaelion@nvidia.com> Reviewed-by: Vinayak Pane <vpane@nvidia.com>
Enable multi-master mode in I2C_CNFG reg
using single/multi-master mode bit introduced
for T210, whereas multi-master mode is
enabled by default in HW for T124 and earlier
SOC.
When virtual edid is active, skip HDCP i2c transfers
and report them as failed. This prevents any possible
security issue as using virtual edid does not allow
the possibility of secured content playback.
Change virtual edid to persist across software hotplugs.
Before, the virtual edid was lost after an unplug event.
Only initialize the virtual edid state on probe.
mmc: tegra: Don't enable regulator with default voltage.
-When SD card is inserted(hot plug), calling regulator_enable
will set the default voltage value.
-Move the regulator_enable call to tegra voltage api.
marting [Tue, 30 Jun 2015 01:49:27 +0000 (18:49 -0700)]
drivers: net: ethernet: r8168 realtek driver
combine pgdrv with vendor driver r8168-8.039.00
enable the following configurations for r8168 driver:
- R8168_NAPI enabled by default
- R8168_VLAN enabled by default
- R8168_ASPM enabled by default
- R8168_S5WOL enabled by default
Martin Gao [Thu, 18 Jun 2015 02:26:09 +0000 (19:26 -0700)]
arch: arm64: boot: add pcie controller for darcy
Change-Id: If01037f45bece54161d54fd7e052d8f3e55dfbc8 Signed-off-by: Martin Gao <marting@nvidia.com>
Reviewed-on: http://git-master/r/759422 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Vinayak Pane <vpane@nvidia.com>
(cherry picked from commit 83935ec58669e9d4505d76d6c9f10300f75a54b8)
Reviewed-on: http://git-master/r/762789 Reviewed-by: Darren Sun <darrens@nvidia.com> Tested-by: Darren Sun <darrens@nvidia.com>
Gagan Grover [Fri, 29 May 2015 07:06:23 +0000 (12:36 +0530)]
pstore: Removed id from console-ramoops
There are many places in the code, where we
look for file "console-ramoops". We don't
find any match due to entened ID in the name.
Due to which ramoops are skipped from
dropbox and bugreport.
In HE and ST8 we are maintaining only one
session's ramoops and so no need to have ID.
Aly Hirani [Wed, 3 Jun 2015 21:52:10 +0000 (14:52 -0700)]
drivers: video: tegra: dc: Fix dpaux seq
This change fixes the dpaux programming sequence. Specifically, the tegrashell
scripts recommend to program the mode before powering on the pad. In the
current state of code, we were turning on the pad first (in the default dpaux
mode) and then switching the mode.
This specifically led to an issue with certain ddc transactions where the
voltage on SDA lines would hover at ~1.0 V (instead of 0 V/5 V high).
Changing this programming sequence helps remove this hover voltage with
certain sinks.
kraghavender [Wed, 17 Jun 2015 07:04:10 +0000 (12:34 +0530)]
Revert "net: wireless: bcmdhd2: Add 2nd instance of bcmdhd"
This reverts commit a1bf3e9bd74d8fdce71bb318520b9886bc278604.
Removing the support of the second Wi-Fi chip as of now although
it may be supported in future as this driver is going to be
obsolete for future need. Currently, code is having the coverity
issue and decided to remove the driver from code tree instead of
fixing anything on this as this is obsolete driver.
mmc: tegra: use sdhci-tegra voltage api's to set voltage
-In probe Use tegra_sdhci_signal_voltage_switch api to set voltage.
-tegra_sdhci_signal_voltage_switch has sdhci register read/writes, hence
the regulator code is moved after enabling necessary clocks.
This change removes the mode-filtering which used to remove the
modes from the modedb based on the max TMDS clock rate suggested
by the EDID.
From the HDMI 2.0 spec, Section 10.3.2, with regards to
Max_TMDS_Character_Rate: "This field may be set by the Sink to a
value below the TMDS Character Rate corresponding to the maximum
Pixel clock rate at the maximum color depth". HDMI 1.4 has a same
clause for Max_TMDS_Clock.
This means that the actual maximum TMDS rate supported by the TV
can be higher than the value suggested in the EDID. This filter
should have never been added in the first place since it can
remove actually supported modes.
David DSH [Wed, 3 Jun 2015 00:58:39 +0000 (17:58 -0700)]
loki:foster: emc update to 980 v09
· Update emc_reg_calc to P980
o Update MRW command to use MRS_SHORT_WAIT_CNT for bug 200099624
o Fix GSC for bug 1628471
o Fix W2W/R2R for lp4 dual rank usage for bug 1616889
o Add 5 new lp4 mappings
o Reduce PutermExtra by 2
o Fix unterminated CA/DQ vref to 42%
· DVFS_gen_script update to V1.4 from V1.3 for Vcore(mV)
Peter Hurley [Sat, 15 Jun 2013 11:04:48 +0000 (07:04 -0400)]
tty: Replace ldisc locking with ldisc_sem
Line discipline locking was performed with a combination of
a mutex, a status bit, a count, and a waitqueue -- basically,
a rw semaphore.
Replace the existing combination with an ld_semaphore.
Fixes:
1) the 'reference acquire after ldisc locked' bug
2) the over-complicated halt mechanism
3) lock order wrt. tty_lock()
4) dropping locks while changing ldisc
5) previously unidentified deadlock while locking ldisc from
both linked ttys concurrently
6) previously unidentified recursive deadlocks
Adds much-needed lockdep diagnostics.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 36697529b5bbe36911e39a6309e7a7c9250d280a)
Peter Hurley [Sat, 15 Jun 2013 11:04:47 +0000 (07:04 -0400)]
tty: Add lock/unlock ldisc pair functions
Just as the tty pair must be locked in a stable sequence
(ie, independent of which is consider the 'other' tty), so must
the ldisc pair be locked in a stable sequence as well.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d2c438905f9f718b3d9f5d89ce163fc22bd33995)
Peter Hurley [Tue, 16 Apr 2013 10:15:50 +0000 (06:15 -0400)]
tty: Add timed, writer-prioritized rw semaphore
The semantics of a rw semaphore are almost ideally suited
for tty line discipline lifetime management; multiple active
threads obtain "references" (read locks) while performing i/o
to prevent the loss or change of the current line discipline
(write lock).
Unfortunately, the existing rw_semaphore is ill-suited in other
ways;
1) TIOCSETD ioctl (change line discipline) expects to return an
error if the line discipline cannot be exclusively locked within
5 secs. Lock wait timeouts are not supported by rwsem.
2) A tty hangup is expected to halt and scrap pending i/o, so
exclusive locking must be prioritized.
Writer priority is not supported by rwsem.
Add ld_semaphore which implements these requirements in a
semantically similar way to rw_semaphore.
Writer priority is handled by separate wait lists for readers and
writers. Pending write waits are priortized before existing read
waits and prevent further read locks.
Wait timeouts are trivially added, but obviously change the lock
semantics as lock attempts can fail (but only due to timeout).
This implementation incorporates the write-lock stealing work of
Michel Lespinasse <walken@google.com>.
Cc: Michel Lespinasse <walken@google.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4898e640caf03fdbaf2122d5a33949bf3e4a5b34)
read yuv mode flag bit from bootloader for seamless hdmi support
in yuv 4:2:0 8 bit mode and set AVI infoframe parameters.
Also skip disabling avi infoframe before configuring for seamless case.
Add tegra_pd_ops for ape and adsp power domains so
that driver's *runtime_suspend() and *runtime_resume()
routines are called as part of stop_dev() and
start_dev() and not at the last when power domain is
being powered off.