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

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

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

7 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
suspend.

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>

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

7 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
way.

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

7 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
/sys/power/autosleep.

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>

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

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

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

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

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

7 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
subdomains.

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>

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

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

7 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
account.

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

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

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

7 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
Documentation/ABI/testing/sysfs-devices-power.

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>

7 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
Documentation/ABI/testing/sysfs-devices-power.

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>

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

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

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

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

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

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

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>