firefly-linux-kernel-4.4.55.git
11 years agogpu: ion: fix carveout ops
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>
11 years agogpu: ion: Fix bug in zeroing pages in system heap
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>
11 years agocpufreq: interactive: apply above_hispeed_delay to each step above hispeed
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>
11 years agocpufreq: interactive: change speed according to current speed and target load
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>
11 years agocpufreq: interactive: trace actual speed in target speed decisions
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>
11 years agousb: gadget: accessory: Fix section mismatch (again)
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>
11 years agonetfilter: qtaguid: Don't BUG_ON if create_if_tag_stat fails
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>
11 years agocpufreq: interactive: kick timer on idle exit past expiry
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>
11 years agocpufreq: interactive: use deferrable timer by default
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>
11 years agocpufreq: interactive: pin timers to associated CPU
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>
11 years agoARM: fiq_debugger: fix uninitialised spin_lock.
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>
11 years agoARM: fiq_debugger: lock between tty and console writes
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>
11 years agosync: add Documentation/sync.txt
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>
11 years agogpu: ion: Fix bug in ion_system_heap map_user
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>
11 years agogpu: ion: Don't flush allocatoins that come from the page pools
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>
11 years agogpu: ion: Clear GFP_WAIT flag on high order allocations
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>
11 years agopower: android-battery: Allow changing current in charging state
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>
11 years agostaging:iio:events: Don't copy data to user-space with a locked spinlock.
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>
11 years agogpu: ion: Refactor locking
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>
11 years agopower: android-battery: Battery health check only when connected to charger
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>
11 years agogpu: ion: Switch to using a single shrink function
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

11 years agogpu: ion: Fix lockdep issue in ion_page_pool
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>
11 years agonetfilter: xt_qtaguid: fix error exit that would keep a spinlock.
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>
11 years agogpu: ion: Fix several issues with page pool
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>
11 years agopower: android-battery: use freezable workqueue for monitor
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>
11 years agomm: vmscan: Add a debug file for shrinkers
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>
11 years agopower: android-battery: Fix battery alarm timer not modified at suspend
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

11 years agopower: android-battery: leave full/not-charging status when charger re-sensed
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>
11 years agopower: android-battery: Add state locking
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>
11 years agopower: android-battery: add charge timeouts and recharge logic
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>
11 years agocpufreq: interactive: run at fraction of hispeed_freq when load is low
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>
11 years agogpu: ion: Modify gfp flags in ion_system_heap
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>
11 years agogpu: ion: Use the ion_page_pool from the system heap
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>
11 years agogpu: ion: Add ion_page_pool.
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>
11 years agogpu: ion: use vmalloc to allocate page array to map kernel
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>
11 years agostaging: android: lowmemorykiller: Add config option to support oom_adj values
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>
11 years agogpu: ion: ion_system_heap: Fix bug preventing compilation
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>
11 years agogpu: ion: Stop trying to allocate from an order on first failure
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>
11 years agogpu: ion: optimize system heap for non fault buffers
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>
11 years agocpufreq: interactive: always limit initial speed bump to hispeed
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>
11 years agousb: gadget: f_fs: Fix enumeration in fullspeed mode
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>
11 years agonet: PPPoPNS and PPPoLAC update to use PPP_MRU instead of PPP_MRU
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>
11 years agogpu: ion: Add support for cached mappings that don't fault
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>
11 years agoUSB: gadget: f_audio_source: New gadget driver for audio output
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>
11 years agoUSB: gadget: f_accessory: Add support for HID input devices
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>
11 years agoUSB: gadget: Add ACCESSORY_SET_AUDIO_MODE control request and ioctl
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>
11 years agogpu: ion: Fix memory leak of dirty bits
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>
11 years agow1: ds2482: Manage SLPZ pin sleep state
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>
11 years agogpu: ion: Add debug information for orphaned handles
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>
11 years agogpu: ion: Fix bug in ion_free
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>
11 years agogpu: ion: Fix race between ion_import and ion_free
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>
11 years agonetfilter: xt_qtaguid: report only uid tags to non-privileged processes
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>
11 years agopower: android-battery: use 1/10th deg C units for temperature
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>
11 years agopower: android-battery: Add USB and AC battery power supplies
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>
11 years agogpu: ion: fix page offset in dma_buf_kmap()
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>
11 years agopower: android-battery: Provide fake values when fuel gauge missing
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>
11 years agogpu: ion: Switch to using kmalloc rather than kmap during allocation
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>
11 years agoARM: disable preemption in machine_shutdown
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>
11 years agonetfilter: xt_IDLETIMER: Rename INTERFACE to LABEL in netlink notification.
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>
11 years agogpu: ion: Only map as much of the vma as the user requested
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>
11 years agopower: android_battery: nn.n temperature format for /d/android-power
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>
11 years agopower: android_battery: fix negative temperature display
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>
11 years agoPM: Add watchdog to catch lockup during device resume
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>
11 years agopower: android: switch to nn.n format for temperature readings
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>
11 years agopower: android: battery monitor polling with wakeup alarms
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>
11 years agogpu: ion: Don't call ion_buffer_put on error path
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>
11 years agopower: android: add /d/android-power
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>
11 years agopower: android battery: add generic android battery driver
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>
11 years agogpu: ion: IOCTL return success when error occurs
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>
11 years agogpu: ion: Add EXPORT_SYMBOL to functions
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>
11 years agogpu: ion: Add missing argument to WARN call
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>
11 years agogpu: ion: do not ask for compound pages in system heap
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>
11 years agommc: sdio: Fix sdio_reset_comm for sync
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>
11 years agoARM: fiq_debugger: add process context reboot command
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>
11 years agopower: power_supply: add POWER_SUPPLY_PROP_CHARGE_ENABLED
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>
11 years agocpufreq: interactive: remove input_boost handling
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>
11 years agocpufreq: interactive: handle speed up and down in the realtime task
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>
11 years agocpufreq: interactive: keep freezer happy when not current governor
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

11 years agocpufreq: interactive: take idle notifications only when active
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

11 years agopower: power_supply: add POWER_SUPPLY_PROP_USB_OTG
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>
11 years agopower: power_supply: move POWER_SUPPLY_PROP_USB_HC to type 'int' order
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>
11 years agousb: gadget: Fix usb string id allocation
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>
11 years agopower_supply: Add custom property for USB High Current mode
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>
11 years agogpu: ion: Add explicit sync ioctl
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>
11 years agogpu: ion: Modify the system heap to try to allocate large/huge pages
Rebecca Schultz Zavin [Thu, 14 Jun 2012 20:30:01 +0000 (13:30 -0700)]
gpu: ion: Modify the system heap to try to allocate large/huge pages

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

Change-Id: Ie6ff215a5f32a837bf3103f79a09748e38759f0e
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
11 years agogpu: ion: Add cache maintenance to ion.
Rebecca Schultz Zavin [Thu, 14 Jun 2012 22:08:53 +0000 (15:08 -0700)]
gpu: ion: Add cache maintenance to ion.

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

Change-Id: Id5d6894e8bb52af038c91dd895143bf3b4203b0b
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
11 years agogpu: ion: Switch max num_heaps to 16 to work around an issue elsewere
Rebecca Schultz Zavin [Mon, 25 Jun 2012 21:02:25 +0000 (14:02 -0700)]
gpu: ion: Switch max num_heaps to 16 to work around an issue elsewere

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

11 years agousb: gadget: accessory: Fix section mismatch
Benoit Goby [Sat, 23 Jun 2012 01:17:10 +0000 (18:17 -0700)]
usb: gadget: accessory: Fix section mismatch

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

Change-Id: If827a4531f0f6c15af938345163923186368e2a5
Signed-off-by: Benoit Goby <benoit@android.com>
11 years agopower_supply: convert wakelock to wakeup source
Todd Poynor [Wed, 20 Jun 2012 01:04:30 +0000 (18:04 -0700)]
power_supply: convert wakelock to wakeup source

And supply name will be used as wakeup source name.

Change-Id: I53075491c6e1a4c66755afe8a40b7166cd8d6cb2
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agogpio_input: convert from wakelocks to wakeup sources
Todd Poynor [Wed, 20 Jun 2012 04:06:47 +0000 (21:06 -0700)]
gpio_input: convert from wakelocks to wakeup sources

And add device names to wakeup source names

Change-Id: Ia5f2723319a2e749f00d6ec7d846edff6af6d5c2
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agogpu: ion: Fix bug in heap type enum
Rebecca Schultz Zavin [Thu, 14 Jun 2012 21:52:17 +0000 (14:52 -0700)]
gpu: ion: Fix bug in heap type enum

Change-Id: I8bf1345896774f02bd25c8d25a05d2c1eae262ef
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
11 years agogpu: ion: Map only the vma size given
Laura Abbott [Fri, 16 Mar 2012 22:33:39 +0000 (15:33 -0700)]
gpu: ion: Map only the vma size given

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

Change-Id: I1b391b23219455e879a900d947c728db3c8c4a76
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
11 years agogpu: ion: Loop on the handle count when destroying
Laura Abbott [Thu, 7 Jun 2012 23:41:30 +0000 (16:41 -0700)]
gpu: ion: Loop on the handle count when destroying

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

Change-Id: I7dc5d6a86513fc5fa4e21110ceab434714ea2493
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
11 years agogpu: ion: ion_system_heap: Change allocations to GFP_HIGHUSER
Rebecca Schultz Zavin [Thu, 7 Jun 2012 23:59:59 +0000 (16:59 -0700)]
gpu: ion: ion_system_heap: Change allocations to GFP_HIGHUSER

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

Change-Id: I6d502a5f1c20c8a8e44fb5903fcb228f8435a564
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
11 years agogpu: ion: Set the dma_address of the sg list at alloc time
Rebecca Schultz Zavin [Thu, 7 Jun 2012 21:51:21 +0000 (14:51 -0700)]
gpu: ion: Set the dma_address of the sg list at alloc time

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

Change-Id: Ib3025e80cee52ac0e9d809291e0196a084ea97bd
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
11 years agousb: gadget: android: Add FunctionFS
Benoit Goby [Fri, 30 Mar 2012 02:25:23 +0000 (19:25 -0700)]
usb: gadget: android: Add FunctionFS

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

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

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

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

Change-Id: I44117b183d48a5a99ddbee3ef2cf8998be74598e
Signed-off-by: Benoit Goby <benoit@android.com>
11 years agogpu: ion: fill in buffer->{dev,size} before mapping new buffers
Greg Hackmann [Tue, 5 Jun 2012 20:23:42 +0000 (13:23 -0700)]
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>
11 years agoPM / Suspend: Print wall time at suspend entry and exit
Todd Poynor [Wed, 30 May 2012 00:33:56 +0000 (17:33 -0700)]
PM / Suspend: Print wall time at suspend entry and exit

Change-Id: I92f252414c013b018b9a392eae1ee039aa0e89dc
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agousb: gadget: android: Fix product name
Benoit Goby [Tue, 29 May 2012 20:57:27 +0000 (13:57 -0700)]
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>
11 years agogpu: ion: Get an sg_table from an ion handle
Rebecca Schultz Zavin [Wed, 23 May 2012 19:55:55 +0000 (12:55 -0700)]
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>