7 years agopm: EDP: adding client registration
Sivaram Nair [Tue, 3 Jul 2012 14:20:58 +0000]
pm: EDP: adding client registration

This patch adds client registration functionality to the existing EDP
framework.

Bug ID: 917926

Change-Id: I8c9fbe3e1d934a6d95745f3c3933df4c1cbea4e7
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/115706
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Matthew Longnecker <mlongnecker@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Bo Yan <byan@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

7 years agopm: EDP: introducing EDP manager
Sivaram Nair [Tue, 3 Jul 2012 09:16:17 +0000]
pm: EDP: introducing EDP manager

This patch introduces EDP manager - the central piece of software which
dynamically allocates current sourcing capacity to EDP client drivers
for use by their devices.

Bug ID: 917926

Change-Id: I67d72c8c7738edf11ccfc8fdb73e86a02f653967
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/115696
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Matthew Longnecker <mlongnecker@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Bo Yan <byan@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

7 years agoARM: tegra11: stub out emc early-ack function
Bo Yan [Fri, 20 Jul 2012 23:09:53 +0000]
ARM: tegra11: stub out emc early-ack function

For tegra11x, stub out emc early-ack function to fix build. The
implementation will come in later patch.

Change-Id: I3ee27398570908d50de844c865e97cc0249ea49e
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/117468
Reviewed-by: Automatic_Commit_Validation_User

7 years agoarm: tegra: curacao: Use DisplayB as default
Seshendra Gadagottu [Thu, 19 Jul 2012 22:06:43 +0000]
arm: tegra: curacao: Use DisplayB as default

Bug 1013917

Change-Id: Ib4d8b0df990c2d06c0d0019dbca0297278ac6d97
Reviewed-on: http://git-master/r/117173
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agovideo: tegra: avp: Fix uninitialized variable
Bo Yan [Thu, 19 Jul 2012 22:06:05 +0000]
video: tegra: avp: Fix uninitialized variable

Change-Id: Ia479bb2d5bce94bac1265a4ab29ab23031b9540d
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/117172
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agocrypto: tegra-se: Program slot zero for RNG operation
Mallikarjun Kasoju [Mon, 16 Jul 2012 06:35:35 +0000]
crypto: tegra-se: Program slot zero for RNG operation

RNG operation updates UIV. So program reserved
slot i.e., slot zero before every RNG operation.

Bug 1017413

Change-Id: I831b8cfd275ebecb5e6df3166a977b0cc5a26a8a
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: http://git-master/r/115992
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra11: clock: Update cbus operations
Alex Frid [Sat, 14 Jul 2012 06:07:58 +0000]
ARM: tegra11: clock: Update cbus operations

When several users request the same rate, select the slowest one
as the top user (instead of selecting in order of link list parsing).

Eliminate debugfs floor user from top user selection.

Prevent top user migration if it has the same dvfs table as the
slowest user on the same bus.

Change-Id: I9b0ba04d60b9408cc68a81e1cb59baee7f37fed8
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/117249
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bo Yan <byan@nvidia.com>

7 years agoARM: tegra11: clock: Replace cbus cross-mutex
Alex Frid [Wed, 11 Jul 2012 06:26:03 +0000]
ARM: tegra11: clock: Replace cbus cross-mutex

Replaced cbus specific cross-mutex with generic cross-clock mutex.

Change-Id: Ifd5612ea2261a9c301270c0a10c80fab3006966b
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/117248
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra: clock: Add cross-clock locking option
Alex Frid [Wed, 11 Jul 2012 05:59:48 +0000]
ARM: tegra: clock: Add cross-clock locking option

Added an option to serialize clock operations for several clocks
(in addition to individual clock locking). This option may be used,
for example, when moving clocks between virtual buses or to support
clocks with different dvfs tables, but common enable control.

Change-Id: I88b366d4109bdb6ae952385dd84fab392715ac10
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/117247
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra11: clock: Add missed PERIPH_ON_APB attributes
Alex Frid [Fri, 13 Jul 2012 03:34:10 +0000]
ARM: tegra11: clock: Add missed PERIPH_ON_APB attributes

Change-Id: I0d41e6a83dd2499f843a452051c2f1ff78c75be0
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/117246
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bo Yan <byan@nvidia.com>

7 years agoARM: tegar11: clock: Fix common initialization table
Alex Frid [Fri, 13 Jul 2012 01:50:47 +0000]
ARM: tegar11: clock: Fix common initialization table

Fixed merge artifacts.

Change-Id: I610559303afb972e52f10b04897c265cc0f8a36a
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/117245
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra11: clock: Add ADX, AMX, TRACE and SOC_THERM clocks
Alex Frid [Fri, 13 Jul 2012 03:06:21 +0000]
ARM: tegra11: clock: Add ADX, AMX, TRACE and SOC_THERM clocks

Change-Id: Ifc41ee0b36b24dbb6e5029dde1b047d3c47ce96c
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/117244
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bo Yan <byan@nvidia.com>

7 years agoARM: tegra: Use GIC IRQ/FIQ as LP2 wake event
Bo Yan [Thu, 19 Jul 2012 16:24:44 +0000]
ARM: tegra: Use GIC IRQ/FIQ as LP2 wake event

Whenever possible, GIC IRQ/FIQ should be used to wake up CPUs in LP2,
this can be done by setting up wake-up condition as WAIT-FOR-EVENT
and event sources as GIC IRQ/FIQ.

This is supported coincidentally in all SoCs with symmetric CPU power
gating.

Change-Id: I7fafee5218b5db386fc993a064c53295c9c7e60b
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/117111
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra11: Disable cache before flushing
Bo Yan [Tue, 17 Jul 2012 20:50:55 +0000]
ARM: tegra11: Disable cache before flushing

This is needed before power gating Cortex A15 processor.

Change-Id: Ib6eb2dd78ea0b34c978386105a172f0c0eea8a5c
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/116549
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: Enable LOCAL_TIMERS for ARCH timer support
Bo Yan [Tue, 17 Jul 2012 06:30:41 +0000]
ARM: Enable LOCAL_TIMERS for ARCH timer support

Just like local timer in A9, arch timer in A15 is for local CPU too.
Thus local timer support is needed even when arch timer is in system
, however, arch timer can't co-exist with SMP TWD.

Change-Id: Ibcdc73eed36035c6f5b3560d632226a74b6bc9e7
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/116350
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra11: Set up tegra timer as clock source
Bo Yan [Tue, 17 Jul 2012 06:23:45 +0000]
ARM: tegra11: Set up tegra timer as clock source

architected timer is set up for boot cpu in percpu_timer_setup, this
is quite late during system boot. Before it's done, it is necessary
to register clockevents using tegra timer.

The same thing is also true for ARM twd timer, which is already taken
care of in the code. This change merely enables the same code for
arch timer.

Change-Id: I2ffd1ffa9be8b71902cb6151462d5b6cb641a355
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/116349
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoMerge remote-tracking branch 'origin/dev/android-t114-3.4-nv-3.1-merge' into work
varun colbert [Fri, 20 Jul 2012 21:06:39 +0000]
Merge remote-tracking branch 'origin/dev/android-t114-3.4-nv-3.1-merge' into work

7 years agovideo: tegra: dc: fix uninitialised variables
Varun Wadekar [Fri, 20 Jul 2012 12:52:57 +0000]
video: tegra: dc: fix uninitialised variables

Change-Id: I26dba11ddb5dfff7c642dfec135af36e9f43d98e
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agovideo: tegra: update nvmap_alloc_handle interface for Android only
Varun Wadekar [Tue, 17 Jul 2012 04:20:46 +0000]
video: tegra: update nvmap_alloc_handle interface for Android only

Bug 1017884

Change-Id: Ie50f4628f65f86ae52fd2c97f440fce8afb168cd
Reported-by: Michal Pecio <mpecio@nvidia.com>
Signed-off-by: Michal Pecio <mpecio@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/116724
Reviewed-by: Automatic_Commit_Validation_User

7 years agoarm: tegra: usb_phy: Clear SLEWN and SLEWP pad bits
Venu Byravarasu [Tue, 17 Jul 2012 12:46:11 +0000]
arm: tegra: usb_phy: Clear SLEWN and SLEWP pad bits

SLEWN and SLEWP bits of HSIC pad registers are
cleared to 0 from the default power on reset values.

bug 959859

Change-Id: I44be59e0726b7bf50bfc4e647dc61e2b3a2f3041
Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-on: http://git-master/r/116438
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

7 years agoARM: tegra: clock: Fix extended clock API
Alex Frid [Thu, 12 Jul 2012 23:38:12 +0000]
ARM: tegra: clock: Fix extended clock API

Fixed merge artifact in extended clock configuration API: use clock
locking function that appropriately selects locking primitives for
the particular clock (instead of unconditionally calling spin-lock
primitives).

Signed-off-by: Alex Frid <afrid@nvidia.com>

Change-Id: I8b048a64ad69dad209c0160eac59ed916fb2cd7b
Reviewed-on: http://git-master/r/115540
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Bo Yan <byan@nvidia.com>

7 years agoARM: tegra11: clock: Add new CSI and DSI clocks
Alex Frid [Wed, 11 Jul 2012 19:30:20 +0000]
ARM: tegra11: clock: Add new CSI and DSI clocks

Change-Id: I1fab61127faaf19fe51f77efebb6642337ccfb70
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/115481
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra11: clock: Re-group clock source muxes definitions
Alex Frid [Sun, 8 Jul 2012 04:07:24 +0000]
ARM: tegra11: clock: Re-group clock source muxes definitions

Change the layout of clock source muxes definitions in the file for
better grouping and readability. Definitions itself are not changed.

Change-Id: I53692890b9bc8589c6762dc99d45f827db1e97c3
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/115480
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra11: clock: Restore mselect clock
Alex Frid [Wed, 11 Jul 2012 23:20:59 +0000]
ARM: tegra11: clock: Restore mselect clock

Fixed merge artifact - restored mselect clock.

Change-Id: Ibea7cfd9b738e406ee111c3d639204306fe2c631
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/115479
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra11: clock: Correct HDA device ids
Rahul Mittal [Mon, 16 Jul 2012 08:53:12 +0000]
ARM: tegra11: clock: Correct HDA device ids

Tegra30 hda devices are reused for Tegra11
Correcting device ids in clock table

Change-Id: I7d3c731807b6d1c3fa32ca271a4eb73c717dabde
Signed-off-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-on: http://git-master/r/115288
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra11: clock: Add PLLRE (reference PLLE) support
Alex Frid [Tue, 10 Jul 2012 05:46:36 +0000]
ARM: tegra11: clock: Add PLLRE (reference PLLE) support

Added support for PLLE reference PLLRE. Since PLLRE exposes to clock
tree two different clocks: VCO clock before post divider, and output
clock after post divider - it is represented by two separate objects:
pll_re_vco, and pll_re_out.

Change-Id: I4ce34bc14024b18775f1d83a3c361d1fbaee9dda
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/115121
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra: curacao: Use RGB for simulation
Jeff Smith [Tue, 10 Jul 2012 01:02:25 +0000]
ARM: tegra: curacao: Use RGB for simulation

Change-Id: Idf4dfac96db398f83d27463f7ef0393f4c730a1e
Reviewed-on: http://git-master/r/114323
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoARM: tegra: curacao_sim: update defconfig for 3.4
Jeff Smith [Mon, 9 Jul 2012 22:23:24 +0000]
ARM: tegra: curacao_sim: update defconfig for 3.4

Change-Id: I5178d98254f53f444fe57e8e083679490f787cda
Signed-off-by: Jeff Smith <jsmith@nvidia.com>
Reviewed-on: http://git-master/r/114322
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bo Yan <byan@nvidia.com>

7 years agodrivers: media: tegra: Fix un-initialized vars
Prashant Malani [Wed, 18 Jul 2012 02:51:28 +0000]
drivers: media: tegra: Fix un-initialized vars

Fix previously uninitialized variables which
were causing build breaks with JB.

Change-Id: I257705de378ec87e7ae57a43e737183ab6027e80
Signed-off-by: Prashant Malani <pmalani@nvidia.com>
Reviewed-on: http://git-master/r/116648
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>

7 years agoRevert "media: video: tegra: sh532u: Focuser range tuning support"
Varun Wadekar [Thu, 19 Jul 2012 10:24:20 +0000]
Revert "media: video: tegra: sh532u: Focuser range tuning support"

This reverts commit 209a8bac16d8dc13381849491bac08ad0a6c3b56. With this commit
camera auto-focus never works and image capture fails.

Change-Id: I56883e52bb24efba5b476ab9a140f6acee6c092d
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoRevert "ARM: tegra: make tegra_cpu_reset_handler_enable() __init"
Varun Wadekar [Wed, 18 Jul 2012 12:31:29 +0000]
Revert "ARM: tegra: make tegra_cpu_reset_handler_enable() __init"

This reverts commit c1389ce1e02c1e1f617d7cf70852ad5d9f9ef355 as it breaks
LP0 resume. Clearly, this was not tested before pushing upstream.

Change-Id: Iaf0a40f5c290c6f73c84b5d5bbba33d70c373a49
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoMerge commit 'v3.4.5' into android-t114-3.4-rebased
Varun Wadekar [Wed, 18 Jul 2012 12:20:45 +0000]
Merge commit 'v3.4.5' into android-t114-3.4-rebased

Linux v3.4.5

Conflicts:
drivers/base/power/main.c

Change-Id: I782e650a89665caea8aed9e5598234888dc11088
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: Tegra3: defconfig: remove dupicate entries
Varun Wadekar [Wed, 18 Jul 2012 10:32:40 +0000]
ARM: Tegra3: defconfig: remove dupicate entries

Remove the following duplicate entries:
* CONFIG_PCIEPORTBUS=y
* CONFIG_PCIEASPM_POWERSAVE=y

Change-Id: Ie7541461f24cc44a3ad803d8232f12c98d04e9ba
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoRevert "power: Add option to log time spent in suspend"
Arve Hjønnevåg [Wed, 6 Jun 2012 01:06:42 +0000]
Revert "power: Add option to log time spent in suspend"

This reverts commit 847bb6f2bc6e7c6d9c8e8a450b586a8ca3f1dba5.

7 years agoStaging: android: binder: Add some tracepoints
Arve Hjønnevåg [Thu, 24 May 2012 22:10:08 +0000]
Staging: android: binder: Add some tracepoints

Add tracepoints:
- ioctl entry and exit
- Main binder lock: lock, locked and unlock
- Command and return buffer opcodes
- Transaction: create and receive
- Transaction buffer: create and free
- Object and file descriptor transfer
- binder_update_page_range

Change-Id: Ib09ae78b0b8b75062325318e2307afd71b7c4458
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agoStaging: android: binder: Add some missing binder_stat_br calls
Arve Hjønnevåg [Sat, 26 May 2012 03:15:56 +0000]
Staging: android: binder: Add some missing binder_stat_br calls

Cached thread return errors, death notifications and new looper
requests were not included in the stats.

Change-Id: Iabe14b351b662d3f63009ecb3900f92fc3d72cc4
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agogpu: ion: fill in buffer->{dev,size} before mapping new buffers
Greg Hackmann [Tue, 5 Jun 2012 20:23:42 +0000]
gpu: ion: fill in buffer->{dev,size} before mapping new buffers

At least one map_dma() implementation (EXYNOS_CONTIG) assumes the fields
are filled in

Change-Id: I88c84dc5663df41f9aa9401b5f80fc2570f9dd95
Signed-off-by: Greg Hackmann <ghackmann@google.com>

7 years agoPM / Suspend: Print wall time at suspend entry and exit
Todd Poynor [Wed, 30 May 2012 00:33:56 +0000]
PM / Suspend: Print wall time at suspend entry and exit

Change-Id: I92f252414c013b018b9a392eae1ee039aa0e89dc
Signed-off-by: Todd Poynor <toddpoynor@google.com>

7 years agoandroid: persistent_ram: Allow specifying ecc parameters in platform data
Arve Hjønnevåg [Tue, 22 May 2012 23:33:23 +0000]
android: persistent_ram: Allow specifying ecc parameters in platform data

Change-Id: If5aaa968f6ce85ac8e18f07cca286f20f0aa6e58
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agoandroid: persistent_ram: Include ecc_size when calculating ecc_block
Arve Hjønnevåg [Tue, 20 Mar 2012 23:01:31 +0000]
android: persistent_ram: Include ecc_size when calculating ecc_block

Wastes less memory and allows using more memory for ecc than data.

Change-Id: I1537d28ef3e8626e2dfdc69f2e185d28b7600916
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agosw_sync: export sw_sync API
Erik Gilling [Wed, 16 May 2012 20:14:43 +0000]
sw_sync: export sw_sync API

Needed to let modules link against sw_sync.

Change-Id: I71d3e52677ef21b6e1ecdb84f831491be1f4fbe6
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agosync: export sync API symbols
Erik Gilling [Wed, 16 May 2012 20:09:22 +0000]
sync: export sync API symbols

This is needed to allow modules to link against the sync subsystem

Change-Id: I15c1818de329f24e4113ef1d0923413b22fd0eff
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agosync: allow async waits to be canceled
Erik Gilling [Tue, 15 May 2012 23:23:26 +0000]
sync: allow async waits to be canceled

In order to allow drivers to cleanly handled teardown we need to allow them
to cancel pending async waits.  To do this cleanly, we move allocation of
sync_fence_waiter to the driver calling sync_async_wait().

Change-Id: Ifcd95648be6ec07026d67f810070a4310f099989
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agousb: gadget: android: Fix product name
Benoit Goby [Tue, 29 May 2012 20:57:27 +0000]
usb: gadget: android: Fix product name

Product names may contain spaces and scanf %s only matches the 1st word.
Use strlcpy instead.

Change-Id: Ie8703fea9775f7fc17fe615a42597ca3816d36b0
Signed-off-by: Benoit Goby <benoit@android.com>

7 years agogpu: ion: Get an sg_table from an ion handle
Rebecca Schultz Zavin [Wed, 23 May 2012 19:55:55 +0000]
gpu: ion: Get an sg_table from an ion handle

This patch adds an interface to return and sg_table given a
valid ion handle.

Change-Id: Icd948c60c1af0a4279f337bcd591cd39b46325e8
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

7 years agogpu: ion: Allocate the sg_table at creation time rather than dynamically
Rebecca Schultz Zavin [Mon, 7 May 2012 23:06:32 +0000]
gpu: ion: Allocate the sg_table at creation time rather than dynamically

Rather than calling map_dma on the allocations dynamically, this patch
switches to creating the sg_table at the time the buffer is created.
This is necessary because in future updates the sg_table will be used
for cache maintenance.

Change-Id: I49aac7c6d3a5afc440d18b917ae0e73be5d3f56d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

7 years agogpu: ion: support begin/end and kmap/kunmap dma_buf ops
Rebecca Schultz Zavin [Fri, 27 Apr 2012 03:44:10 +0000]
gpu: ion: support begin/end and kmap/kunmap dma_buf ops

These ops were added in the 3.4 kernel.  This patch adds support
for them to ion.  Previous ion_map/unmap_kernel api is also
retained in addition to this new api.

Change-Id: I6d2db284dce12c2d8cc4e540865beee2da43bd0c
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

7 years agogpu: ion: Use alloc_pages instead of vmalloc from the system heap
Rebecca Schultz Zavin [Mon, 30 Apr 2012 23:45:38 +0000]
gpu: ion: Use alloc_pages instead of vmalloc from the system heap

With this change the ion_system_heap will only use kernel address
space when the memory is mapped into the kernel (rare case).

Change-Id: I8702cf89ffec0bd5c337bd88d7444013d4d94bc8
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

7 years agoion: Switch ion to use dma-buf
Rebecca Schultz Zavin [Wed, 1 Feb 2012 19:09:46 +0000]
ion: Switch ion to use dma-buf

Ion now uses dma-buf file descriptors to share
buffers with userspace.  Ion becomes a dma-buf
exporter and any driver that can import dma-bufs
can now import ion file descriptors.

Change-Id: Ia04d6d72fb301dc088eb8db6576822e9260ff332
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

7 years agodma-buf: mmap support
Daniel Vetter [Wed, 18 Apr 2012 13:52:26 +0000]
dma-buf: mmap support

Compared to Rob Clark's RFC I've ditched the prepare/finish hooks
and corresponding ioctls on the dma_buf file. The major reason for
that is that many people seem to be under the impression that this is
also for synchronization with outstanding asynchronous processsing.
I'm pretty massively opposed to this because:

- It boils down reinventing a new rather general-purpose userspace
  synchronization interface. If we look at things like futexes, this
  is hard to get right.
- Furthermore a lot of kernel code has to interact with this
  synchronization primitive. This smells a look like the dri1 hw_lock,
  a horror show I prefer not to reinvent.
- Even more fun is that multiple different subsystems would interact
  here, so we have plenty of opportunities to create funny deadlock
  scenarios.

I think synchronization is a wholesale different problem from data
sharing and should be tackled as an orthogonal problem.

Now we could demand that prepare/finish may only ensure cache
coherency (as Rob intended), but that runs up into the next problem:
We not only need mmap support to facilitate sw-only processing nodes
in a pipeline (without jumping through hoops by importing the dma_buf
into some sw-access only importer), which allows for a nicer
ION->dma-buf upgrade path for existing Android userspace. We also need
mmap support for existing importing subsystems to support existing
userspace libraries. And a loot of these subsystems are expected to
export coherent userspace mappings.

So prepare/finish can only ever be optional and the exporter /needs/
to support coherent mappings. Given that mmap access is always
somewhat fallback-y in nature I've decided to drop this optimization,
instead of just making it optional. If we demonstrate a clear need for
this, supported by benchmark results, we can always add it in again
later as an optional extension.

Other differences compared to Rob's RFC is the above mentioned support
for mapping a dma-buf through facilities provided by the importer.
Which results in mmap support no longer being optional.

Note that this dma-buf mmap patch does _not_ support every possible
insanity an existing subsystem could pull of with mmap: Because it
does not allow to intercept pagefaults and shoot down ptes importing
subsystems can't add some magic of their own at these points (e.g. to
automatically synchronize with outstanding rendering or set up some
special resources). I've done a cursory read through a few mmap
implementions of various subsytems and I'm hopeful that we can avoid
this (and the complexity it'd bring with it).

Additonally I've extended the documentation a bit to explain the hows
and whys of this mmap extension.

In case we ever want to add support for explicitly cache maneged
userspace mmap with a prepare/finish ioctl pair, we could specify that
userspace needs to mmap a different part of the dma_buf, e.g. the
range starting at dma_buf->size up to dma_buf->size*2. This works
because the size of a dma_buf is invariant over it's lifetime. The
exporter would obviously need to fall back to coherent mappings for
both ranges if a legacy clients maps the coherent range and the
architecture cannot suppor conflicting caching policies. Also, this
would obviously be optional and userspace needs to be able to fall
back to coherent mappings.

v2:
- Spelling fixes from Rob Clark.
- Compile fix for !DMA_BUF from Rob Clark.
- Extend commit message to explain how explicitly cache managed mmap
  support could be added later.
- Extend the documentation with implementations notes for exporters
  that need to manually fake coherency.

Change-Id: Ia8f2ae5d8a1b1c87ed12ca1c89d7bf2067239ee4
Cc: Rob Clark <rob.clark@linaro.org>
Cc: Rebecca Schultz Zavin <rebecca@android.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agogpu: ion: several bugfixes and enhancements of ION
KyongHo Cho [Wed, 7 Sep 2011 02:27:07 +0000]
gpu: ion: several bugfixes and enhancements of ION

1. Verifying if the size of memory allocation in ion_alloc() is aligned
by PAGE_SIZE at least. If it is not, this change makes the size to be
aligned by PAGE_SIZE.

2. Unmaps all mappings to the kernel and DMA address spaces when
destroying ion_buffer in ion_buffer_destroy(). This prevents leaks in
those virtual address spaces.

3. Makes the return value of ion_alloc() to be explicit Linux error code
when it fails to allocate a buffer.

4. Makes ion_alloc() implementation simpler. Removes 'goto' statement and
relavant call to ion_buffer_put().

5. Checks if the task is valid before calling put_task_struct() due
to failure on creating a ion client in ion_client_create().

6. Returns error when buffer allocation requested by userspace is failed.

Change-Id: I4fa9859f4a0b665fcb44e5c0da43c569732e93ae
Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>

7 years agoion: Add reserve function to ion
Rebecca Schultz Zavin [Tue, 31 Jan 2012 17:40:30 +0000]
ion: Add reserve function to ion

Rather than requiring each platform call memblock_remove or reserve
from the board file, add this to ion

Change-Id: Ie418a692c13e9e0cfe93ecc83d253d3ce860fc83
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

7 years agoion: Switch map/unmap dma api to sg_tables
Rebecca Schultz Zavin [Mon, 30 Jan 2012 22:18:08 +0000]
ion: Switch map/unmap dma api to sg_tables

Switch these api's from scatterlists to sg_tables

Change-Id: I8b99e39633df009d472ce24704fa26af7bb50fa2
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

7 years agousb: gadget: composite: Fix corruption when changing configuration
Benoit Goby [Wed, 16 May 2012 03:44:33 +0000]
usb: gadget: composite: Fix corruption when changing configuration

Remove the config from the configs list before releasing the spinlock.
Otherwise the other cpu might be processing a SET_CONFIGURATION that
will switch to the configuration that is being released.

Change-Id: Id4da0d0e18ead63e20cb236cd1d3e8e6d116acce
Signed-off-by: Benoit Goby <benoit@android.com>

7 years agodebug: add parameters to prevent entering debug mode on errors
Colin Cross [Thu, 17 May 2012 22:24:16 +0000]
debug: add parameters to prevent entering debug mode on errors

On non-developer devices kgdb prevents CONFIG_PANIC_TIMEOUT from
rebooting the device after a panic. Add module parameters
debug_core.break_on_exception and debug_core.break_on_panic to
allow skipping debug on panics and exceptions respectively.  Both
default to true to preserve existing behavior.

Change-Id: I75dce7263e96cee069a9750920cce83dc6f98e8c
Signed-off-by: Colin Cross <ccross@android.com>

7 years agosched/rt: fix SCHED_RR across cgroups
Colin Cross [Thu, 17 May 2012 00:22:23 +0000]
sched/rt: fix SCHED_RR across cgroups

task_tick_rt has an optimization to only reschedule SCHED_RR tasks
if they were the only element on their rq.  However, with cgroups
a SCHED_RR task could be the only element on its per-cgroup rq but
still be competing with other SCHED_RR tasks in its parent's
cgroup.  In this case, the SCHED_RR task in the child cgroup would
never yield at the end of its timeslice.  If the child cgroup
rt_runtime_us was the same as the parent cgroup rt_runtime_us,
the task in the parent cgroup would starve completely.

Modify task_tick_rt to check that the task is the only task on its
rq, and that the each of the scheduling entities of its ancestors
is also the only entity on its rq.

Change-Id: I4f5b118517f85db3570923eb2f5e4c933ece9247
Signed-off-by: Colin Cross <ccross@android.com>

7 years agosync: add poll support
Erik Gilling [Tue, 20 Mar 2012 00:28:32 +0000]
sync: add poll support

Change-Id: I294e481bba92658e6dd26f157ddbf0e9ff4ce8a5
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agosw_sync: add fill_driver_data support
Erik Gilling [Fri, 16 Mar 2012 00:46:07 +0000]
sw_sync: add fill_driver_data support

Change-Id: Ib3812d282db56362d82f5ccc9a12b7d2100ab93a
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agosync: add ioctl to get fence data
Erik Gilling [Fri, 16 Mar 2012 00:45:50 +0000]
sync: add ioctl to get fence data

Change-Id: I71410aef7e03a52562f7cb15b993ac8441b1fa12
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agosw_sync: add debug support
Erik Gilling [Thu, 15 Mar 2012 21:23:23 +0000]
sw_sync: add debug support

Change-Id: Ibcc5fa8cb36e283cdf0e3308064876722e2675fc
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agosync: add debugfs support
Erik Gilling [Thu, 15 Mar 2012 02:49:15 +0000]
sync: add debugfs support

Change-Id: I8a7ea63e454fbeee1ecf17e6c3caff7c43b24734
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agosync: add timestamps to sync_pts
Erik Gilling [Thu, 15 Mar 2012 21:59:33 +0000]
sync: add timestamps to sync_pts

Change-Id: I2ad855072b86873880769a09a3176e85aa1199d7
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agosw_sync: add cpu based sync driver
Erik Gilling [Wed, 18 Apr 2012 20:43:22 +0000]
sw_sync: add cpu based sync driver

Change-Id: I1042851f5e30f9fdc2f35bdad84123bcf108560f
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agosync: Add synchronization framework
Erik Gilling [Tue, 13 Mar 2012 22:34:34 +0000]
sync: Add synchronization framework

not run through checkpatch yet.

Change-Id: I209f9db2824e0313f467f11ab09e5f54f0a4a6b5
Signed-off-by: Erik Gilling <konkers@android.com>

7 years agousb: otg: otg-wakelock: Fix build for 3.4
Benoit Goby [Thu, 10 May 2012 23:41:40 +0000]
usb: otg: otg-wakelock: Fix build for 3.4

Change-Id: I97e21e9e6645bf18522675039e512f85fe836794
Signed-off-by: Benoit Goby <benoit@android.com>

7 years agotrace: power: add trace_clock_set_parent
Colin Cross [Wed, 9 May 2012 23:09:50 +0000]
trace: power: add trace_clock_set_parent

Adds a new trace event to be called from clk_set_parent.  Some
cpufreq drivers, including Tegra, reparent the cpu clock to a
slower clock while the main pll is relocking, tracing
clk_set_parent allows traces to show how for long the cpu is
running slower.

Uses a separate TRACE_EVENT instead of the clock event class to
allow the event to contain string names for the child and the
parent.

Signed-off-by: Colin Cross <ccross@android.com>

7 years agonetfilter: xt_qtaguid: start tracking iface rx/tx at low level
JP Abgrall [Fri, 27 Apr 2012 19:57:39 +0000]
netfilter: xt_qtaguid: start tracking iface rx/tx at low level

qtaguid tracks the device stats by monitoring when it goes up and down,
then it gets the dev_stats().
But devs don't correctly report stats (either they don't count headers
symmetrically between rx/tx, or they count internal control messages).

Now qtaguid counts the rx/tx bytes/packets during raw:prerouting and
mangle:postrouting (nat is not available in ipv6).

The results are in
  /proc/net/xt_qtaguid/iface_stat_fmt
which outputs a format line (bash expansion):
  ifname  total_skb_{rx,tx}_{bytes,packets}

Added event counters for pre/post handling.
Added extra ctrl_*() pid/uid debugging.

Change-Id: Id84345d544ad1dd5f63e3842cab229e71d339297
Signed-off-by: JP Abgrall <jpa@google.com>

7 years agonetfilter: xt_IDLETIMER: Add new netlink msg type
JP Abgrall [Fri, 27 Apr 2012 06:28:35 +0000]
netfilter: xt_IDLETIMER: Add new netlink msg type

Send notifications when the label becomes active after an idle period.
Send netlink message notifications in addition to sysfs notifications.
Using a uevent with
  subsystem=xt_idletimer
  INTERFACE=...
  STATE={active,inactive}

This is backport from common android-3.0
commit: beb914e987cbbd368988d2b94a6661cb907c4d5a
with uevent support instead of a new netlink message type.

Change-Id: I31677ef00c94b5f82c8457e5bf9e5e584c23c523
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
Signed-off-by: JP Abgrall <jpa@google.com>

7 years agoRevert "mmc: Set suspend/resume bus operations if CONFIG_PM_RUNTIME is used"
Colin Cross [Fri, 27 Apr 2012 21:03:41 +0000]
Revert "mmc: Set suspend/resume bus operations if CONFIG_PM_RUNTIME is used"

This reverts commit 2f4735e514e3e3ed9e55a8cd3c2c90690ee44b90.

7 years agonetfilter: xt_qtaguid: fix ipv6 protocol lookup
JP Abgrall [Tue, 17 Apr 2012 23:00:07 +0000]
netfilter: xt_qtaguid: fix ipv6 protocol lookup

When updating the stats for a given uid it would incorrectly assume
IPV4 and pick up the wrong protocol when IPV6.

Change-Id: Iea4a635012b4123bf7aa93809011b7b2040bb3d5
Signed-off-by: JP Abgrall <jpa@google.com>

7 years agonetfilter: qtaguid: initialize a local var to keep compiler happy.
JP Abgrall [Sat, 14 Apr 2012 02:22:35 +0000]
netfilter: qtaguid: initialize a local var to keep compiler happy.

There was a case that might have seemed like new_tag_stat was not
initialized and actually used.
Added comment explaining why it was impossible, and a BUG()
in case the logic gets changed.

Change-Id: I1eddd1b6f754c08a3bf89f7e9427e5dce1dfb081
Signed-off-by: JP Abgrall <jpa@google.com>

7 years agoHACK: video: tegra30: host: report "register_sets = 2" for NvRmModuleID_3D
Varun Wadekar [Tue, 17 Jul 2012 12:49:05 +0000]
HACK: video: tegra30: host: report "register_sets = 2" for NvRmModuleID_3D

Change-Id: I31936f31759d418df2bc59ab367f783ed269df1e
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: tegra: iovmm: Fix build error w/o CONFIG_IOVMM
Hiroshi DOYU [Thu, 12 Jul 2012 12:11:20 +0000]
ARM: tegra: iovmm: Fix build error w/o CONFIG_IOVMM

Update function prototype along with:

  commit 6cbf4c7465b7b70936cb422b509da0ad0829c306
  ARM: tegra: iovmm: Allow alloc_client to take struct device

Change-Id: I11d173429413ab268f6ab789d90f321e3d33de2c
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/115391
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

7 years agoARM: tegra: iovmm: Make IOMMU/IOVMM selectable in Kconfig
Hiroshi DOYU [Wed, 11 Jul 2012 13:51:24 +0000]
ARM: tegra: iovmm: Make IOMMU/IOVMM selectable in Kconfig

This patch enables to replace iovmm*.ko family with
tegra-{smmu,gart}.ko if needed in kernel config. To use IOMMU as
backend engine, Enable TEGRA_IOMMU_{GART,SMMU} under IOMMU in config,
and automatically disable IOVMM.

IOVMM is equivalent to IOMMU_API. TEGRA_IOVMM_GART is equivalent to
TEGRA_IOMMU_GART. TEGRA_IOVMM_SMMU is equivalent to TEGRA_IOMMU_SMMU.

Change-Id: I73408e927eb3f21e1db4e73700aaf415f4949166
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/115011
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>

7 years agoARM: tegra: iovmm: Replace IOVMM backend with IOMMU
Hiroshi DOYU [Tue, 10 Jul 2012 06:32:42 +0000]
ARM: tegra: iovmm: Replace IOVMM backend with IOMMU

Replace IOVMM backend functions with the standard IOMMU API
ones. Instead of modifying the actual C-files in drivers, MACROs in
iovmm.h does the all work.

Change-Id: I27dc893555ca1495588852261e3ba1e3e5619764
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/114460
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

7 years agovideo: tegra: nvmap: Make IOMMU/IOVMM selectable in Kconfig
Hiroshi DOYU [Tue, 21 Feb 2012 14:47:08 +0000]
video: tegra: nvmap: Make IOMMU/IOVMM selectable in Kconfig

This patch allows nvmap to use the standard IOMMU API as its backend
engine instead of the legacy tegra IOVMM by Kconfig.

Enable TEGRA_IOMMU_{GART,SMMU} under IOMMU in config, and it
automatically disables IOVMM, instead.

Change-Id: I71112ef8072591aac4a93075623ca31c8851a960
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/114217
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>

7 years agoARM: tegra: clock: Add missed Tegra3 PERIPH_ON_APB attributes
Alex Frid [Sun, 15 Jul 2012 00:08:01 +0000]
ARM: tegra: clock: Add missed Tegra3 PERIPH_ON_APB attributes

Change-Id: I12be16dbc2614224ba852216a645d0f84c795334
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/115929
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Peterson <speterson@nvidia.com>

7 years agoarm: tegra: cpu: changing cpu min. freq to 51MHz
Prem Sasidharan [Tue, 10 Jul 2012 01:30:58 +0000]
arm: tegra: cpu: changing cpu min. freq to 51MHz

Changing the CPU min. frequency to 51MHz. This helps
in bringing down the core power to 46mW.

Bug 1005275

Change-Id: I61daa59866be7baf8ebb741000904422cb095e85
Signed-off-by: Prem Sasidharan <psasidharan@nvidia.com>
(cherry picked from commit afbb34d5871b69df328d5aae37f69f25a8946514)
Reviewed-on: http://git-master/r/115452
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Wen Yi <wyi@nvidia.com>
Tested-by: Wen Yi <wyi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agocpufreq: protect cpufreq_stats_free_table with spinlock
Peter Boonstoppel [Fri, 2 Mar 2012 00:04:27 +0000]
cpufreq: protect cpufreq_stats_free_table with spinlock

Prevents crash on cpufreq_stat_notifier_trans when cpufreq_stats_table
has been freed due to a core being hotplugged out.

Bug 948348

Change-Id: I2640a9a23c9a79cad8c76bfefd243a07162d2004
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
(cherry picked from commit 03070a4b0b8eb74825c99c6bbfb108ddb36a041c)
Reviewed-on: http://git-master/r/114248
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

7 years agoarm: config: tegra3 Enable XHCI driver for USB3
Jay Agarwal [Fri, 6 Jul 2012 09:12:03 +0000]
arm: config: tegra3 Enable XHCI driver for USB3

1. Enable USB3 for both android and L4T
2. Enable R8169 for android, already enabled for L4T

Bug 956573

Change-Id: If8d7cf653a5cd2b02352ad07fee3a56c3f568d3a
Signed-off-by: Jay Agarwal <jagarwal@nvidia.com>
Reviewed-on: http://git-master/r/113856
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agoARM: tegra: dvfs: Update Tegra3 sdmmc dvfs tables
Alex Frid [Fri, 8 Jun 2012 21:43:35 +0000]
ARM: tegra: dvfs: Update Tegra3 sdmmc dvfs tables

Added Tegra3 sdmmc4 dvfs table and downgraded sdmmc 2/4 maximum
clock limits based on recent characterization results.

Bug 817679
Bug 841336

Change-Id: I88ddeaabf0739efc0f9c18c41cace331792d4d43
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/107780
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Tested-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

7 years agoARM: tegra: p1852: Dual-display support for all SKUs
Dongfang Shi [Thu, 3 May 2012 23:40:49 +0000]
ARM: tegra: p1852: Dual-display support for all SKUs

Ported Peter's original change 86413 to main.

board-p1852-panel.c:
Add support for primary and secondary LVDS displays, and secondary HDMI display.

board-p1852-pinmux.c:
Add configuration for HDMI and LVDS

board-p1852.c:
board-p1852.h:
Support for determining which p1852 sku is in use

hdmi.c:If no edid retrieved, but there's a hardwired mode, enable it
(used to support HDMI->LVDS output on p1852 sku 2)

devices.c:added secondary display data.

Bug 977859
Bug 994011

Change-Id: Ide8fb6bf7dd873b1d50269fb98d7c1687e4d9073
Signed-off-by: Dongfang Shi <dshi@nvidia.com>
Reviewed-on: http://git-master/r/100438
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agopower: max17048: fix power polling at resume
Chandler Zhang [Fri, 13 Jul 2012 09:01:38 +0000]
power: max17048: fix power polling at resume

The state of charing is not correct because of the 1 sec delay.
Remove the delay to fix the issue.

Bug 1016683

Change-Id: I389970e32d34578bb1ec1f2019d78145f250a673
Signed-off-by: Chandler Zhang <chazhang@nvidia.com>
Reviewed-on: http://git-master/r/115632
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agoarm: tegra: usb_phy: fix hsic suspend issue on xmm
Vinayak Pane [Tue, 12 Jun 2012 01:08:14 +0000]
arm: tegra: usb_phy: fix hsic suspend issue on xmm

XMM modem fails at auto-suspend on hsic. Fixing this issue
by enabling PMC sleepwalk code conditionally and only at
phy-on and phy-off routines.

Bug 991709

Signed-off-by: Vinayak Pane <vpane@nvidia.com>
Reviewed-on: http://git-master/r/109324
(cherry picked from commit 100f818a16ce97411a98ddb0e2c5c9e73a9e654a)

Change-Id: If6f92b8b36f856fa633cb411ac20dbe6e862890c
Reviewed-on: http://git-master/r/115612
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agohwmon: tegra: tsensor:Simplify counter calculation
Daniel Fu [Thu, 12 Jul 2012 09:30:10 +0000]
hwmon: tegra: tsensor:Simplify counter calculation

Simplify the temp to counter conversion in tsensor,
Also it can improve a little bit accuracy of temp to
counter conversion.

Change-Id: I5764334d5d94e317dd9400bc03cb5d7a64096ee0
Signed-off-by: Daniel Fu <danifu@nvidia.com>
Reviewed-on: http://git-master/r/115340
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

7 years agoarm: tegra: sd: enable sd dpd
Wen Yi [Thu, 21 Jun 2012 04:42:13 +0000]
arm: tegra: sd: enable sd dpd

This is a WAR solution that allows for the turning on
SD DPD feature.

The original issue is that enabling SD DPD immediately after device comes
out of LP0 causes ULPI disconnect. The root cause of that is
not known.

The WAR is to delay the enabling of SD DPD for 100ms after
device comes out of LP0.

Bug 929628

Change-Id: I3c5e35ace422e5441535c2c0fe18545b53bbddc4
Signed-off-by: Wen Yi <wyi@nvidia.com>
(cherry picked from commit bffb7b917d52a3523af80db21322ec7ba5fd33f9)
Reviewed-on: http://git-master/r/113392
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agosdhci: tegra: enable sd dpd
Bitan Biswas [Mon, 25 Jun 2012 14:34:54 +0000]
sdhci: tegra: enable sd dpd

This is a WAR solution that allows for the turning on
SD DPD feature.

The original issue is that enabling SD DPD immediately after device comes
out of LP0 causes ULPI disconnect. The root cause of that is
not known.

The WAR is to delay the enabling of SD DPD for 100ms after
device comes out of LP0.

Bug 929628

Change-Id: I946771a8e92459464ce571295f96f197db25c061
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
(cherry picked from commit beba2b34af7ff9313aed074342b9bb86b12620a8)
Reviewed-on: http://git-master/r/113391
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Wen Yi <wyi@nvidia.com>
Tested-by: Wen Yi <wyi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agoRevert "arm: tegra: power: disable all sd dpd"
Bitan Biswas [Tue, 24 Jan 2012 07:52:23 +0000]
Revert "arm: tegra: power: disable all sd dpd"

This reverts commit 8924926cdb77c6ab270867d4caef7a8cdacd11f2.

Bug 924452
Bug 929628

Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
(cherry picked from commit 142b34993404c853579864f7b7b4f320fb92a715)

Change-Id: I9d49703799e32d410beba18938e94e4b641eea6f
(cherry picked from commit 8de60b7a832bfbbf09e75def756379dbb2d14c3e)
Reviewed-on: http://git-master/r/113387
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Wen Yi <wyi@nvidia.com>
Tested-by: Wen Yi <wyi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agoarm: tegra: usb_phy: utmip remote wakeup issue
Venu Byravarasu [Fri, 29 Jun 2012 06:28:51 +0000]
arm: tegra: usb_phy: utmip remote wakeup issue

Do not clear sleep walk pointer for utmip port after remote
wakeup is detected. This should be cleared after control
is given to USB master from PMC.

Bug 999208

Change-Id: I9f498521989c6421f0043dc1b4364591d4907423
Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
(cherry picked from commit e4dbecfe031cbacd4f22bbbcdf971ab11ad81ee8)
Reviewed-on: http://git-master/r/112938
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agovideo: tegra: fix compilation warning
Rhyland Klein [Thu, 12 Jul 2012 16:51:54 +0000]
video: tegra: fix compilation warning

Without the CONFIG_SWITCH enabled, there are multiple unused
variable warnings that get treated as error.

bug 949219

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Change-Id: I39512367fa4bbd3b00a435d0d7a31cfede9e712f
Reviewed-on: http://git-master/r/115428
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Sanjay Singh Rawat <srawat@nvidia.com>

7 years agoARM: tegra: clock: Dynamically re-lock memory pll
Alex Frid [Sun, 24 Jun 2012 01:22:13 +0000]
ARM: tegra: clock: Dynamically re-lock memory pll

So far Tegra3 EMC DFS allowed only scaling rates that can be divided
down from two fixed rate plls: memory PLLM, and peripheral PLLP. PLLM
is always running at maximum SDRAM rate set at boot time, while PLLP
rate 408MHz is fixed across all Tegra3 platforms.

This commit implements dynamic re-locking of PLLM at run time. Now
memory pll can lock either at boot rate or additional auxiliary rate
that is selected as follows: auxiliary PLLM rate must be present in
EMC DFS table, it must exactly match one of the rate steps for Tegra3
graphics bus with PLLC clock source (cbus), and must not be a proper
factor of boot PLLM rate or PLLP fixed rate.

When switching PLLM between boot and auxiliary rate, PLLC is used as
backup memory pll, and during this time cbus is locked at auxiliary
rate. In addition system bus is forced to temporarily use PLLP as
a clock source (this is necessary as sbus main clock source is PLLM
secondary divider PLLM_OUT1).

Limitations:
- only one auxiliary rate is supported, and it should be below PLLM
boot rate, but above half of boot rate
- dynamic re-lock is allowed only on LPDDR2 platforms
- no clock other than EMC and system bus could use PLLM as a source;
so for dynamic re-lock to work CONFIG_TEGRA_PLLM_RESTRICTED must be
selected, and VI clock (not covered by PLLM restricted configuration)
must be moved to PLLP.

Bug 1005576

Change-Id: I6177107c89c3cbe975a1d940927efa1ed0ea61ec
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/111438
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
(cherry picked from commit dc4d468a6acabfb268e7a7f44b45bb7354e9a99a)
Reviewed-on: http://git-master/r/114760
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

7 years agovideo: tegra: update nvmap_alloc_handle interface for Android only
Varun Wadekar [Tue, 17 Jul 2012 04:20:46 +0000]
video: tegra: update nvmap_alloc_handle interface for Android only

Bug 1017884

Change-Id: I237cdb06f19b3ae0bf217f99ffeb705809716e12
Reported-by: Michal Pecio <mpecio@nvidia.com>
Signed-off-by: Michal Pecio <mpecio@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoLinux 3.4.5
Greg Kroah-Hartman [Mon, 16 Jul 2012 18:20:09 +0000]
Linux 3.4.5

7 years agoocfs2: fix NULL pointer dereference in __ocfs2_change_file_space()
Luis Henriques [Wed, 11 Jul 2012 21:02:10 +0000]
ocfs2: fix NULL pointer dereference in __ocfs2_change_file_space()

commit a4e08d001f2e50bb8b3c4eebadcf08e5535f02ee upstream.

As ocfs2_fallocate() will invoke __ocfs2_change_file_space() with a NULL
as the first parameter (file), it may trigger a NULL pointer dereferrence
due to a missing check.

Addresses http://bugs.launchpad.net/bugs/1006012

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Reported-by: Bret Towe <magnade@gmail.com>
Tested-by: Bret Towe <magnade@gmail.com>
Cc: Sunil Mushran <sunil.mushran@oracle.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Acked-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agomemblock: free allocated memblock_reserved_regions later
Yinghai Lu [Wed, 11 Jul 2012 21:02:56 +0000]
memblock: free allocated memblock_reserved_regions later

commit 29f6738609e40227dabcc63bfb3b84b3726a75bd upstream.

memblock_free_reserved_regions() calls memblock_free(), but
memblock_free() would double reserved.regions too, so we could free the
old range for reserved.regions.

Also tj said there is another bug which could be related to this.

| I don't think we're saving any noticeable
| amount by doing this "free - give it to page allocator - reserve
| again" dancing.  We should just allocate regions aligned to page
| boundaries and free them later when memblock is no longer in use.

in that case, when DEBUG_PAGEALLOC, will get panic:

     memblock_free: [0x0000102febc080-0x0000102febf080] memblock_free_reserved_regions+0x37/0x39
  BUG: unable to handle kernel paging request at ffff88102febd948
  IP: [<ffffffff836a5774>] __next_free_mem_range+0x9b/0x155
  PGD 4826063 PUD cf67a067 PMD cf7fa067 PTE 800000102febd160
  Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
  CPU 0
  Pid: 0, comm: swapper Not tainted 3.5.0-rc2-next-20120614-sasha #447
  RIP: 0010:[<ffffffff836a5774>]  [<ffffffff836a5774>] __next_free_mem_range+0x9b/0x155

See the discussion at https://lkml.org/lkml/2012/6/13/469

So try to allocate with PAGE_SIZE alignment and free it later.

Reported-by: Sasha Levin <levinsasha928@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agofs: ramfs: file-nommu: add SetPageUptodate()
Bob Liu [Wed, 11 Jul 2012 21:02:35 +0000]
fs: ramfs: file-nommu: add SetPageUptodate()

commit fea9f718b3d68147f162ed2d870183ce5e0ad8d8 upstream.

There is a bug in the below scenario for !CONFIG_MMU:

 1. create a new file
 2. mmap the file and write to it
 3. read the file can't get the correct value

Because

  sys_read() -> generic_file_aio_read() -> simple_readpage() -> clear_page()

which causes the page to be zeroed.

Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() so that
generic_file_aio_read() do not call simple_readpage().

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agomm, thp: abort compaction if migration page cannot be charged to memcg
David Rientjes [Wed, 11 Jul 2012 21:02:13 +0000]
mm, thp: abort compaction if migration page cannot be charged to memcg

commit 4bf2bba3750f10aa9e62e6949bc7e8329990f01b upstream.

If page migration cannot charge the temporary page to the memcg,
migrate_pages() will return -ENOMEM.  This isn't considered in memory
compaction however, and the loop continues to iterate over all
pageblocks trying to isolate and migrate pages.  If a small number of
very large memcgs happen to be oom, however, these attempts will mostly
be futile leading to an enormous amout of cpu consumption due to the
page migration failures.

This patch will short circuit and fail memory compaction if
migrate_pages() returns -ENOMEM.  COMPACT_PARTIAL is returned in case
some migrations were successful so that the page allocator will retry.

Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agodrivers/rtc/rtc-mxc.c: fix irq enabled interrupts warning
Benoît Thébaudeau [Wed, 11 Jul 2012 21:02:32 +0000]
drivers/rtc/rtc-mxc.c: fix irq enabled interrupts warning

commit b59f6d1febd6cbe9fae4589bf72da0ed32bc69e0 upstream.

Fixes

  WARNING: at irq/handle.c:146 handle_irq_event_percpu+0x19c/0x1b8()
  irq 25 handler mxc_rtc_interrupt+0x0/0xac enabled interrupts
  Modules linked in:
   (unwind_backtrace+0x0/0xf0) from (warn_slowpath_common+0x4c/0x64)
   (warn_slowpath_common+0x4c/0x64) from (warn_slowpath_fmt+0x30/0x40)
   (warn_slowpath_fmt+0x30/0x40) from (handle_irq_event_percpu+0x19c/0x1b8)
   (handle_irq_event_percpu+0x19c/0x1b8) from (handle_irq_event+0x28/0x38)
   (handle_irq_event+0x28/0x38) from (handle_level_irq+0x80/0xc4)
   (handle_level_irq+0x80/0xc4) from (generic_handle_irq+0x24/0x38)
   (generic_handle_irq+0x24/0x38) from (handle_IRQ+0x30/0x84)
   (handle_IRQ+0x30/0x84) from (avic_handle_irq+0x2c/0x4c)
   (avic_handle_irq+0x2c/0x4c) from (__irq_svc+0x40/0x60)
  Exception stack(0xc050bf60 to 0xc050bfa8)
  bf60: 00000001 00000000 003c4208 c0018e20 c050a000 c050a000 c054a4c8 c050a000
  bf80: c05157a8 4117b363 80503bb4 00000000 01000000 c050bfa8 c0018e2c c000e808
  bfa0: 60000013 ffffffff
   (__irq_svc+0x40/0x60) from (default_idle+0x1c/0x30)
   (default_idle+0x1c/0x30) from (cpu_idle+0x68/0xa8)
   (cpu_idle+0x68/0xa8) from (start_kernel+0x22c/0x26c)

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Sascha Hauer <kernel@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agodrivers/rtc/rtc-ab8500.c: use IRQF_ONESHOT when requesting a threaded IRQ
Lee Jones [Wed, 11 Jul 2012 21:02:16 +0000]
drivers/rtc/rtc-ab8500.c: use IRQF_ONESHOT when requesting a threaded IRQ

commit 3cfd16a551dc0c188160e1765168a04baf2d3198 upstream.

This driver's IRQ registration is failing because the kernel now forces
IRQs to be ONESHOT if no IRQ handler is passed.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agodrivers/rtc/rtc-spear.c: fix use-after-free in spear_rtc_remove()
Devendra Naga [Wed, 11 Jul 2012 21:01:53 +0000]
drivers/rtc/rtc-spear.c: fix use-after-free in spear_rtc_remove()

commit 2a643893e50fde71d7ba84b5592ec61b467b9ab6 upstream.

`config' is freed and is then used in the rtc_device_unregister() call,
causing a kernel panic.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Reviewed-by: Viresh Kumar <viresh.linux@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>