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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Todd Poynor [Fri, 11 May 2012 18:06:09 +0000 (11:06 -0700)]
cpufreq: interactive: fixup trace of string params
Change-Id: Iac47f62437e61b13724afbbf9df1a0729f58f236
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynor [Fri, 11 May 2012 06:28:06 +0000 (23:28 -0700)]
cpufreq: interactive: restart above_hispeed_delay at each hispeed load
Change-Id: I2e5b91d45e8806b0ab94ca2301ed671c9af9ab13
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Rebecca Schultz Zavin [Mon, 7 May 2012 23:06:32 +0000 (16:06 -0700)]
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>
Rebecca Schultz Zavin [Fri, 27 Apr 2012 03:44:10 +0000 (20:44 -0700)]
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>
Rebecca Schultz Zavin [Mon, 30 Apr 2012 23:45:38 +0000 (16:45 -0700)]
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>
Rebecca Schultz Zavin [Wed, 1 Feb 2012 19:09:46 +0000 (11:09 -0800)]
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>
KyongHo Cho [Wed, 7 Sep 2011 02:27:07 +0000 (11:27 +0900)]
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>
Rebecca Schultz Zavin [Tue, 31 Jan 2012 17:40:30 +0000 (09:40 -0800)]
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>
Rebecca Schultz Zavin [Mon, 30 Jan 2012 22:18:08 +0000 (14:18 -0800)]
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>
Benoit Goby [Wed, 16 May 2012 03:44:33 +0000 (20:44 -0700)]
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>
Colin Cross [Thu, 17 May 2012 22:24:16 +0000 (15:24 -0700)]
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>
Benoit Goby [Thu, 10 May 2012 23:41:40 +0000 (16:41 -0700)]
usb: otg: otg-wakelock: Fix build for 3.4
Change-Id: I97e21e9e6645bf18522675039e512f85fe836794
Signed-off-by: Benoit Goby <benoit@android.com>