JC Kuo [Wed, 30 Jan 2013 13:10:28 +0000 (21:10 +0800)]
xhci: tegra: WAR for utmipll in IDDQ mode
At resume path, clock driver (tegra11_pll_clk_init()) put utmipll in
IDDQ mode, USB 3.0 needs utmipll being carried out of IDDQ mode for
proper UTMI operation.
JC Kuo [Wed, 30 Jan 2013 07:12:10 +0000 (15:12 +0800)]
xhci: tegra: WAR for utmi bias pd bit
This is a workaround for utmi bias pad power down bit setting.
BIAS_PD bit of UTMIP_BIAS_CFG0 register has to be cleared if xusb
owns any of the utmi ports.
Alex Frid [Thu, 31 Jan 2013 05:27:50 +0000 (21:27 -0800)]
ARM: tegra11: clock: Don't propagate boot clock clean up
When disabling coupled gate clocks left on by boot-loader, but not
ref-counted during kernel initialization, do not propagate disable
operation to coupled parents.
Richard Zhao [Mon, 21 Jan 2013 01:51:41 +0000 (01:51 +0000)]
ARM: tegra11x: set cpu_lp2_min_residency to 1000
cpu_lp2_min_residency set the minimal cpuidle lp2 target residency. It
can tune chances entering to lp2.
It fixes bug that lp2 consumes more power when video playback. If
cpu_lp2_min_residency is zero, it causes higher G cpu residency and
more cluster switch.
JC Kuo [Thu, 6 Dec 2012 12:16:19 +0000 (20:16 +0800)]
usb: xhci: fix Short Packet handling for isochronous
When Short Packet happens on a multiple-TRBs TD, xHCD needs to
calculate the exact amount of transferred data because upper layer
driver wants it. In order to achieve, xHCD has to:
1. set ISP bit for all TRBs belongs to a IN TD, and
2. set IOC bit for the last TRB of the IN TD.
Once HC detects a Short Transfer, HC will send Short Packet event for
the TRB which encountered Short Packet and also send Short Packet event
fot the last TRB which has IOC bit set.
With those two events, xHCD can calculate the exact amount of bytes which
xHC has completed for the TD. (4.10.1.1)
Ajay Gupta [Wed, 16 Jan 2013 22:23:56 +0000 (14:23 -0800)]
usb: xhci: tegra: add delay after PMC_USB_AO_0 program
We have seen LP0 loop when system wake done using FS device connect.
Discussed with hardware team and USB2 team and this delay is needed
for D+/D- value detectors to become stable
Julius Werner [Thu, 1 Nov 2012 19:47:59 +0000 (12:47 -0700)]
xhci: fix null-pointer dereference when destroying half-built segment rings
xhci_alloc_segments_for_ring() builds a list of xhci_segments and links
the tail to head at the end (forming a ring). When it bails out for OOM
reasons half-way through, it tries to destroy its half-built list with
xhci_free_segments_for_ring(), even though it is not a ring yet. This
causes a null-pointer dereference upon hitting the last element.
Furthermore, one of its callers (xhci_ring_alloc()) mistakenly believes
the output parameters to be valid upon this kind of OOM failure, and
calls xhci_ring_free() on them. Since the (incomplete) list/ring should
already be destroyed in that case, this would lead to a use after free.
This patch fixes those issues by having xhci_alloc_segments_for_ring()
destroy its half-built, non-circular list manually and destroying the
invalid struct xhci_ring in xhci_ring_alloc() with a plain kfree().
This patch should be backported to kernels as old as 2.6.31, that
contains the commit 0ebbab37422315a5d0cb29792271085bafdf38c0 "USB: xhci:
Ring allocation and initialization."
A separate patch will need to be developed for kernels older than 3.4,
since the ring allocation code was refactored in that kernel.
Change-Id: I4d2a860f8d4773bedc76b7c1fc1bb42b7322dbcf Signed-off-by: Julius Werner <jwerner@chromium.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: http://git-master/r/192889
(cherry picked from commit 98033448c22e3605fe38b4ea254c79da6da964e4)
Elric Fu [Wed, 27 Jun 2012 08:55:43 +0000 (16:55 +0800)]
xHCI: handle command after aborting the command ring
According to xHCI spec section 4.6.1.1 and section 4.6.1.2,
after aborting a command on the command ring, xHC will
generate a command completion event with its completion
code set to Command Ring Stopped at least. If a command is
currently executing at the time of aborting a command, xHC
also generate a command completion event with its completion
code set to Command Abort. When the command ring is stopped,
software may remove, add, or rearrage Command Descriptors.
To cancel a command, software will initialize a command
descriptor for the cancel command, and add it into a
cancel_cmd_list of xhci. When the command ring is stopped,
software will find the command trbs described by command
descriptors in cancel_cmd_list and modify it to No Op
command. If software can't find the matched trbs, we can
think it had been finished.
This patch should be backported to kernels as old as 3.0, that contain
the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
assertion to check for virt_dev=0 bug." That commit papers over a NULL
pointer dereference, and this patch fixes the underlying issue that
caused the NULL pointer dereference.
Change-Id: Iacd87c59b7ec4a89a36ecb9e741b6a05c9b2939d Signed-off-by: Elric Fu <elricfu1@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com> Cc: stable@vger.kernel.org Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: http://git-master/r/192888
(cherry picked from commit e848acee24ce2530d14730a2d819ca5f92149cbf)
Elric Fu [Wed, 27 Jun 2012 08:31:52 +0000 (16:31 +0800)]
xHCI: cancel command after command timeout
The patch is used to cancel command when the command isn't
acknowledged and a timeout occurs.
This patch should be backported to kernels as old as 3.0, that contain
the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
assertion to check for virt_dev=0 bug." That commit papers over a NULL
pointer dereference, and this patch fixes the underlying issue that
caused the NULL pointer dereference.
Change-Id: If0818ee9da17afedd4e4326baf72418b609c84dc Signed-off-by: Elric Fu <elricfu1@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com> Cc: stable@vger.kernel.org Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: http://git-master/r/192887
(cherry picked from commit 22f80927cc0abc9a39c2752740b3403e0721f41d)
Elric Fu [Wed, 27 Jun 2012 08:31:12 +0000 (16:31 +0800)]
xHCI: add aborting command ring function
Software have to abort command ring and cancel command
when a command is failed or hang. Otherwise, the command
ring will hang up and can't handle the others. An example
of a command that may hang is the Address Device Command,
because waiting for a SET_ADDRESS request to be acknowledged
by a USB device is outside of the xHC's ability to control.
To cancel a command, software will initialize a command
descriptor for the cancel command, and add it into a
cancel_cmd_list of xhci.
Sarah: Fixed missing newline on "Have the command ring been stopped?"
debugging statement.
This patch should be backported to kernels as old as 3.0, that contain
the commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an
assertion to check for virt_dev=0 bug." That commit papers over a NULL
pointer dereference, and this patch fixes the underlying issue that
caused the NULL pointer dereference.
Change-Id: I6d008c9e56b8612393f1952473b3a50fe88b8c0a Signed-off-by: Elric Fu <elricfu1@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com> Cc: stable@vger.kernel.org Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: http://git-master/r/192886
(cherry picked from commit 16c9b4cf3e6669864671ef0410e4796ef1796581)
Elric Fu [Wed, 27 Jun 2012 08:30:57 +0000 (16:30 +0800)]
xHCI: add cmd_ring_state
Adding cmd_ring_state for command ring. It helps to verify
the current command ring state for controlling the command
ring operations.
This patch should be backported to kernels as old as 3.0. The commit 7ed603ecf8b68ab81f4c83097d3063d43ec73bb8 "xhci: Add an assertion to
check for virt_dev=0 bug." papers over the NULL pointer dereference that
I now believe is related to a timed out Set Address command. This (and
the four patches that follow it) contain the real fix that also allows
VIA USB 3.0 hubs to consistently re-enumerate during the plug/unplug
stress tests.
Change-Id: I50976948d2d81a73d7019b20139e93d1a84e38e5 Signed-off-by: Elric Fu <elricfu1@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Tested-by: Miroslav Sabljic <miroslav.sabljic@avl.com> Cc: stable@vger.kernel.org Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: http://git-master/r/192885
(cherry picked from commit e3a84306998accbf075697d88792cd6c1eabe435)
Dan Carpenter [Mon, 13 Aug 2012 16:57:03 +0000 (19:57 +0300)]
xhci: Fix a logical vs bitwise AND bug
The intent was to test whether the flag was set.
This patch should be backported to stable kernels as old as 3.0, since
it fixes a bug in commit e95829f474f0db3a4d940cae1423783edd966027 "xhci:
Switch PPT ports to EHCI on shutdown.", which was marked for stable.
Change-Id: I084865f97fdc38d8966b49c92eafe51d7cc660a6 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: http://git-master/r/190499
(cherry picked from commit e54abee5308040fabddedae314626a5bd2f1da08)
Xiaohui Tao [Tue, 29 Jan 2013 23:02:01 +0000 (15:02 -0800)]
input: touch: raydium: fix panic when touch panel not attached
This issue is because the upper hal level is calling the driver
to suspend even when the driver is not installed. Cleanup the
resources when the driver fails to install.
1. The LP0 Warmboot code of TF has been updated to reflect last changes
of Tegra bootloader. TF boot parameters which are passed to secure os
are removed in warmboot code. They can't live in warmboot code anymore
because of PKC boot feature in T114.
2. Disable L2 prefetch throttle to enhance performance.
Amit Kamath [Tue, 29 Jan 2013 10:09:58 +0000 (15:39 +0530)]
ARM: tegra: Add barriers after cache operations
memory and instruction barriers are needed after the tlb is
invalidated and BTAC is flushed as per ARM TRM. Without this
there is a invalid page translation in some cases.
Alex Frid [Fri, 25 Jan 2013 08:05:20 +0000 (00:05 -0800)]
ARM: tegra11: clock: Force out-of-table shared bus max limit
So far, rate cap set by shared bus user with SHARED_CEILING attribute
was not clipped to possible bus rates. Since final rounding on shared
bus is always in up direction, bus clock could run at rate above the
ceiling that does not exactly match one of available bus rates. This
is fixed now by rounding cap rate down to possible bus rate before
final shared rate is determined.
Change-Id: I4a28118cadc7804fec7a2832bc7584a3380505be Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/194854 Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Wen Yi <wyi@nvidia.com> Reviewed-by: Richard Zhao <rizhao@nvidia.com>
GVS: Gerrit_Virtual_Submit
Neil Patel [Fri, 25 Jan 2013 22:36:44 +0000 (17:36 -0500)]
ARM: tegra: baseband: fix crash when queueing EDP work
Add a check for EDP initialization in the driver before queueing EDP
work on the modem workqueue. Otherwise a BUG() will occur in cases
where the EDP client is not enabled.
Change-Id: Ibacb19abfe955244da4a833f39bd0adf13e4f04c Signed-off-by: Neil Patel <neilp@nvidia.com>
Reviewed-on: http://git-master/r/194268 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Steve Lin <stlin@nvidia.com> Reviewed-by: Steve Lin <stlin@nvidia.com>
Bo Yan [Fri, 25 Jan 2013 21:55:24 +0000 (13:55 -0800)]
ARM: tegra: Remove redundant tegra_idle_device
cpuidle.c in drivers/cpuidle already defines per-CPU variable
cpuidle_devices, which holds registered devices for each CPU.
The static tegra_idle_device is unnecessary.
Change-Id: I471515b8d582fc25f5cec0f2d78b2db14b064c4e Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/194267 Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
Alex Frid [Fri, 18 Jan 2013 04:55:33 +0000 (20:55 -0800)]
ARM: tegra11: clock: Set shared ceiling users "always On"
Shared ceiling users apply caps to shared bus rate even if they are
disabled (this way shared bus clock can stay disabled when only cap
is applied). To properly reflect this relationship initialize shared
ceiling users in ON state with refcount 1.
Bo Yan [Wed, 23 Jan 2013 19:02:16 +0000 (11:02 -0800)]
ARM: tegra11x: more accurate sleep time
The sleep length in tick data structure does not reflect how long
timer has been running, thus the expected wake up trigger may be
set to a value which is too late.
Directly accessing timer register to get the next timer event,
which is then used to calculate the expected wake up time.
This implies we are sleeping shorter than before in case of cluster
power down, but will make sure we don't oversleep.
Change-Id: I84598db30b6a739103026d090b130f3adb63147b Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/193483 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
EARLYSUSPEND is not available in K3.4 and beyond. Hence reverting this
change. To achieve power savings expected from original change, need to
think of another ways like Run-time PM or something else.
Laxman Dewangan [Thu, 24 Jan 2013 08:31:01 +0000 (14:01 +0530)]
ARM: tegra: dalmore: cleanup key support for 1000 and 1001 SKU
The 1001 SKU keys are supported with GPIO keys and KBC keys. Looking
at schematics, we do not need to have Tegra KBC based mapping for 1001
SKU. GPIO keys will suffice the requirements.
Clean-up the key registration and add all keys of 1001 SKU as gpio keys
Vijay Mali [Mon, 28 Jan 2013 06:13:31 +0000 (11:43 +0530)]
ARM: tegra11: pluto: Add HiFi sample rate for AIC3262 Codec
Add sample rate in HiFi port configuration for AIC3262 codec.
Initilization of sample rate is required to avoid reading wrong
sample rate of HiFi port during voice call recording case.
Bo Yan [Fri, 25 Jan 2013 00:42:47 +0000 (16:42 -0800)]
ARM: tegra11x: Increase target residency for cluster
Set threshold for C1NC power gating at 4ms for now. This needs to
be fine tuned. Set threshold for rail gating at 8ms for now, this
is an arbitrary number which is larger than the one for C1NC, but
rail gating has not been enabled yet, and also needs to be fine
tuned.
Anshul Jain [Thu, 24 Jan 2013 02:05:56 +0000 (18:05 -0800)]
hwmon: ina3221: Support for turning off ina
This is an optimization to turn off INA device based on number of cores
online. Also, this change removes support for turning on/off INA at runtime
using sysfs node. Additionaly, this change creates a new API power2_*,
which return 0 if ina device is turned off.
Jon Mayo [Tue, 11 Dec 2012 21:02:12 +0000 (13:02 -0800)]
video: tegra: dc: support HDMI avi format values
Support all HDMI VIC format values using cea_modes[] list for determining the
the AVI format number. Stores aspect ratio in fb_videmode and tegra_dc_mode so
that ambiguous modes are resolved.
Presently value of firmware configurable param is 5 for all
platforms. For 298Hz panel, idle will be invoked when no touch
activity is detected for ~168ms. During this time interval panel
will keep on raising IRQ at scan rate. Current CPU boosting logic
will keep on sending PM QoS request to boost CPU during this
interval, which can result to increased power numbers.
To boost CPU we can use the fact that raydium driver puts panel
into autoscan-mode after TimeToIdle, the mode where panel will
not send IRQ's unless it detects touch. This will result into
better power numbers as well serve the purpose to boost CPU only
on first touch IRQ.
If autoscan mode or idle mode is disabled, CPU won't be boosted.
undef NV_ENABLE_CPU_BOOST to disable CPU boosting.