6 years agoPM / Sleep: Print name of wakeup source that aborts suspend
Todd Poynor [Sat, 14 Jul 2012 02:11:53 +0000]
PM / Sleep: Print name of wakeup source that aborts suspend

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

6 years agoPM / Sleep: call early resume handlers when suspend_noirq fails
Colin Cross [Thu, 19 Jul 2012 01:55:26 +0000]
PM / Sleep: call early resume handlers when suspend_noirq fails

Commit cf579dfb82550e34de7ccf3ef090d8b834ccd3a9 (PM / Sleep: Introduce
"late suspend" and "early resume" of devices) introduced a bug where
suspend_late handlers would be called, but if dpm_suspend_noirq returned
an error the early_resume handlers would never be called.  All devices
would end up on the dpm_late_early_list, and would never be resumed

Fix it by calling dpm_resume_early when dpm_suspend_noirq returns
an error.

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

6 years agopower: smb347: Stop charging on termination current status or irq
Todd Poynor [Thu, 19 Jul 2012 01:47:01 +0000]
power: smb347: Stop charging on termination current status or irq

The IRQ bts often don't read as set for whatever reason.

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

6 years agopower: smb347: Add POWER_SUPPLY_PROP_CHARGE_ENABLED
Todd Poynor [Thu, 19 Jul 2012 00:16:15 +0000]

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

6 years agopower: power_supply: add POWER_SUPPLY_PROP_CHARGE_ENABLED
Todd Poynor [Wed, 18 Jul 2012 23:28:50 +0000]
power: power_supply: add POWER_SUPPLY_PROP_CHARGE_ENABLED

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

6 years agopower: smb347: Disable charging when charge done to ACK the interrupt
Todd Poynor [Wed, 18 Jul 2012 23:05:30 +0000]
power: smb347: Disable charging when charge done to ACK the interrupt

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

6 years agonet: wireless: bcmdhd: Fix crash if bus->sih was freed
Dmitry Shmidt [Wed, 18 Jul 2012 23:53:33 +0000]
net: wireless: bcmdhd: Fix crash if bus->sih was freed

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

6 years agonet: wireless: bcmdhd: Prevent HT Avail request failure to flood the log
Dmitry Shmidt [Wed, 18 Jul 2012 18:15:10 +0000]
net: wireless: bcmdhd: Prevent HT Avail request failure to flood the log

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>



6 years agopower: smb347: wait for resume before enable interrupt
Todd Poynor [Wed, 18 Jul 2012 00:57:02 +0000]
power: smb347: wait for resume before enable interrupt

Avoid access to I2C bus before bus is resumed.

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

6 years agoARM: ftrace: Trace function entry before updating index
Colin Cross [Tue, 17 Jul 2012 01:24:33 +0000]
ARM: ftrace: Trace function entry before updating index

Commit 722b3c74695377d11d18a52f3da08114d37f3f37 modified x86 ftrace to
avoid tracing all functions called from irqs when function graph was
used with a filter.  Port the same fix to ARM.

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

6 years agopower: smb347: enable wake for interrupt
Todd Poynor [Fri, 13 Jul 2012 22:37:53 +0000]
power: smb347: enable wake for interrupt

Based on code from HongMin Son <hongmin.son@samsung.com>

Change-Id: I6669f9bfdf40e0de396b9f42732efc101d9343dd
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: HongMin Son <hongmin.son@samsung.com>

6 years agocpufreq: interactive: remove input_boost handling
Todd Poynor [Tue, 17 Jul 2012 00:32:44 +0000]
cpufreq: interactive: remove input_boost handling

Now handled in userspace Power HAL instead.

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

6 years agocpufreq: interactive: handle speed up and down in the realtime task
Todd Poynor [Tue, 17 Jul 2012 00:07:15 +0000]
cpufreq: interactive: handle speed up and down in the realtime task

Not useful to have a separate, non-realtime workqueue for speed down
events, avoid priority inversion for speed up events.

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

6 years agocpufreq: interactive: keep freezer happy when not current governor
Sam Leffler [Wed, 27 Jun 2012 19:55:56 +0000]
cpufreq: interactive: keep freezer happy when not current governor

Fix a problem where the hung task mechanism was deeming the interactive
clock boost thread as hung.  This was because the thread is created at
module init but never run/woken up until needed.  If the governor is not
being used this can be forever.  To workaround this explicitly wake up
the thread once all the necessary data structures are initialized.  The
latter required some minor code shuffle.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: Ie2c058dd75dcb6460ea10e7ac997e46baf66b1fe

6 years agocpufreq: interactive: take idle notifications only when active
Sam Leffler [Wed, 27 Jun 2012 17:12:04 +0000]
cpufreq: interactive: take idle notifications only when active

Register an idle notifier only when the governor is active.  Also
short-circuit work of idle end if the governor is not enabled.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: I4cae36dd2e7389540d337d74745ffbaa0131870f

6 years agopower: smb347: add POWER_SUPPLY_PROP_USB_OTG
Todd Poynor [Fri, 13 Jul 2012 20:30:55 +0000]
power: smb347: add POWER_SUPPLY_PROP_USB_OTG

Based on code from HongMin Son <hongmin.son@samsung.com>

Change-Id: I8b47ff41fb170aac60d1cbe5cf609fca72f8eb41
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: HongMin Son <hongmin.son@samsung.com>

6 years agopower: power_supply: add POWER_SUPPLY_PROP_USB_OTG
Todd Poynor [Fri, 13 Jul 2012 20:30:04 +0000]
power: power_supply: add POWER_SUPPLY_PROP_USB_OTG

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

6 years agopower: power_supply: move POWER_SUPPLY_PROP_USB_HC to type 'int' order
Todd Poynor [Fri, 13 Jul 2012 03:27:16 +0000]
power: power_supply: move POWER_SUPPLY_PROP_USB_HC to type 'int' order

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

6 years agopower: smb347: Add platform data for reg vs. pin control of USB mode
Todd Poynor [Fri, 13 Jul 2012 02:05:56 +0000]
power: smb347: Add platform data for reg vs. pin control of USB mode

USB5/1/HC or USB9/1.5/HC will be selected by pin if true, else
selected by register via POWER_SUPPLY_PROP_USB_HC.

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

6 years agosync: optimize fence merges
Erik Gilling [Thu, 12 Jul 2012 00:13:50 +0000]
sync: optimize fence merges

If the two fences being merged contain sync_pts from the same timeline,
those two pts will be collapsed into a single pt representing the latter
of the two.

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

6 years agosync: reorder sync_fence_release
Erik Gilling [Thu, 12 Jul 2012 00:07:39 +0000]
sync: reorder sync_fence_release

Previously fence's pts were freed before the were the fence was removed from the
global fence list.  This led to a race with the debugfs support where it would
iterate over sync_pts that had been freed.

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

6 years agousb: gadget: Fix usb string id allocation
Benoit Goby [Fri, 20 Jan 2012 22:42:41 +0000]
usb: gadget: Fix usb string id allocation

Don't reset next_string_id every time the gadget is enabled, this makes
the next strings allocated overwrite strings allocated at probe time.
Instead, fix rndis not to allocate new string ids on every config bind.

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

6 years agopower: smb347: Make POWER_SUPPLY_PROP_USB_HC readable
Todd Poynor [Wed, 11 Jul 2012 01:25:40 +0000]
power: smb347: Make POWER_SUPPLY_PROP_USB_HC readable

Avoid runtime errors.

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

6 years agopower: smb347: Don't skip setting POWER_SUPPLY_PROP_USB_HC if offline
Todd Poynor [Wed, 11 Jul 2012 01:27:29 +0000]
power: smb347: Don't skip setting POWER_SUPPLY_PROP_USB_HC if offline

Avoids runtime errors.

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

6 years agopower: smb347: update state if found changed on property get
Todd Poynor [Wed, 11 Jul 2012 01:01:19 +0000]
power: smb347: update state if found changed on property get

If charger connect status is found changed while retreiving a
property, update the associated driver state and send a
power_supply_changed() for the supplies.  In case an interrupt
was not received for the connection status change.

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

6 years agopower: smb347 Handle charger source connect events
Todd Poynor [Wed, 11 Jul 2012 00:58:29 +0000]
power: smb347 Handle charger source connect events

Undervoltage IRQs are signalled only on charger disconnect, not

* Update the comments to reflect this fact.
* Check for changed connected/disconnected status on any interrupt.

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

6 years agopower: smb347: Use IRQF_ONESHOT for STAT interrupt
Todd Poynor [Tue, 10 Jul 2012 22:14:38 +0000]
power: smb347: Use IRQF_ONESHOT for STAT interrupt

From code by HongMin Son <hongmin.son@samsung.com>

Change-Id: I87645392efceff9ea2d0edd5bb84a089ccbd4f86
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: HongMin Son <hongmin.son@samsung.com>

6 years agopower: smb347: Add USB High Current property
Todd Poynor [Tue, 3 Jul 2012 22:52:30 +0000]
power: smb347: Add USB High Current property

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

6 years agopower_supply: Add custom property for USB High Current mode
Todd Poynor [Tue, 3 Jul 2012 22:41:20 +0000]
power_supply: Add custom property for USB High Current mode

For smb347.

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

6 years agopower: smb347: Add settable current max property for mains
Todd Poynor [Tue, 3 Jul 2012 21:12:42 +0000]
power: smb347: Add settable current max property for mains

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

6 years agopower: smb347: notify board code of power changes
Todd Poynor [Tue, 3 Jul 2012 05:49:37 +0000]
power: smb347: notify board code of power changes

smb347_battery power supply will use the supplied_to
provided by the board file in pdata, if any, and pass
along a power_supply_changed() for itself if provided.
The board file can use its external_power_changed callback
to be notified of changes in state of the smb347 mains, usb,
or battery supplies.

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

6 years agogpu: ion: Add explicit sync ioctl
Rebecca Schultz Zavin [Tue, 26 Jun 2012 20:17:34 +0000]
gpu: ion: Add explicit sync ioctl

This is deprecated in favor of using the dma_buf api which will
automatically sync a buffer to memory when it is mapped to a device.
However, that functionality is not ready, so this patch adds the
ability to sync a buffer explicitly.

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

6 years agogpu: ion: Modify the system heap to try to allocate large/huge pages
Rebecca Schultz Zavin [Thu, 14 Jun 2012 20:30:01 +0000]
gpu: ion: Modify the system heap to try to allocate large/huge pages

On some systems there is a performance benefit to reducing tlb pressure
by minimizing the number of chunks in an allocation.

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

6 years agogpu: ion: Add cache maintenance to ion.
Rebecca Schultz Zavin [Thu, 14 Jun 2012 22:08:53 +0000]
gpu: ion: Add cache maintenance to ion.

This patch adds cache maintenance operations to ion.  As per mailing
list discussions regarding dma_buf, cache operations are done implicitly.
At buffer allocaiton time the user can select whether he'd like mappings
(both kernel and user) to be cached.  When cached mappings are selected,
no mappings will be created for a buffer at mmap time.  Instead pages will
be faulted in one at a time so we can track which pages require flushing
before dma.  When the buffers are mapped for dma (via the dma_buf apis)
any pages which were touched will be synced for device.

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

6 years agogpu: ion: Switch max num_heaps to 16 to work around an issue elsewere
Rebecca Schultz Zavin [Mon, 25 Jun 2012 21:02:25 +0000]
gpu: ion: Switch max num_heaps to 16 to work around an issue elsewere

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

Change-Id: I3bcbc9c424086f5921a1641afeb16040deffcece

6 years agousb: gadget: accessory: Fix section mismatch
Benoit Goby [Sat, 23 Jun 2012 01:17:10 +0000]
usb: gadget: accessory: Fix section mismatch

create_bulk_endpoints should not be __init since it is called when
accessory is enabled

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

6 years agopower_supply: convert wakelock to wakeup source
Todd Poynor [Wed, 20 Jun 2012 01:04:30 +0000]
power_supply: convert wakelock to wakeup source

And supply name will be used as wakeup source name.

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

6 years agogpio_input: convert from wakelocks to wakeup sources
Todd Poynor [Wed, 20 Jun 2012 04:06:47 +0000]
gpio_input: convert from wakelocks to wakeup sources

And add device names to wakeup source names

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

6 years agogpu: ion: Fix bug in heap type enum
Rebecca Schultz Zavin [Thu, 14 Jun 2012 21:52:17 +0000]
gpu: ion: Fix bug in heap type enum

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

6 years agocpuidle: fix error handling in __cpuidle_register_device
Colin Cross [Wed, 14 Mar 2012 18:29:51 +0000]
cpuidle: fix error handling in __cpuidle_register_device

Fix the error handling in __cpuidle_register_device to include
the missing list_del.  Move it to a label, which will simplify
the error handling when coupled states are added.

Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Colin Cross <ccross@android.com>

6 years agogpu: ion: Map only the vma size given
Laura Abbott [Fri, 16 Mar 2012 22:33:39 +0000]
gpu: ion: Map only the vma size given

When mapping carveout buffers into userspace, only map
the size of the vma given, not the full size of the buffer
since clients may map less than the buffer size.

Change-Id: I1b391b23219455e879a900d947c728db3c8c4a76
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

6 years agogpu: ion: Loop on the handle count when destroying
Laura Abbott [Thu, 7 Jun 2012 23:41:30 +0000]
gpu: ion: Loop on the handle count when destroying

When destroying a handle, all kernel mappings to that handle
should be destroyed. Other handles may still have references
and valid mappings to the buffer underneath which should not
be destroyed. Loop on the handle reference count, not the buffer
reference count to get rid of all kernel mappings for the handle.

Change-Id: I7dc5d6a86513fc5fa4e21110ceab434714ea2493
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

6 years agogpu: ion: ion_system_heap: Change allocations to GFP_HIGHUSER
Rebecca Schultz Zavin [Thu, 7 Jun 2012 23:59:59 +0000]
gpu: ion: ion_system_heap: Change allocations to GFP_HIGHUSER

Previously the ion_system_heap was using GFP_KERNEL, forcing all allocations
to be in lowmem.  This quickly causes us to run out of lowmem.

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

6 years agogpu: ion: Set the dma_address of the sg list at alloc time
Rebecca Schultz Zavin [Thu, 7 Jun 2012 21:51:21 +0000]
gpu: ion: Set the dma_address of the sg list at alloc time

This patch sets the dma_address field of the sglist representing
an allocation at allocation time.  This technically breaks the dma api
which states that these addresses should be set when a particular device
takes ownership of a buffer via the dma_map apis.  In the case of our
systems the only dma address space is physical addresses.  Additionally,
we can not afford the overhead of calling dma_map_sg from this location
as it implies a cache invalidate that is not necessary if the memory
was previously mapped cached.  Instead, the expectation is that memory
being returned from the heaps is ready for dma in that if any cached
mappings of that memory exist they have been invalidated.

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

6 years agoRevert "net: wireless: bcmdhd: HACK - force active power mode"
Dmitry Shmidt [Mon, 11 Jun 2012 17:12:35 +0000]
Revert "net: wireless: bcmdhd: HACK - force active power mode"

This reverts commit 956df1fbda60f8767694699d66015587e6cee089.



6 years agousb: gadget: android: Add FunctionFS
Benoit Goby [Fri, 30 Mar 2012 02:25:23 +0000]
usb: gadget: android: Add FunctionFS

Add support for FunctionFS (ffs) to implement usb functions in userspace.

The aliases property stores the list of functions that are implemented
using functionfs.

For example:
echo "adb,mtp" > /sys/class/android_usb/android0/f_ffs/aliases

Then when the function are enabled:
echo "adb,acm" > /sys/class/android_usb/android0/functions
Internally, ffs and acm will be used.

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

6 years agopower: Add option to log time spent in suspend
Colin Cross [Tue, 19 Jul 2011 19:33:45 +0000]
power: Add option to log time spent in suspend

Prints the time spent in suspend in the kernel log, and
keeps statistics on the time spent in suspend in

Change-Id: Ia6b9ebe4baa0f7f5cd211c6a4f7e813aefd3fa1d
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>

6 years agoepoll: Fix user space breakage related to EPOLLWAKEUP
Rafael J. Wysocki [Mon, 21 May 2012 19:20:48 +0000]
epoll: Fix user space breakage related to EPOLLWAKEUP

Commit 4d7e30d (epoll: Add a flag, EPOLLWAKEUP, to prevent
suspend while epoll events are ready) caused some applications to
malfunction, because they set the bit corresponding to the new
EPOLLWAKEUP flag in their eventpoll flags and they don't have the
new CAP_EPOLLWAKEUP capability.

To prevent that from happening, change epoll_ctl() to clear
EPOLLWAKEUP in epds.events if the caller doesn't have the
CAP_EPOLLWAKEUP capability instead of failing and returning an
error code, which allows the affected applications to function

Reported-and-tested-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Hibernate: Use get_gendisk to verify partition if resume_file is integer format
Minho Ban [Mon, 14 May 2012 19:45:31 +0000]
PM / Hibernate: Use get_gendisk to verify partition if resume_file is integer format

Sometimes resume= parameter comes in integer style (e.g. major:minor)
and then name_to_dev_t can not detect partition properly. (especially
async device like usb, mmc).

This patch calls get_gendisk() if resumewait is true and resume_file
is in integer format to work around this problem.

Signed-off-by: Minho Ban <mhban@samsung.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Domains: Make it possible to add devices to inactive domains
Rafael J. Wysocki [Mon, 14 May 2012 19:45:52 +0000]
PM / Domains: Make it possible to add devices to inactive domains

The generic PM domains core code currently requires domains to be in
the "power on" state for adding devices to them, but this limitation
turns out to be inconvenient in some situations, so remove it.

For this purpose, make __pm_genpd_add_device() set the device's
need_restore flag if the domain is in the "power off" state, so that
the device's "restore state" (usually .runtime_resume()) callback
is executed when it is resumed after the domain has been turned on.
If the domain is in the "power on" state, the device's need_restore
flag will be cleared by __pm_genpd_add_device(), so that its "save
state" (usually .runtime_suspend()) callback is executed when the
domain is about to be turned off.  However, since that default
behavior need not be always desirable, add a helper function
pm_genpd_dev_need_restore() allowing a device's need_restore flag
to be set/unset at any time.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Sleep: User space wakeup sources garbage collector Kconfig option
Rafael J. Wysocki [Sat, 5 May 2012 19:57:28 +0000]
PM / Sleep: User space wakeup sources garbage collector Kconfig option

Make it possible to configure out the user space wakeup sources
garbage collector for debugging and default Android builds.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Arve Hjønnevåg <arve@android.com>

6 years agoPM / Sleep: Make the limit of user space wakeup sources configurable
Rafael J. Wysocki [Sat, 5 May 2012 19:57:20 +0000]
PM / Sleep: Make the limit of user space wakeup sources configurable

Make it possible to configure out the check against the limit of
user space wakeup sources for debugging and default Android builds.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Arve Hjønnevåg <arve@android.com>

6 years agoPM / Documentation: suspend-and-cpuhotplug.txt: Fix typo
Marcos Paulo de Souza [Wed, 2 May 2012 12:33:37 +0000]
PM / Documentation: suspend-and-cpuhotplug.txt: Fix typo

sysfs was expected in this context.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Sleep: Fix a mistake in a conditional in autosleep_store()
Arve Hjønnevåg [Thu, 3 May 2012 22:14:21 +0000]
PM / Sleep: Fix a mistake in a conditional in autosleep_store()

The condition check in autosleep_store() is incorrect and prevents
/sys/power/autosleep from working as advertised.  Fix that.

[rjw: Added the changelog.]

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoepoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready
Arve Hjønnevåg [Tue, 1 May 2012 19:33:34 +0000]
epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready

When an epoll_event, that has the EPOLLWAKEUP flag set, is ready, a
wakeup_source will be active to prevent suspend. This can be used to
handle wakeup events from a driver that support poll, e.g. input, if
that driver wakes up the waitqueue passed to epoll before allowing

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Sleep: Add user space interface for manipulating wakeup sources, v3
Rafael J. Wysocki [Sun, 29 Apr 2012 20:53:42 +0000]
PM / Sleep: Add user space interface for manipulating wakeup sources, v3

Android allows user space to manipulate wakelocks using two
sysfs file located in /sys/power/, wake_lock and wake_unlock.
Writing a wakelock name and optionally a timeout to the wake_lock
file causes the wakelock whose name was written to be acquired (it
is created before is necessary), optionally with the given timeout.
Writing the name of a wakelock to wake_unlock causes that wakelock
to be released.

Implement an analogous interface for user space using wakeup sources.
Add the /sys/power/wake_lock and /sys/power/wake_unlock files
allowing user space to create, activate and deactivate wakeup
sources, such that writing a name and optionally a timeout to
wake_lock causes the wakeup source of that name to be activated,
optionally with the given timeout.  If that wakeup source doesn't
exist, it will be created and then activated.  Writing a name to
wake_unlock causes the wakeup source of that name, if there is one,
to be deactivated.  Wakeup sources created with the help of
wake_lock that haven't been used for more than 5 minutes are garbage
collected and destroyed.  Moreover, there can be only WL_NUMBER_LIMIT
wakeup sources created with the help of wake_lock present at a time.

The data type used to track wakeup sources created by user space is
called "struct wakelock" to indicate the origins of this feature.

This version of the patch includes an rbtree manipulation fix from John Stultz.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: NeilBrown <neilb@suse.de>

6 years agoPM / Sleep: Add "prevent autosleep time" statistics to wakeup sources
Rafael J. Wysocki [Sun, 29 Apr 2012 20:53:32 +0000]
PM / Sleep: Add "prevent autosleep time" statistics to wakeup sources

Android uses one wakelock statistics that is only necessary for
opportunistic sleep.  Namely, the prevent_suspend_time field
accumulates the total time the given wakelock has been locked
while "automatic suspend" was enabled.  Add an analogous field,
prevent_sleep_time, to wakeup sources and make it behave in a similar

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

6 years agoPM / Sleep: Implement opportunistic sleep, v2
Rafael J. Wysocki [Sun, 29 Apr 2012 20:53:22 +0000]
PM / Sleep: Implement opportunistic sleep, v2

Introduce a mechanism by which the kernel can trigger global
transitions to a sleep state chosen by user space if there are no
active wakeup sources.

It consists of a new sysfs attribute, /sys/power/autosleep, that
can be written one of the strings returned by reads from
/sys/power/state, an ordered workqueue and a work item carrying out
the "suspend" operations.  If a string representing the system's
sleep state is written to /sys/power/autosleep, the work item
triggering transitions to that state is queued up and it requeues
itself after every execution until user space writes "off" to

That work item enables the detection of wakeup events using the
functions already defined in drivers/base/power/wakeup.c (with one
small modification) and calls either pm_suspend(), or hibernate() to
put the system into a sleep state.  If a wakeup event is reported
while the transition is in progress, it will abort the transition and
the "system suspend" work item will be queued up again.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: NeilBrown <neilb@suse.de>

6 years agoPM / Sleep: Add wakeup_source_activate and wakeup_source_deactivate tracepoints
Arve Hjønnevåg [Sun, 29 Apr 2012 20:53:02 +0000]
PM / Sleep: Add wakeup_source_activate and wakeup_source_deactivate tracepoints

Add tracepoints to wakeup_source_activate and wakeup_source_deactivate.
Useful for checking that specific wakeup sources overlap as expected.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Sleep: Change wakeup source statistics to follow Android
Rafael J. Wysocki [Sun, 29 Apr 2012 20:52:52 +0000]
PM / Sleep: Change wakeup source statistics to follow Android

Wakeup statistics used by Android are slightly different from what we
have in wakeup sources at the moment and there aren't any known
users of those statistics other than Android, so modify them to make
it easier for Android to switch to wakeup sources.

This removes the struct wakeup_source's hit_cout field, which is very
rough and therefore not very useful, and adds two new fields,
wakeup_count and expire_count.  The first one tracks how many times
the wakeup source is activated with events_check_enabled set (which
roughly corresponds to the situations when a system power transition
to a sleep state is in progress and would be aborted by this wakeup
source if it were the only active one at that time) and the second
one is the number of times the wakeup source has been activated with
a timeout that expired.

Additionally, the last_time field is now updated when the wakeup
source is deactivated too (previously it was only updated during
the wakeup source's activation), which seems to be what Android does
with the analogous counter for wakelocks.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

6 years agoPM / Sleep: Use wait queue to signal "no wakeup events in progress"
Rafael J. Wysocki [Sun, 29 Apr 2012 20:52:34 +0000]
PM / Sleep: Use wait queue to signal "no wakeup events in progress"

The current wakeup source deactivation code doesn't do anything when
the counter of wakeup events in progress goes down to zero, which
requires pm_get_wakeup_count() to poll that counter periodically.
Although this reduces the average time it takes to deactivate a
wakeup source, it also may lead to a substantial amount of unnecessary
polling if there are extended periods of wakeup activity.  Thus it
seems reasonable to use a wait queue for signaling the "no wakeup
events in progress" condition and remove the polling.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: mark gross <markgross@thegnar.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

6 years agoPM / Sleep: Look for wakeup events in later stages of device suspend
Rafael J. Wysocki [Sun, 29 Apr 2012 20:52:19 +0000]
PM / Sleep: Look for wakeup events in later stages of device suspend

Currently, the device suspend code in drivers/base/power/main.c
only checks if there have been any wakeup events, and therefore the
ongoing system transition to a sleep state should be aborted, during
the first (i.e. "suspend") device suspend phase.  However, wakeup
events may be reported later as well, so it's reasonable to look for
them in the in the subsequent (i.e. "late suspend" and "suspend
noirq") phases.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

6 years agoPM / Hibernate: Hibernate/thaw fixes/improvements
Bojan Smojver [Sun, 29 Apr 2012 20:42:06 +0000]
PM / Hibernate: Hibernate/thaw fixes/improvements

 1. Do not allocate memory for buffers from emergency pools, unless
    absolutely required. Do not warn about and do not retry non-essential
    failed allocations.

 2. Do not check the amount of free pages left on every single page
    write, but wait until one map is completely populated and then check.

 3. Set maximum number of pages for read buffering consistently, instead
    of inadvertently depending on the size of the sector type.

 4. Fix copyright line, which I missed when I submitted the hibernation
    threading patch.

 5. Dispense with bit shifting arithmetic to improve readability.

 6. Really recalculate the number of pages required to be free after all
    allocations have been done.

 7. Fix calculation of pages required for read buffering. Only count in
    pages that do not belong to high memory.

Signed-off-by: Bojan Smojver <bojan@rexursive.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Domains: Fix computation of maximum domain off time
Rafael J. Wysocki [Mon, 7 May 2012 20:00:59 +0000]
PM / Domains: Fix computation of maximum domain off time

The default domain power off governor function for generic PM
domains, default_power_down_ok(), may violate subdomain maximum
off time limit by allowing the master domain to be off for too
long.  Namely, it only finds the minium of all device maximum
off times over the domain's devices and uses that to compute the
domain's maximum off time, but it should do the same for the

Fix this problem by modifying default_power_down_ok() to compute
the given domain's maximum off time as the difference between the
minimum off time over all devices and subdomains in the domain and
its power on latency.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Domains: Fix link checking when add subdomain
Huang Ying [Mon, 7 May 2012 19:35:45 +0000]
PM / Domains: Fix link checking when add subdomain

Current pm_genpd_add_subdomain() will allow duplicated link between
master and slave domain.  This patch fixed it.

Because when current pm_genpd_add_subdomain() checks whether the link
between the master and slave generic PM domain already exists,
slave_links instead of master_links of master domain is used.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Domains: Cache device stop and domain power off governor results, v3
Rafael J. Wysocki [Tue, 1 May 2012 19:34:07 +0000]
PM / Domains: Cache device stop and domain power off governor results, v3

The results of the default device stop and domain power off governor
functions for generic PM domains, default_stop_ok() and
default_power_down_ok(), depend only on the timing data of devices,
which are static, and on their PM QoS constraints.  Thus, in theory,
these functions only need to carry out their computations, which may
be time consuming in general, when it is known that the PM QoS
constraint of at least one of the devices in question has changed.

Use the PM QoS notifiers of devices to implement that.  First,
introduce new fields, constraint_changed and max_off_time_changed,
into struct gpd_timing_data and struct generic_pm_domain,
respectively, and register a PM QoS notifier function when adding
a device into a domain that will set those fields to 'true' whenever
the device's PM QoS constraint is modified.  Second, make
default_stop_ok() and default_power_down_ok() use those fields to
decide whether or not to carry out their computations from scratch.

The device and PM domain hierarchies are taken into account in that
and the expense is that the changes of PM QoS constraints of
suspended devices will not be taken into account immediately, which
isn't guaranteed anyway in general.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Domains: Make device removal more straightforward
Rafael J. Wysocki [Tue, 1 May 2012 19:33:53 +0000]
PM / Domains: Make device removal more straightforward

The removal of a device from a PM domain doesn't have to browse
the domain's device list, because it can check directly if the
device belongs to the given domain.  Moreover, it should clear
the domain_data pointer in dev->power.subsys_data, because
dev_pm_put_subsys_data(dev) may not remove dev->power.subsys_data
and the stale domain data pointer may cause problems to happen.

Rework pm_genpd_remove_device() taking the above observations into

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / QoS: Create device constraints objects on notifier registration
Rafael J. Wysocki [Sun, 29 Apr 2012 20:54:47 +0000]
PM / QoS: Create device constraints objects on notifier registration

The current behavior of dev_pm_qos_add_notifier() makes device PM QoS
notifiers less than useful.  Namely, it silently returns success when
called before any PM QoS constraints are added for the device, so the
caller will assume that the notifier has been registered, but when
someone actually adds some nontrivial constraints for the device
eventually, the previous callers of dev_pm_qos_add_notifier()
will not know about that and their notifier routines will not be
executed (contrary to their expectations).

To address this problem make dev_pm_qos_add_notifier() create the
constraints object for the device if it is not present when the
routine is called.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by : markgross <markgross@thegnar.org>

6 years agoPM / Runtime: Remove device fields related to suspend time, v2
Rafael J. Wysocki [Sun, 29 Apr 2012 20:54:36 +0000]
PM / Runtime: Remove device fields related to suspend time, v2

After the previous changes in default_stop_ok() and
default_power_down_ok() for PM domains, there are two fields in
struct dev_pm_info that aren't necessary any more,  suspend_time
and max_time_suspended_ns.

Remove those fields along with all of the code that accesses them,
which simplifies the runtime PM framework quite a bit.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Domains: Rework default domain power off governor function, v2
Rafael J. Wysocki [Sun, 29 Apr 2012 20:54:30 +0000]
PM / Domains: Rework default domain power off governor function, v2

The existing default domain power down governor function for PM
domains, default_power_down_ok(), is supposed to check whether or not
the PM QoS latency constraints of the devices in the domain will be
violated if the domain is turned off by pm_genpd_poweroff().
However, the computations carried out by it don't reflect the
definition of the PM QoS latency constrait in

Make default_power_down_ok() follow the definition of the PM QoS
latency constrait.  In particular, make it only take latencies into
account, because it doesn't matter how much time has elapsed since
the domain's devices were suspended for the computation.

Remove the break_even_ns and power_off_time fields from
struct generic_pm_domain, because they are not necessary any more.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM / Domains: Rework default device stop governor function, v2
Rafael J. Wysocki [Sun, 29 Apr 2012 20:54:17 +0000]
PM / Domains: Rework default device stop governor function, v2

The existing default device stop governor function for PM domains,
default_stop_ok(), is supposed to check whether or not the device's
PM QoS latency constraint will be violated if the device is stopped
by pm_genpd_runtime_suspend().  However, the computations carried out
by it don't reflect the definition of the PM QoS latency constrait in

Make default_stop_ok() follow the definition of the PM QoS latency
constrait.  In particular, make it take the device's start and stop
latencies correctly.

Add a new field, effective_constraint_ns, to struct gpd_timing_data
and use it to store the difference between the device's PM QoS
constraint and its resume latency for use by the device's parent
(the effective_constraint_ns values for the children are used for
computing the parent's one along with its PM QoS constraint).

Remove the break_even_ns field from struct gpd_timing_data, because
it's not used any more.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoPM: devfreq: init performance/powersave governor
Xiaoguang Chen [Sun, 29 Apr 2012 20:51:31 +0000]
PM: devfreq: init performance/powersave governor

Performance and powersave governor's get_target_freq
is not called if driver chooses one of these two governors.
Add init function in governor profile to call update_devfreq
which will call get_target_freq subsequently.

Signed-off-by: Xiaoguang Chen <chenxg@marvell.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

6 years agoRevert "PM: Add user-space wake lock api."
Varun Wadekar [Mon, 23 Jul 2012 08:03:18 +0000]
Revert "PM: Add user-space wake lock api."

This reverts commit 4a17311edfa17c502d4f5a64c569d0c4ec129f44 and
commit 4d09c863239d323e34a8e59cc738f126d7ed3382.

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

6 years agoRevert "PM: Enable partial support for FB earlysuspend"
Varun Wadekar [Mon, 23 Jul 2012 08:03:06 +0000]
Revert "PM: Enable partial support for FB earlysuspend"

This reverts commit 8ceec9456c21f55785c751bf76e080599cf508f3.

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

6 years agoRevert "HACK: PM: Port early suspend functionality"
Varun Wadekar [Mon, 23 Jul 2012 08:02:23 +0000]
Revert "HACK: PM: Port early suspend functionality"

This reverts commit 228af00b84919ab817b619b13327fe36027ccdaf.

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

6 years agoRevert "power: earlysuspend: suspend if user space is still asleep after resume"
Varun Wadekar [Mon, 23 Jul 2012 08:01:31 +0000]
Revert "power: earlysuspend: suspend if user space is still asleep after resume"

This reverts commit afe26e084f0058a3fa4b98fb2cb8a56f1f94e0f8.

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

6 years agoRevert "PM: Abort suspend if wake_lock is acquired"
Varun Wadekar [Mon, 23 Jul 2012 08:01:12 +0000]
Revert "PM: Abort suspend if wake_lock is acquired"

This reverts commit d97f537d271166209261ff364b64b35f0ca98ced.

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

6 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

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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

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>

6 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>

6 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>

6 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>

6 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

6 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>

6 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

6 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>

6 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

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>

6 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>

6 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>

6 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>

6 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>