Todd Poynor [Thu, 20 Dec 2012 00:06:48 +0000 (16:06 -0800)]
cpufreq: interactive: fix boosting logic
35a84de cpufreq: interactive: apply above_hispeed_delay to each step above hispeed
caused the speed choice logic to osciallate between boosting and not boosting.
Add back code to ensure speed does not drop below boost frequency while
boosting.
Change-Id: Id420068480fcc7f5c4989ff523e2a8d22e2f4db2
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Wed, 19 Dec 2012 01:50:10 +0000 (17:50 -0800)]
cpufreq: interactive: add timer slack to limit idle at speed > min
Always use deferrable timer for load sampling.
Set a non-deferrable timer to an additional slack time to allow prior to
waking up from idle to drop speed when not at minimum speed. Slack value
-1 avoids wakeups to drop speed. Default is 80ms.
Remove the governidle module param and its timer management in idle. For
platforms on which holding speed above mimum in idle costs power, use the
new timer slack to select how long to wait before waking up to drop speed.
Change-Id: I270b3980667e2c70a68e5bff534124b4411dbad5
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Colin Cross [Fri, 11 Jan 2013 21:51:48 +0000 (13:51 -0800)]
hardlockup: detect hard lockups without NMIs using secondary cpus
Emulate NMIs on systems where they are not available by using timer
interrupts on other cpus. Each cpu will use its softlockup hrtimer
to check that the next cpu is processing hrtimer interrupts by
verifying that a counter is increasing.
This patch is useful on systems where the hardlockup detector is not
available due to a lack of NMIs, for example most ARM SoCs.
Without this patch any cpu stuck with interrupts disabled can
cause a hardware watchdog reset with no debugging information,
but with this patch the kernel can detect the lockup and panic,
which can result in useful debugging info.
Signed-off-by: Colin Cross <ccross@android.com>
Todd Poynor [Sat, 15 Dec 2012 01:31:19 +0000 (17:31 -0800)]
cpufreq: interactive: specify duration of CPU speed boost pulse
Sysfs attribute boostpulse_duration specifies the duration of boosting CPU
speed in response to bootpulse events. Duration is specified in usecs,
default 80ms.
Change-Id: Ifd41625574891a44f1787a4e85d1e7b4f2afb52b
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Wed, 12 Dec 2012 00:05:03 +0000 (16:05 -0800)]
cpufreq: interactive: adjust load for changes in speed
Add notifier for speed transitions. Keep a count of CPU active
microseconds times current frequency, converted to a percentage relative
to the current frequency when load is evaluated.
Change-Id: I5c27adb11081c50490219784ca57cc46e97fc28c
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Rebecca Schultz Zavin [Tue, 11 Dec 2012 23:23:14 +0000 (15:23 -0800)]
gpu: ion: Remove heapmask from client
The heapmask in the client generally wasn't being used. This
patch removes it.
Change-Id: I3526723fbf8f2e81c28c0733deb583ea14bdd837
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Johan Mossberg [Mon, 10 Dec 2012 16:46:16 +0000 (17:46 +0100)]
gpu: ion: Export ion_client_create
Will enable modules to allocate memory with ion.
Signed-off-by: Johan Mossberg <johan.mossberg@stericsson.com>
Rebecca Schultz Zavin [Tue, 11 Dec 2012 19:45:59 +0000 (11:45 -0800)]
gpu: ion: Clarify variable names and comments around heap ids v types
There is some confusion between when to use the heap type and when
the id. This patch clarifies this by using clearer variable names
and describing the intention in the comments. Also fixes the client
debug code to print heaps by id instead of type.
Change-Id: Ie8b3dadded52e18590fcb2ca94001f6ed46ef07d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Thu, 15 Nov 2012 18:52:45 +0000 (10:52 -0800)]
gpu: ion: Add chunk heap
This patch adds support for a chunk heap that allows for buffers that are
made up of a list of fixed size chunks taken from a carveout. Chunk sizes
are configured when the heaps are created by passing the chunk size in the
priv field of the heap platform data.
Change-Id: Ia9e003f727b553a92804264debe119dcf78b14e0
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Thu, 15 Nov 2012 18:43:46 +0000 (10:43 -0800)]
gpu: ion: Refactor common mapping functions out of system heap
The system heap contained several general purpose functions to map
buffers to the kernel and userspace. This patch refactors those
into ion_heap.c so they can be used by other heaps.
Change-Id: If64591798bdc2c248bf9064ace2c927909d7adb8
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Thu, 15 Nov 2012 18:36:10 +0000 (10:36 -0800)]
gpu: ion: Switch heap rbtree to a prio list
Switches the rbtree tree of heaps for a plist. This significantly
simplifies the code and the list is small and is modified only at
first boot so the rbtree is unnecessary. This also switches
the traversal of the heap list to traverse from highest to lowest
id's. This allows allocations to pass a heap mask that falls
back on the system heap -- typically id 0, which is the common case.
Change-Id: I715be6f4cf020a84ca4f1947c30ee3d2559fb523
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Thu, 15 Nov 2012 18:34:45 +0000 (10:34 -0800)]
gpu: ion: Fix bug where MAP ioctl was no longer supported
Change-Id: Idbe628ed7dbd6a14469194120b94934d6e99d367
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Thu, 15 Nov 2012 18:31:02 +0000 (10:31 -0800)]
gpu: ion: Modify reserve function for carveouts with no start address
This patch allows you to specify a heap that requires carveout memory
but that doesn't specify a start address. Memblock_alloc will be called
to find a location for these heaps.
Change-Id: I9c79b30e3105e796060fc74b058f04093ee5e96e
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Todd Poynor [Sat, 8 Dec 2012 04:08:45 +0000 (20:08 -0800)]
cpufreq: interactive: remove load since last speed change
The longer-term load since last speed change isn't terribly useful,
may delay recognition of dropping load, and would need forthcoming
changes to adjust load for changing CPU speeds. Drop it.
Change-Id: Ic3cbb0542cc3484617031787e03ed9bdd632dec1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Wed, 14 Nov 2012 19:41:21 +0000 (11:41 -0800)]
cpufreq: interactive: allow arbitrary speed / target load mappings
Accept a string of target loads and speeds at which to apply the
target loads, per the documentation update in this patch. For example,
"85
1000000:90
1700000:99" targets CPU load 85% below speed 1GHz, 90%
at or above 1GHz, until 1.7GHz and above, at which load 99% is targeted.
Attempt to avoid oscillations by evaluating the current speed
weighted by current load against each new choice of speed, choosing a
higher speed if the current load requires a higher speed.
Change-Id: Ie3300206047c84eca5a26b0b63ea512e5207550e
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Benjamin Gaignard [Tue, 9 Oct 2012 11:39:25 +0000 (13:39 +0200)]
gpu: ion: fix compilation warning
use atomic_read to get the refcount value to avoid compilation warning
Change-Id: I9bf0a07c787af8f87ac19314f996a78142f72f6b
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Benjamin Gaignard [Wed, 17 Oct 2012 09:32:02 +0000 (11:32 +0200)]
gpu: ion: fix carveout ops
when using carveout heap ion_buffer_create function failed because
map_dma and unmap_dma operations aren't set by carveout heap.
Change-Id: I817bfad742abfab10b01d9b3d2e18bdf812a1307
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Rebecca Schultz Zavin [Mon, 3 Dec 2012 19:43:49 +0000 (11:43 -0800)]
gpu: ion: Fix bug in zeroing pages in system heap
Pages are zeroed for security purposes when returned to the
ion heap. There was a bug in this code preventing this
from happening.
Bug:
7573871
Change-Id: I79c22ee1da98f306199f3a192eaec4e81d5fd059
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Todd Poynor [Thu, 8 Nov 2012 23:06:55 +0000 (15:06 -0800)]
cpufreq: interactive: apply above_hispeed_delay to each step above hispeed
Apply above_hispeed_delay whenever increasing speed to a new speed above
hispeed (not just the first step above hispeed).
Change-Id: Ibb7add7db47f2a4306a9458c4e1ebabb60698636
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Thu, 29 Nov 2012 01:58:17 +0000 (17:58 -0800)]
cpufreq: interactive: change speed according to current speed and target load
Add a target_load attribute that specifies how aggressively the governor is
to adjust speed to meet the observed load. New target speed is calculated
as the current actual speed (may be higher than target speed on SMP) times
the CPU load (as a fraction) divided by target load (fraction).
cpufreq_frequency_table_target() call use CPUFREQ_RELATION_L to set
the next higher speed rather than next lower speed.
Change-Id: If432451da82f5fed12e15c9421d7d27792376150
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Thu, 29 Nov 2012 01:56:09 +0000 (17:56 -0800)]
cpufreq: interactive: trace actual speed in target speed decisions
Tracing adds actual speed since this is expected to be key to the
choice of target speed.
Change-Id: Iec936102d0010c4e9dfa143c38a9fd0d551189c3
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Wed, 28 Nov 2012 21:03:40 +0000 (13:03 -0800)]
usb: gadget: accessory: Fix section mismatch (again)
create_bulk_endpoints should not be __init since it is called when
accessory is enabled.
Change-Id: Iac6e9f29d53c93760e926efd8e7603432632acb4
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Pontus Fuchs [Mon, 19 Nov 2012 19:44:51 +0000 (11:44 -0800)]
netfilter: qtaguid: Don't BUG_ON if create_if_tag_stat fails
If create_if_tag_stat fails to allocate memory (GFP_ATOMIC) the
following will happen:
qtaguid: iface_stat: tag stat alloc failed
...
kernel BUG at xt_qtaguid.c:1482!
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Todd Poynor [Tue, 9 Oct 2012 03:14:34 +0000 (20:14 -0700)]
cpufreq: interactive: kick timer on idle exit past expiry
The deferrable timer list isn't checked on all idle exits, such as when
hi-res timers expire or ISRs schedule workers. If the idle loop is
exited and it's past time to run the governor load polling timer,
run it immediately. This ensures we handle load spikes caused by actvity
that does not run the normal timer list.
Rename the field that timestamps the "time_in_idle" value to be more
accurate.
Change-Id: Ied590ecbefc83c9a9ec5eb9e31903557f6fa1614
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Lianwei Wang [Thu, 1 Nov 2012 01:59:52 +0000 (09:59 +0800)]
cpufreq: interactive: use deferrable timer by default
Avoid wakeups only to handle the governor timer when the system is otherwise
idle.
For platforms where the power cost of remaining in idle at higher CPU
speed may outweigh the cost of a governor wakeup from idle to lower the speed,
set parameter cpufreq_interactive.governidle=1.
Change-Id: Id6c43eb35caecf9b0574fcdd5b769711bc7e6de6
Signed-off-by: LianWei WANG <a22439@motorola.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Mon, 5 Nov 2012 21:09:03 +0000 (13:09 -0800)]
cpufreq: interactive: pin timers to associated CPU
Helps avoid waking up other CPUs to react to activity on the local CPU.
Change-Id: Ife272aaa7916894a437705d44521b1a1693fbe8e
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Mars [Sat, 3 Nov 2012 04:15:38 +0000 (12:15 +0800)]
ARM: fiq_debugger: fix uninitialised spin_lock.
Backtrace:
[<
c0045ea0>] (dump_backtrace+0x0/0x10c) from [<
c0575c60>] (dump_stack+0x1)
r6:
c07a489c r5:
c0c9b9dc r4:
00000002 r3:
271aed3b
[<
c0575c48>] (dump_stack+0x0/0x1c) from [<
c00b1b00>] (__lock_acquire+0x93)
[<
c00b11c8>] (__lock_acquire+0x0/0xad4) from [<
c00b219c>] (lock_acquire+0)
[<
c00b210c>] (lock_acquire+0x0/0xa4) from [<
c057e544>] (_raw_spin_lock_ir)
[<
c057e4f8>] (_raw_spin_lock_irq+0x0/0x5c) from [<
c005297c>] (fiq_tty_wri)
r5:
e30f0000 r4:
e36f0c00
[<
c005293c>] (fiq_tty_write+0x0/0x80) from [<
c023168c>] (n_tty_write+0x18)
r8:
e370fc40 r7:
e378a000 r6:
e3572d1c r5:
e36f0c00 r4:
00000002
r3:
c005293c
[<
c0231500>] (n_tty_write+0x0/0x440) from [<
c022d4a4>] (tty_write+0x100/0)
[<
c022d3a4>] (tty_write+0x0/0x2a8) from [<
c0100b80>] (vfs_write+0xa4/0x14)
[<
c0100adc>] (vfs_write+0x0/0x148) from [<
c0100cdc>] (sys_write+0x40/0x78)
r8:
00000002 r7:
4076d2c4 r6:
e370fc40 r5:
00000000 r4:
00000000
[<
c0100c9c>] (sys_write+0x0/0x78) from [<
c0041740>] (ret_fast_syscall+0x0)
r8:
c0041908 r7:
00000004 r6:
00000002 r5:
00000000 r4:
4007cbe0
[ccross: moved spin_lock_init into existing #ifdef]
Change-Id: If400d084eb20433c126ea1dd027a6be7f2ebb1f6
Signed-off-by: Mars <caoziqiang@meizu.com>
Signed-off-by: Colin Cross <ccross@android.com>
Colin Cross [Thu, 1 Nov 2012 00:41:39 +0000 (17:41 -0700)]
ARM: fiq_debugger: lock between tty and console writes
debug_console_write calls debug_uart_flush, which will usually wait
until the serial port fifo empties. If another thread is continuously
calling fiq_tty_write, the fifo will constantly be refilled and
debug_uart_flush might never return.
Add a spinlock that is locked in debug_console_write and fiq_tty_write
to ensure they can't run at the same time. This has an extra advantage
of preventing lines from the console and tty from being mixed together.
Also reduce the size returned by fiq_tty_write_room to keep the time
spent with the spinlock held to a reasonable value.
In addition, make sure fiq context can't loop forever by never calling
debug_uart_flush when the console is enabled.
Change-Id: I5712b01f740ca0c84f680d2032c9fa16b7656939
Signed-off-by: Colin Cross <ccross@android.com>
Erik Gilling [Fri, 14 Sep 2012 21:36:34 +0000 (14:36 -0700)]
sync: add Documentation/sync.txt
Change-Id: Ic7f3a6d4622083be607b82ddd8d676609225bb8f
Signed-off-by: Erik Gilling <konkers@android.com>
Rebecca Schultz Zavin [Tue, 23 Oct 2012 17:47:04 +0000 (10:47 -0700)]
gpu: ion: Fix bug in ion_system_heap map_user
When the requested mmap length was not an integer number of
chunks or the buffer, or if an offset was provided, a bug
would cause extra or incorrect pages of the buffer to be mapped.
Change-Id: I2766763d86048f026eeef0e0388b7de0e25c2093
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Fri, 19 Oct 2012 04:54:01 +0000 (21:54 -0700)]
gpu: ion: Don't flush allocatoins that come from the page pools
Change-Id: Ib08cb2cea3b6ea4b1ebf5a1b28abe6b9374fd2bd
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Fri, 19 Oct 2012 04:51:53 +0000 (21:51 -0700)]
gpu: ion: Clear GFP_WAIT flag on high order allocations
This will prevent the kernel from kicking off compaction
when higher order allocations are made. Instead we will
get these high order allocations only if they are readily
available.
Change-Id: I5c038781ef4028c1c0a1a52b6cb549d26550a124
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Danke Xie [Tue, 16 Oct 2012 22:24:41 +0000 (15:24 -0700)]
power: android-battery: Allow changing current in charging state
When a new charge source is set, enable charging and set the charging
current, unless we've paused charging due to battery full or battery
health problems.
Change-Id: I129e621c455a941e264dc431b4eb9db6a17c9f7b
Signed-off-by: Danke Xie <d.xie@sta.samsung.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Arve Hjønnevåg [Tue, 16 Oct 2012 03:58:20 +0000 (20:58 -0700)]
staging:iio:events: Don't copy data to user-space with a locked spinlock.
iio_event_chrdev_read would return -EFAULT if the user-space page was
not resident.
Change-Id: I4ac5d3bc791bb503d014d9db576b9d6d522505b2
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Rebecca Schultz Zavin [Thu, 11 Oct 2012 19:46:05 +0000 (12:46 -0700)]
gpu: ion: Refactor locking
Removes contention for lock between allocate and free by reducing
the length of time the lock is held for. Split out a seperate
lock to protect the list of heaps and replace it with a rwsem since
the list will most likely only be updated during initialization.
Change-Id: I3017ccaa2126c7a24ab22b18e1ee553983977c37
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
HongMin Son [Thu, 11 Oct 2012 10:42:54 +0000 (19:42 +0900)]
power: android-battery: Battery health check only when connected to charger
Only check battery health when connected to a charger.
Change-Id: I43e3f73ac1e5862f8e6dbaa19daa6d322f3bba20
Signed-off-by: HongMin Son <hongmin.son@samsung.com>
Rebecca Schultz Zavin [Wed, 10 Oct 2012 21:19:17 +0000 (14:19 -0700)]
gpu: ion: Switch to using a single shrink function
The single shrink function will free lower order pages first. This
enables compaction to work properly.
Change-Id: Icbeefa9e84c2eacf6962d9536ab66a8b059cc941
Rebecca Schultz Zavin [Wed, 10 Oct 2012 17:34:50 +0000 (10:34 -0700)]
gpu: ion: Fix lockdep issue in ion_page_pool
Currently the mutex is held while kmalloc is called, under a low memory
condition this might trigger the shrinker which also takes this mutex.
Refactor so the mutex is not held during allocation.
Change-Id: Ic1d3b2f69e61209191bac84724ba56f6b98e2bc4
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
JP Abgrall [Wed, 10 Oct 2012 03:38:21 +0000 (20:38 -0700)]
netfilter: xt_qtaguid: fix error exit that would keep a spinlock.
qtudev_open() could return with a uid_tag_data_tree_lock held
when an kzalloc(..., GFP_ATOMIC) would fail.
Very unlikely to get triggered AND survive the mayhem of running out of mem.
Signed-off-by: JP Abgrall <jpa@google.com>
Rebecca Schultz Zavin [Tue, 9 Oct 2012 06:01:23 +0000 (23:01 -0700)]
gpu: ion: Fix several issues with page pool
Split out low and high mem pages so they are correctly reported
when the shrinker is called.
Fix potential deadlock caused by holding the page pool lock while
allocationg and also needing that lock from the shrink function
Change-Id: I6def3a3111f59914ef6b5b59d81a6fde37cb60c5
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Todd Poynor [Fri, 5 Oct 2012 09:04:45 +0000 (02:04 -0700)]
power: android-battery: use freezable workqueue for monitor
Alarmtimer may execute the monitor early in the resume sequence. Freeze the
monitor while suspended, and unfreeze after the battery charger and fuel gauge,
etc. drivers are resumed.
Change-Id: Iefda1c642d4b2440169d90d2bee2888fc70e030a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Rebecca Schultz Zavin [Fri, 5 Oct 2012 20:54:59 +0000 (13:54 -0700)]
mm: vmscan: Add a debug file for shrinkers
This patch adds a debugfs file called "shrinker" when read this calls
all the shrinkers in the system with nr_to_scan set to zero and prints
the result. These results are the number of objects the shrinkers have
available and can thus be used an indication of the total memory
that would be availble to the system if a shrink occurred.
Change-Id: Ied0ee7caff3d2fc1cb4bb839aaafee81b5b0b143
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
HongMin Son [Fri, 5 Oct 2012 04:22:31 +0000 (13:22 +0900)]
power: android-battery: Fix battery alarm timer not modified at suspend
- Alarm Timer driver is suspended before battery driver, so alarm
timer was not changed to slow poll speed at suspend. Use PM
notifiers instead.
- If charger is connected, keep 1 min alarm timer.
Signed-off-by: HongMin Son <hongmin.son@samsung.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Change-Id: Id0f3bda5d0749fd90f1964073bc30c1a73fc317f
Todd Poynor [Thu, 4 Oct 2012 23:11:53 +0000 (16:11 -0700)]
power: android-battery: leave full/not-charging status when charger re-sensed
If charger was connected and a charge source change event occurs such that
the charger is still connected (or a different charge source connected),
do not overwrite an existing state such as full or not-charging. Only
switch from discharging to charging on a charge source change event.
Change-Id: I1b841c8f3a92bf15074999e18b17d1d19ce028d7
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Thu, 4 Oct 2012 22:09:52 +0000 (15:09 -0700)]
power: android-battery: Add state locking
Change-Id: I83abd61f0ee2541f5406258b2c07f76af7d2acb5
Signed-off-by: Todd Poynor <toddpoynor@google.com>
HongMin Son [Fri, 28 Sep 2012 05:03:31 +0000 (14:03 +0900)]
power: android-battery: add charge timeouts and recharge logic
Add recharge logic when voltage threshold reached.
Add charge and recharge timeouts.
Change-Id: I3ef3b926ce694115dde7f8056072bef63884a5d0
Signed-off-by: HongMin Son <hongmin.son@samsung.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Wed, 3 Oct 2012 07:39:56 +0000 (00:39 -0700)]
cpufreq: interactive: run at fraction of hispeed_freq when load is low
When load is below go_hispeed_load, apply the percentage of CPU load to
a max frequency of hispeed_freq instead of the max speed. This avoids
jumping too quickly to hispeed_freq when it is a relatively low
percentage of max speed. This also allows go_hispeed_load to be set to
a high percentage relative to hispeed_freq (as a percentage of max speed,
again useful when hispeed_freq is a low fraction of max speed), to cap
larger loads at hispeed_freq. For example, a load of 60% will typically
move to 60% of hispeed_freq, not 60% of max speed. This causes the
governor to apply two different speed caps, depending on whether load is
below or above go_hispeed_load.
Also fix the type of hispeed_freq, which was u64, to match other
speed data types (and avoid overhead and allow division).
Change-Id: Ie2d0668be161c074aaad77db2037505431457b3a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Rebecca Schultz Zavin [Wed, 3 Oct 2012 05:43:41 +0000 (22:43 -0700)]
gpu: ion: Modify gfp flags in ion_system_heap
When allocations larger than order 4 are made, use _GFP_NORETRY
and __GFP_NO_KSWAPD so kswapd doesn't get kicked off to reclaim
these larger chunks. For smaller allocaitons, these are
unnecessary, as the system should be able to reclaim these.
Change-Id: I6b45cd1a595d25cc39622e3dbcc04d84fa1b7db8
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Tue, 7 Aug 2012 04:37:23 +0000 (21:37 -0700)]
gpu: ion: Use the ion_page_pool from the system heap
With this change the system heap will use pagepools to avoid
having to invalidate memory when it is allocated, a
significant performance improvement on some systems.
Change-Id: I96ab778d67c4b19805883dcfa44d750811cdff48
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Thu, 7 Jun 2012 23:36:44 +0000 (16:36 -0700)]
gpu: ion: Add ion_page_pool.
This patch adds a new utility heaps can use to manage
memory. In the past we have found it can be very
expensive to manage the caches when allocating memory,
but it is imposible to know whether a previous user of a
given memory allocation had a cached mapping. This patch
adds the ability to store a pool of pages that were
previously used uncached so that cache maintenance
only need be done when growing this pool. The pool also
contains a shrinker so memory from the pool can be
recovered in low memory conditions.
Change-Id: I686fd7d192060fd32d34ef66471f62b7829006ee
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Sun, 30 Sep 2012 21:53:27 +0000 (14:53 -0700)]
gpu: ion: use vmalloc to allocate page array to map kernel
When ion_map_kernel is execute the system must allocate
an array large enough to hold a pointer to each page in
the buffer. If the buffer is very large and the system
memory has become very fragmented, there may not be
sufficient high order allocations available from kmalloc.
Use vmalloc instead.
Change-Id: I5fabf79be6cfd158f7805bfca6267a60c4708582
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Arve Hjønnevåg [Wed, 26 Sep 2012 00:37:14 +0000 (17:37 -0700)]
staging: android: lowmemorykiller: Add config option to support oom_adj values
The conversion to use oom_score_adj instead of the deprecated oom_adj
values breaks existing user-space code. Add a config option to convert
oom_adj values written to oom_score_adj values if they appear to be
valid oom_adj values.
Change-Id: I68308125059b802ee2991feefb07e9703bc48549
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Rebecca Schultz Zavin [Wed, 26 Sep 2012 17:58:30 +0000 (10:58 -0700)]
gpu: ion: ion_system_heap: Fix bug preventing compilation
Change-Id: I91d77492b99d09c7abdfaa09df280a20ee83f428
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Wed, 26 Sep 2012 03:55:27 +0000 (20:55 -0700)]
gpu: ion: Stop trying to allocate from an order on first failure
With this patch the system heap will only try to allocate from each
order as long as allocations succeed. If it failes to obtain a higher
order allocation, it doesn't retry that order.
Change-Id: I0d9144b4c30cc0e427acdcad2f1f12ae7f37f827
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Fri, 21 Sep 2012 18:46:06 +0000 (11:46 -0700)]
gpu: ion: optimize system heap for non fault buffers
If a buffer's user mappings are not going to be faulted
in it need not be allocated page wise. We can optimize
this common case by allocating an sglist of larger chunks
rather than creating an entry for each page in the
allocation.
Change-Id: I47814990e55c7bdb7abeaa2af824744b0a97602d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Todd Poynor [Tue, 25 Sep 2012 01:03:58 +0000 (18:03 -0700)]
cpufreq: interactive: always limit initial speed bump to hispeed
First bump speed up to hispeed_freq whenever the current speed is below
hispeed_freq, instead of only when the current speed is the minimum speed.
The previous code made it too difficult to use hispeed_freq as a common
intermediate speed on systems that frequently run at speeds between
minimum and hispeed_freq.
Change-Id: I04ec30bafabf5741e267ff289209b8c2d846824b
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Benoit Goby [Thu, 20 Sep 2012 00:03:34 +0000 (17:03 -0700)]
usb: gadget: f_fs: Fix enumeration in fullspeed mode
ffs_func_eps_enable always take the highspeed usb_endpoint_descriptor
if it is available. Choose the correct usb_endpoint_descriptor
depending on the gadget speed instead.
Change-Id: I5b8444cfdf1b6fe1eef25525fb7a0a0f617a353e
Signed-off-by: Benoit Goby <benoit@android.com>
JP Abgrall [Thu, 20 Sep 2012 23:34:10 +0000 (16:34 -0700)]
net: PPPoPNS and PPPoLAC update to use PPP_MRU instead of PPP_MRU
Some headers files were moved around and some defines renamed.
Signed-off-by: JP Abgrall <jpa@google.com>
Rebecca Schultz Zavin [Thu, 20 Sep 2012 06:31:05 +0000 (23:31 -0700)]
gpu: ion: Add support for cached mappings that don't fault
We have found that faulting in the mappings for cached
allocations has a significant performance impact and is
only a benefit if only a small part of the buffer is
touched by the cpu (an uncommon case for software rendering).
This patch introduces a ION_FLAG_CACHED_NEEDS_SYNC
which determines whether a mapping should be created by
faulting or at mmap time. If this flag is set,
userspace must manage the caches explictly using the SYNC ioctl.
Change-Id: I227561f49e0f382a481728fb55ac5c930fc26025
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Mike Lockwood [Fri, 11 May 2012 16:01:08 +0000 (09:01 -0700)]
USB: gadget: f_audio_source: New gadget driver for audio output
This driver presents a standard USB audio class interface to the host
and an ALSA PCM device to userspace
Change-Id: If16b14a5ff27045f9cb2daaf1ae9195c5eeab7d0
Signed-off-by: Mike Lockwood <lockwood@google.com>
Mike Lockwood [Mon, 26 Mar 2012 18:03:55 +0000 (11:03 -0700)]
USB: gadget: f_accessory: Add support for HID input devices
Change-Id: I4f1452db32508382df52acdc47c0eb395ae328c7
Signed-off-by: Mike Lockwood <lockwood@google.com>
Mike Lockwood [Fri, 11 May 2012 16:00:40 +0000 (09:00 -0700)]
USB: gadget: Add ACCESSORY_SET_AUDIO_MODE control request and ioctl
The control request will be used by the host to enable/disable USB audio
and the ioctl will be used by userspace to read the audio mode
Change-Id: I81c38611b588451e80eacdccc417ca6e11c60cab
Signed-off-by: Mike Lockwood <lockwood@google.com>
Rebecca Schultz Zavin [Mon, 10 Sep 2012 23:12:01 +0000 (16:12 -0700)]
gpu: ion: Fix memory leak of dirty bits
Change-Id: Ia65ebac1f094bbea4090a5ddfa91bf8f5497bc16
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Todd Poynor [Fri, 31 Aug 2012 06:09:14 +0000 (23:09 -0700)]
w1: ds2482: Manage SLPZ pin sleep state
Place SLPZ pin in sleep state at system suspend time if a GPIO is
provided by board platform data.
Change-Id: I93c61fa0ae474e968e0f909209c9bfcaafe3dd2c
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Rebecca Schultz Zavin [Wed, 29 Aug 2012 00:27:22 +0000 (17:27 -0700)]
gpu: ion: Add debug information for orphaned handles
It is possible for a buffer to exist only as a dma_buf file
descriptor without it being held in any handles. When this
occurs it is impossible to track where the buffer is in the
system (without traversing every process in the system and
inspecting its file table). When buffers are orphaned like
this, copy the task comm and pid of the last client to hold
them into the buffer so we have a debugging hint as to where
this buffer came from. In practice this will probalby be
the process that allocated the buffer.
Change-Id: I49d179f9ccdee36982f365af15d0f0b577c6347e
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Wed, 29 Aug 2012 17:30:08 +0000 (10:30 -0700)]
gpu: ion: Fix bug in ion_free
Change-Id: I9e92ed750c5cd5d0329ce1747e419c908e0f37ef
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Mon, 20 Aug 2012 22:41:11 +0000 (15:41 -0700)]
gpu: ion: Fix race between ion_import and ion_free
If preemted during ion_free after the refcount is updated but
before the handle can be removed from the rb_tree, import
might find that handle in the tree and try to reuse it
when execution returns to free, the handle will be cleaned
up leaving the caller of import with a corrupt handle.
This patch modifies the locking to protect agains this race.
Change-Id: I31d18cc6398f0ca18e05cd919e2bcf86fa18d568
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
JP Abgrall [Tue, 28 Aug 2012 23:53:32 +0000 (16:53 -0700)]
netfilter: xt_qtaguid: report only uid tags to non-privileged processes
In the past, a process could only see its own stats (uid-based summary,
and details).
Now we allow any process to see other UIDs uid-based stats, but still
hide the detailed stats.
Change-Id: I7666961ed244ac1d9359c339b048799e5db9facc
Signed-off-by: JP Abgrall <jpa@google.com>
Todd Poynor [Thu, 23 Aug 2012 20:41:54 +0000 (13:41 -0700)]
power: android-battery: use 1/10th deg C units for temperature
Same units as power_supply, don't need 1/10000 deg C and conversion
is error-prone.
Change-Id: I8cf146d2a7725df2dacc415daa66b2986b69f2a7
Signed-off-by: Todd Poynor <toddpoynor@google.com>
hongmin.son [Thu, 23 Aug 2012 20:11:30 +0000 (13:11 -0700)]
power: android-battery: Add USB and AC battery power supplies
For reflecting board-level decisions on whether USB or AC charger
is connected, which may differ from charger power supply notion
of USB input path (which may be connected to an AC charger) vs.
AC input path.
Change-Id: I9d2eb446db8b4d9496ba7ce1472d0e7a4d4e24ef
[toddpoynor@google.com: refactoring]
Signed-off-by: hongmin.son <hongmin.son@samsung.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Greg Hackmann [Thu, 23 Aug 2012 00:38:04 +0000 (17:38 -0700)]
gpu: ion: fix page offset in dma_buf_kmap()
Change-Id: I1c975f0ffde5c75d6166ae20d379991d3f770a26
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Todd Poynor [Thu, 23 Aug 2012 02:02:26 +0000 (19:02 -0700)]
power: android-battery: Provide fake values when fuel gauge missing
Avoid shutdown due to battery capacity or temperature out of range.
Change-Id: I54abe4dc54bf2fb8a9b972a3940e6fd93cc60473
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Rebecca Schultz Zavin [Wed, 22 Aug 2012 04:35:20 +0000 (21:35 -0700)]
gpu: ion: Switch to using kmalloc rather than kmap during allocation
Previously, metadata was stored in the allocated pages themselves
during allocation. However the system can only have a limited
number of kmapped pages. A very large allocation might exceed
this limit.
Change-Id: Ibe972096e83924bf5e621d8282c4cd133ca75b0a
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Mike J. Chen [Thu, 24 May 2012 22:12:36 +0000 (15:12 -0700)]
ARM: disable preemption in machine_shutdown
Since the smp call to stop the other cpus are handled in those
cpus in interrupt context, there's a potential for those smp
handlers to interrupt threads holding spin locks (such as the
one a mutex holds). This prevents those threads from ever
releasing their spin lock, so if the cpu doing the shutdown
is allowed to switch to another thread that tries to grab the
same lock/mutex, we could get into a deadlock (the spin lock
call is called with preemption disabled in the mutex lock code).
To avoid that possibility, disable preemption before doing the
smp_send_stop().
Change-Id: I7976c5382d7173fcb3cd14da8cc5083d442b2544
Signed-off-by: Mike J. Chen <mjchen@google.com>
Ashish Sharma [Mon, 13 Aug 2012 20:19:57 +0000 (13:19 -0700)]
netfilter: xt_IDLETIMER: Rename INTERFACE to LABEL in netlink notification.
Change-Id: Iaeca5dd2d7878c0733923ae03309a2a7b86979ca
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
Rebecca Schultz Zavin [Fri, 10 Aug 2012 04:29:52 +0000 (21:29 -0700)]
gpu: ion: Only map as much of the vma as the user requested
Change-Id: If0e368e192941c118683ab74aed48e4e0cb5731d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Todd Poynor [Tue, 7 Aug 2012 01:18:31 +0000 (18:18 -0700)]
power: android_battery: nn.n temperature format for /d/android-power
Change-Id: I0c20effcadd3c0673d04be190133883b3c2bf599
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Mon, 6 Aug 2012 19:01:51 +0000 (12:01 -0700)]
power: android_battery: fix negative temperature display
Change-Id: Ic9798bc5194b6192fec726a8f136867f111e4765
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Benoit Goby [Tue, 15 Feb 2011 05:32:43 +0000 (21:32 -0800)]
PM: Add watchdog to catch lockup during device resume
Refactor the dpm suspend watchdog code and add watchdogs
on resume too. The dpm wachdog prints the stack trace and
reboots the system if a device takes more than 12 seconds
to suspend or resume.
Change-Id: If00c047a17b80bdc13a8426393c698bc450a7347
Signed-off-by: Benoit Goby <benoit@android.com>
Todd Poynor [Sat, 4 Aug 2012 01:58:46 +0000 (18:58 -0700)]
power: android: switch to nn.n format for temperature readings
Change-Id: I67b44e5c706c94f5e2031da9dab3dddb1a4b6b3f
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Thu, 2 Aug 2012 01:22:22 +0000 (18:22 -0700)]
power: android: battery monitor polling with wakeup alarms
Based on Tuna code from 3.0 ported to 3.4 alarm API.
Change-Id: I9b13209963d5a5043237e9e29f3cb07c40583af2
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Laura Abbott [Thu, 2 Aug 2012 01:06:18 +0000 (18:06 -0700)]
gpu: ion: Don't call ion_buffer_put on error path
If dma_buf_fd fails, the dma_buf needs to be cleaned up by
calling dma_buf_put. dma_buf_put will call ion_dma_buf_release
which in turn calls ion_buffer_put to clean up the buffer
reference. Calling ion_buffer_put after dma_buf_put drops the
reference count by one more which is incorrect. Fix this by
getting rid of the extra ion_buffer_put call.
Change-Id: Ieb3a7b781bf2dc299c45384dbf0a12d186adeb22
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Todd Poynor [Wed, 1 Aug 2012 03:14:05 +0000 (20:14 -0700)]
power: android: add /d/android-power
Change-Id: I306ae5928bb5c32dc986811cfa3a6dd98519a2d7
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Fri, 27 Jul 2012 18:27:33 +0000 (11:27 -0700)]
power: android battery: add generic android battery driver
Add a generic battery power supply and glue logic for talking to the
board battery driver. This driver handles common chores such as:
* periodic battery level and health monitoring
* kernel log reporting and other debugging features for key
properties provided by different charger, fuel gauge, etc.
components
* ensure properties such as battery health are made available to
userspace
* common processing for board-level battery/case temperature sensors
and policy for charging status based on battery health
Based on work by himihee.seo@samsung.com, ms925.kim@samsung.com, and
joshua.chang@samsung.com.
Change-Id: I5fa8e8d68811d84820b7a130b0245ad2b5b6d36b
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Olav Haugan [Tue, 15 May 2012 21:40:11 +0000 (14:40 -0700)]
gpu: ion: IOCTL return success when error occurs
ION_IOC_MAP, ION_IOC_SHARE, and ION_IOC_IMPORT may return
success when an error occurs.
Add correct error handling to ION_IOC_MAP, ION_IOC_SHARE, and
ION_IOC_IMPORT.
Change-Id: I61c6b0c574da425604235b2d39e13e4a27f7b6f3
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Olav Haugan [Wed, 25 Jan 2012 17:28:55 +0000 (09:28 -0800)]
gpu: ion: Add EXPORT_SYMBOL to functions
Several functions in the ion interface is missing
EXPORT_SYMBOL. This is needed to allow clients to
use these functions from kernel modules.
Add EXPORT_SYMBOL to functions that are supposed
to be exposed.
Change-Id: I25611f7c367fd131daf5fb652abbea77e89a3d06
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Olav Haugan [Thu, 19 Apr 2012 17:20:22 +0000 (10:20 -0700)]
gpu: ion: Add missing argument to WARN call
The condition argument to the WARN call in ion_free and
ion_share_dma_buf are missing. Add the argument to
allow correct printing of warning message.
Change-Id: I9b233992d5034f8780296cae6b42d77699f14cce
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Dima Zavin [Fri, 27 Jul 2012 22:29:55 +0000 (15:29 -0700)]
gpu: ion: do not ask for compound pages in system heap
Change-Id: If84b246ec984ee2ae7b0174c714c8ce7726a6ab1
Signed-off-by: Dima Zavin <dima@android.com>
Hosung Kim [Mon, 23 Jul 2012 08:33:17 +0000 (17:33 +0900)]
mmc: sdio: Fix sdio_reset_comm for sync
mmc_sdio_init_card function is doing necessary initialization
Change-Id: I7d2e432b2af8a76267378acba07e3e4e8fd1e6bc
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
Colin Cross [Fri, 20 Jul 2012 01:40:04 +0000 (18:40 -0700)]
ARM: fiq_debugger: add process context reboot command
kernel_restart cannot be called from interrupt context. Add support for
commands called from a work function, and implement the "reboot" command
there. Also rename the existing irq-mode command to "reset" and change
it to use machine_restart instead of kernel_restart.
Change-Id: I3c423147c01db03d89e95a5b99096ca89462079f
Signed-off-by: Colin Cross <ccross@android.com>
Todd Poynor [Wed, 18 Jul 2012 23:28:50 +0000 (16:28 -0700)]
power: power_supply: add POWER_SUPPLY_PROP_CHARGE_ENABLED
Change-Id: I3e93b502452811cbfc4d904202b4f1d94edc143d
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Tue, 17 Jul 2012 00:32:44 +0000 (17:32 -0700)]
cpufreq: interactive: remove input_boost handling
Now handled in userspace Power HAL instead.
Change-Id: I78a4a2fd471308bfcd785bbefcc65fede27314cf
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Tue, 17 Jul 2012 00:07:15 +0000 (17:07 -0700)]
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>
Sam Leffler [Wed, 27 Jun 2012 19:55:56 +0000 (12:55 -0700)]
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
Sam Leffler [Wed, 27 Jun 2012 17:12:04 +0000 (10:12 -0700)]
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
Todd Poynor [Fri, 13 Jul 2012 20:30:04 +0000 (13:30 -0700)]
power: power_supply: add POWER_SUPPLY_PROP_USB_OTG
Change-Id: Idfc6ef2e37d62aad6f26cc8eafa53db642cd352b
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Fri, 13 Jul 2012 03:27:16 +0000 (20:27 -0700)]
power: power_supply: move POWER_SUPPLY_PROP_USB_HC to type 'int' order
Change-Id: I001af30ab5fe06dde5f368241f21b9e0864777a1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Benoit Goby [Fri, 20 Jan 2012 22:42:41 +0000 (14:42 -0800)]
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>
Todd Poynor [Tue, 3 Jul 2012 22:41:20 +0000 (15:41 -0700)]
power_supply: Add custom property for USB High Current mode
For smb347.
Change-Id: I3323469072e1ee5085d61af8a89612b06b91f94a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Rebecca Schultz Zavin [Tue, 26 Jun 2012 20:17:34 +0000 (13:17 -0700)]
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>