firefly-linux-kernel-4.4.55.git
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>
11 years agocpufreq: interactive: fixup trace of string params
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>
11 years agocpufreq: interactive: restart above_hispeed_delay at each hispeed load
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>
11 years agogpu: ion: Allocate the sg_table at creation time rather than dynamically
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>
11 years agogpu: ion: support begin/end and kmap/kunmap dma_buf ops
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>
11 years agogpu: ion: Use alloc_pages instead of vmalloc from the system heap
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>
11 years agoion: Switch ion to use dma-buf
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>
11 years agogpu: ion: several bugfixes and enhancements of ION
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>
11 years agoion: Add reserve function to ion
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>
11 years agoion: Switch map/unmap dma api to sg_tables
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>
11 years agousb: gadget: composite: Fix corruption when changing configuration
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>
11 years agodebug: add parameters to prevent entering debug mode on errors
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>
11 years agousb: otg: otg-wakelock: Fix build for 3.4
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>
11 years agotrace: power: add trace_clock_set_parent
Colin Cross [Wed, 9 May 2012 23:09:50 +0000 (16:09 -0700)]
trace: power: add trace_clock_set_parent

Adds a new trace event to be called from clk_set_parent.  Some
cpufreq drivers, including Tegra, reparent the cpu clock to a
slower clock while the main pll is relocking, tracing
clk_set_parent allows traces to show how for long the cpu is
running slower.

Uses a separate TRACE_EVENT instead of the clock event class to
allow the event to contain string names for the child and the
parent.

Signed-off-by: Colin Cross <ccross@android.com>
11 years agonetfilter: xt_qtaguid: start tracking iface rx/tx at low level
JP Abgrall [Fri, 27 Apr 2012 19:57:39 +0000 (12:57 -0700)]
netfilter: xt_qtaguid: start tracking iface rx/tx at low level

qtaguid tracks the device stats by monitoring when it goes up and down,
then it gets the dev_stats().
But devs don't correctly report stats (either they don't count headers
symmetrically between rx/tx, or they count internal control messages).

Now qtaguid counts the rx/tx bytes/packets during raw:prerouting and
mangle:postrouting (nat is not available in ipv6).

The results are in
  /proc/net/xt_qtaguid/iface_stat_fmt
which outputs a format line (bash expansion):
  ifname  total_skb_{rx,tx}_{bytes,packets}

Added event counters for pre/post handling.
Added extra ctrl_*() pid/uid debugging.

Change-Id: Id84345d544ad1dd5f63e3842cab229e71d339297
Signed-off-by: JP Abgrall <jpa@google.com>
11 years agonetfilter: xt_IDLETIMER: Add new netlink msg type
JP Abgrall [Fri, 27 Apr 2012 06:28:35 +0000 (23:28 -0700)]
netfilter: xt_IDLETIMER: Add new netlink msg type

Send notifications when the label becomes active after an idle period.
Send netlink message notifications in addition to sysfs notifications.
Using a uevent with
  subsystem=xt_idletimer
  INTERFACE=...
  STATE={active,inactive}

This is backport from common android-3.0
commit: beb914e987cbbd368988d2b94a6661cb907c4d5a
with uevent support instead of a new netlink message type.

Change-Id: I31677ef00c94b5f82c8457e5bf9e5e584c23c523
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
Signed-off-by: JP Abgrall <jpa@google.com>
11 years agoInclude if_pppolac.h and if_pppopns.h into header-y target
Andrey Konovalov [Fri, 23 Mar 2012 17:48:02 +0000 (21:48 +0400)]
Include if_pppolac.h and if_pppopns.h into header-y target

This is required to pass the headers_check

Change-Id: Ic4c773973278cbdf1cb4eb66473826cb96ccbfb3
Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
11 years agosecurity: Add proper checks for Android specific capability checks
Tushar Behera [Mon, 26 Mar 2012 11:24:15 +0000 (16:54 +0530)]
security: Add proper checks for Android specific capability checks

Commit b641072 ("security: Add AID_NET_RAW and AID_NET_ADMIN capability
check in cap_capable().") introduces additional checks for AID_NET_xxx
macros. Since the header file including those macros are conditionally
included, the checks should also be conditionally executed.

Change-Id: Iaec5208d5b95a46b1ac3f2db8449c661e803fa5b
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
11 years agocpufreq-interactive: Compile fixup
John Stultz [Tue, 1 May 2012 21:10:31 +0000 (14:10 -0700)]
cpufreq-interactive: Compile fixup

Looks like AOSP has a compile bug. Fix it up.

Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agocpufreq: interactive: add boost pulse interface
Todd Poynor [Thu, 3 May 2012 07:16:55 +0000 (00:16 -0700)]
cpufreq: interactive: add boost pulse interface

Change-Id: Icf1e86d2065cc8f0816ba9c6b065eb056d4e8249
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: set floor for boosted speed
Todd Poynor [Fri, 27 Apr 2012 04:41:40 +0000 (21:41 -0700)]
cpufreq: interactive: set floor for boosted speed

Allow speed to drop to flooor frequency but not below, don't pin
to speed at last boost.

Change-Id: I0147c2b7a2e61ba16820605af6baaf09570be787
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: Add sysfs boost interface for hints from userspace
Todd Poynor [Tue, 24 Apr 2012 03:42:41 +0000 (20:42 -0700)]
cpufreq: interactive: Add sysfs boost interface for hints from userspace

The explicit hint on/off version.

Change-Id: Ibf62b6d45bf6fb8c9c055b9bdaf074ce9374c04f
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: remove unused target_validate_time_in_idle
Todd Poynor [Tue, 24 Apr 2012 04:22:45 +0000 (21:22 -0700)]
cpufreq: interactive: remove unused target_validate_time_in_idle

Change-Id: I37c5085b91318242612440dfd775ad762996612f
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: Boost frequency on touchscreen input
Todd Poynor [Tue, 3 Apr 2012 00:17:14 +0000 (17:17 -0700)]
cpufreq: interactive: Boost frequency on touchscreen input

Based on previous patches by Tero Kristo <tero.kristo@nokia.com>,
Brian Steuer <bsteuer@codeaurora.org>,
David Ng <dave@codeaurora.org>,
Antti P Miettinen <amiettinen@nvidia.com>, and
Thomas Renninger <trenn@suse.de>

Change-Id: Ic55fedcf6f9310f43a7022fb88e23b0392122769
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: Separate speed target revalidate time and initial set time
Todd Poynor [Fri, 20 Apr 2012 20:18:32 +0000 (13:18 -0700)]
cpufreq: interactive: Separate speed target revalidate time and initial set time

Allow speed drop after min_sample_time elapses from last time
the current speed was last re-validated as appropriate for
current load / input boost.

Allow speed bump after min_sample_time (or above_hispeed_delay)
elapses from the time the current speed was originally set.

Change-Id: Ic25687a7a53d25e6544c30c47d7ab6f27a47bee8
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: base hispeed bump on target freq, not actual
Todd Poynor [Thu, 19 Apr 2012 19:52:48 +0000 (12:52 -0700)]
cpufreq: interactive: base hispeed bump on target freq, not actual

For systems that set a common speed for all CPUs, checking current
speed here could bypass the intermediate hispeed bump decision for
this CPU when another CPU was already at hispeed.  This could
result in an overly high setting (for all CPUs) in situations
where all CPUs were about to drop to load levels that map to
hispeed or below.

Change-Id: I186f23dcfc5e2b6336cab8b0327f0c8a9a4482bc
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: adjust code and documentation to match
Todd Poynor [Wed, 18 Apr 2012 00:39:34 +0000 (17:39 -0700)]
cpufreq: interactive: adjust code and documentation to match

Change-Id: If59c668d514a29febe5c35404fd9d01df8548eb1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: configurable delay before raising above hispeed
Todd Poynor [Sat, 14 Apr 2012 03:18:02 +0000 (20:18 -0700)]
cpufreq: interactive: configurable delay before raising above hispeed

Change-Id: I4d6ac40b23a3790d48e30c37408284e9f955e8fa
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: don't drop speed if recently at higher load
Todd Poynor [Sat, 7 Apr 2012 02:59:36 +0000 (19:59 -0700)]
cpufreq: interactive: don't drop speed if recently at higher load

Apply min_sample_time to the last time the current target speed
was originally requested or re-validated as appropriate for the
current load, not to the time since the current speed was
originally set.  Avoids periodic dips in speed during bursty
loads.

Change-Id: I250bda657985de60373f9897cc41f480664d51a1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: set at least hispeed when above hispeed load
Todd Poynor [Sat, 7 Apr 2012 02:50:12 +0000 (19:50 -0700)]
cpufreq: interactive: set at least hispeed when above hispeed load

If load is above go_hispeed_load, always go to at least hispeed_freq,
even when reducing speed from a higher speed, not just when jumping
up from minimum speed.  Avoids running at a lower than intended
speed after a burst of even higher load.

Change-Id: I5b9d2a15ba25ce609b21bac7c724265cf6838dee
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq: interactive: apply intermediate load to max speed not current
Todd Poynor [Fri, 6 Apr 2012 08:13:09 +0000 (01:13 -0700)]
cpufreq: interactive: apply intermediate load to max speed not current

Evaluate spikes in load (below go_hispeed_load) against the maximum
speed supported by the device, not the current speed (which tends to
make it too difficult to raise speed to intermediate levels until
very busy).

Change-Id: Ib937006abf8bedb60891a739acd733e89b732ae0
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agocpufreq interactive governor: event tracing
Todd Poynor [Fri, 17 Feb 2012 00:27:59 +0000 (16:27 -0800)]
cpufreq interactive governor: event tracing

Change-Id: Ic13614a3da2faa2d4bd215ca3eb7191614f0cf66
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agonetfilter: xt_qtaguid: fix ipv6 protocol lookup
JP Abgrall [Tue, 17 Apr 2012 23:00:07 +0000 (16:00 -0700)]
netfilter: xt_qtaguid: fix ipv6 protocol lookup

When updating the stats for a given uid it would incorrectly assume
IPV4 and pick up the wrong protocol when IPV6.

Change-Id: Iea4a635012b4123bf7aa93809011b7b2040bb3d5
Signed-off-by: JP Abgrall <jpa@google.com>
11 years agonetfilter: qtaguid: initialize a local var to keep compiler happy.
JP Abgrall [Sat, 14 Apr 2012 02:22:35 +0000 (19:22 -0700)]
netfilter: qtaguid: initialize a local var to keep compiler happy.

There was a case that might have seemed like new_tag_stat was not
initialized and actually used.
Added comment explaining why it was impossible, and a BUG()
in case the logic gets changed.

Change-Id: I1eddd1b6f754c08a3bf89f7e9427e5dce1dfb081
Signed-off-by: JP Abgrall <jpa@google.com>
11 years agoARM: etm: Add sysfs entry to enable return stack if supported
Arve Hjønnevåg [Wed, 4 Apr 2012 01:01:03 +0000 (18:01 -0700)]
ARM: etm: Add sysfs entry to enable return stack if supported

Change-Id: Icb73d60324ad0ddfc3e8a450a28bb3d90c702788
Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: etm: Add sysfs entry to disable branch_output flag
Arve Hjønnevåg [Tue, 3 Apr 2012 23:15:36 +0000 (16:15 -0700)]
ARM: etm: Add sysfs entry to disable branch_output flag

Change-Id: Ib91208a2c33621aa2d7bd9aa72bfbc670d9d5f1d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: etm: Add sysfs entry to set context-id-size
Arve Hjønnevåg [Tue, 3 Apr 2012 00:20:32 +0000 (17:20 -0700)]
ARM: etm: Add sysfs entry to set context-id-size

Change-Id: I520dfb6e593dac131de8b9b1db77f1c734f18c24
Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: etm: Add sysfs entry to enable timestamps if supported
Arve Hjønnevåg [Tue, 3 Apr 2012 00:20:32 +0000 (17:20 -0700)]
ARM: etm: Add sysfs entry to enable timestamps if supported

Change-Id: Iff964ba2f6236ed81863e02ec7b3ec9fbc48044a
Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: etm: Check arch version and disable data tracing for ptm
Arve Hjønnevåg [Tue, 3 Apr 2012 03:18:56 +0000 (20:18 -0700)]
ARM: etm: Check arch version and disable data tracing for ptm

Change-Id: If2cb7928d0711f48348443d882a12416be9c5910
Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: etm: Wait for etm/ptm(s) to stop before requesting PowerDown
Arve Hjønnevåg [Thu, 29 Mar 2012 04:03:13 +0000 (21:03 -0700)]
ARM: etm: Wait for etm/ptm(s) to stop before requesting PowerDown

When PowerDown was requested at the same time as ProgBit, the
formatter flush command that follows could get stuck.

Change-Id: Iafb665f61f055819e64ca1dcb60398c656f593e4
Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agogpu: ion: ion_carveout_heap: fix for 3.4
Colin Cross [Wed, 4 Apr 2012 20:50:43 +0000 (13:50 -0700)]
gpu: ion: ion_carveout_heap: fix for 3.4

__arch_ioremap is no longer available, use __arm_ioremap instead.

Change-Id: Ied98208a3c1be6bc5ac195c3ade496fbb5003f37
Signed-off-by: Colin Cross <ccross@android.com>
11 years agousb: gadget: adb: Only enable the gadget when adbd is ready
Benoit Goby [Tue, 20 Mar 2012 01:56:52 +0000 (18:56 -0700)]
usb: gadget: adb: Only enable the gadget when adbd is ready

When adb is enabled, only connect the gadget when adbd is ready. If adbd
dies or is restarted (e.g. "adb root"), the gadget is disconnected when
the adb device is close, and it is re-connected once adb re-open the
device.

- Add callbacks to adb, similar to FunctionFs callbacks, to notify the
  gadget when the daemon is ready or closed.
- Refcount calls to android_enable/android_disable to enable the gadget
  only once all the function daemons are ready.
- Add enable/disble to android_usb_function to notify the function when
  it is added/removed from the list of enabled functions.

Change-Id: Id54ff85aec9cf8715c94b4f9bd6137a79ad58bfc
Signed-off-by: Benoit Goby <benoit@android.com>
11 years agoARM: fiq_debugger: fix multiple consoles and make it a preferred console
Colin Cross [Sun, 18 Mar 2012 22:25:55 +0000 (15:25 -0700)]
ARM: fiq_debugger: fix multiple consoles and make it a preferred console

Fix setting up consoles on multiple fiq debugger devices by
splitting the tty driver init into the initcall, and initializing
the single tty device during probe.  Has the side effect of moving
the tty device node to /dev/ttyFIQx, where x is the platform device
id, which should normally match the serial port.

To avoid having to pass a different console=/dev/ttyFIQx for every
device, make the fiq debugger a preferred console that will be used
by default if no console was passed on the command line.

Change-Id: I6cc2670628a41e84615859bc96adba189966d647
Signed-off-by: Colin Cross <ccross@android.com>
11 years agokdb: support new lines without carriage returns
Colin Cross [Thu, 15 Mar 2012 02:26:53 +0000 (19:26 -0700)]
kdb: support new lines without carriage returns

kdb expects carriage returns through the serial port to terminate
commands.  Modify it to accept the first seen carriage return or
new line as a terminator, but not treat \r\n as two terminators.

Change-Id: I06166017e7703d24310eefcb71c3a7d427088db7
Signed-off-by: Colin Cross <ccross@android.com>
11 years agoARM: fiq_debugger: add support for kgdb
Colin Cross [Thu, 15 Mar 2012 02:23:29 +0000 (19:23 -0700)]
ARM: fiq_debugger: add support for kgdb

Adds polling tty ops to the fiq debugger console tty, which allows
kgdb to run against an fiq debugger console.

Add a check in do_sysrq to prevent enabling kgdb from the fiq
debugger unless a flag (writable only by root) has been set. This
should make it safe to enable KGDB on a production device.

Also add a shortcut to enable the console and kgdb together, to
allow kgdb to be enabled when the shell on the console is not
responding.

Change-Id: Ifc65239ca96c9887431a6a36b9b44a539002f544
Signed-off-by: Colin Cross <ccross@android.com>
11 years agoARM: fiq_debugger: add debug_putc
Colin Cross [Thu, 15 Mar 2012 19:57:20 +0000 (12:57 -0700)]
ARM: fiq_debugger: add debug_putc

Convert all the calls to state->pdata->uart_putc to a debug_putc
helper.

Change-Id: Idc007bd170ff1b51d0325e238105ae0c86d23777
Signed-off-by: Colin Cross <ccross@android.com>
11 years agoARM: fiq_debugger: add support for reboot commands
Colin Cross [Wed, 14 Mar 2012 23:29:47 +0000 (16:29 -0700)]
ARM: fiq_debugger: add support for reboot commands

Pass the rest of the reboot command to kernel_restart to allow
reboot bootloader to work from FIQ debugger.

Change-Id: I4e7b366a69268dda17ffcf4c84f2373d15cb1271
Signed-off-by: Colin Cross <ccross@android.com>
11 years agoARM: fiq_debugger: fix compiling for v3.3
Colin Cross [Wed, 14 Mar 2012 23:28:45 +0000 (16:28 -0700)]
ARM: fiq_debugger: fix compiling for v3.3

Call kernel_restart instead of arch_reset, the ARM reset handling
has changed.

Remove localtimer irq printing, they now show up in the regular
irq stats.

Change-Id: I523da343b292c5711f3e1cbfd766d32eea2da84e
Signed-off-by: Colin Cross <ccross@android.com>
11 years agousb: gadget: adb: do not set error flag when dequeuing req
Colin Cross [Fri, 9 Mar 2012 01:57:51 +0000 (17:57 -0800)]
usb: gadget: adb: do not set error flag when dequeuing req

When an ep_out req is dequeued because of userspace freezing,
don't set the error flag.

Change-Id: I680f1a1059b8ac2244aaa069e7d42dc44abf98e9
Signed-off-by: Colin Cross <ccross@android.com>
11 years agousb: gadget: adb: allow freezing in adb_read
Colin Cross [Mon, 5 Mar 2012 21:29:45 +0000 (13:29 -0800)]
usb: gadget: adb: allow freezing in adb_read

wait_event_interruptible in adb_read might return -ERESTARTSYS if
userspace is frozen during adb_read or another signal is delivered
to adb.  If so, don't set dev->error to avoid resetting the adb
connection.

Change-Id: I5a7baa013a9a3a3b5305de7e6a0d18546a560018
Signed-off-by: Colin Cross <ccross@android.com>
11 years agousb: gadget: accessory: Add Android Accessory function
Benoit Goby [Mon, 19 Dec 2011 22:39:37 +0000 (14:39 -0800)]
usb: gadget: accessory: Add Android Accessory function

USB accessory mode allows users to connect USB host hardware
specifically designed for Android-powered devices. The accessories
must adhere to the Android accessory protocol outlined in the
http://accessories.android.com documentation. This allows
Android devices that cannot act as a USB host to still interact with
USB hardware. When an Android device is in USB accessory mode, the
attached Android USB accessory acts as the host, provides power
to the USB bus, and enumerates connected devices.

Signed-off-by: Mike Lockwood <lockwood@android.com>
11 years agousb: gadget: adb: Add ADB function
Benoit Goby [Mon, 19 Dec 2011 22:38:41 +0000 (14:38 -0800)]
usb: gadget: adb: Add ADB function

Android Debug Bridge (adb) is a command line tool that lets
users communicate with a Android-powered device. It is used
mainly to debug applications and tranfer files. f_adb implements
the transport layer between the ADB Server (on the host) and the
ADBD daemon (on the device).

Signed-off-by: Mike Lockwood <lockwood@android.com>
11 years agousb: gadget: mtp: Add MTP/PTP function
Benoit Goby [Mon, 19 Dec 2011 22:37:50 +0000 (14:37 -0800)]
usb: gadget: mtp: Add MTP/PTP function

USB gadget function driver used by the Android framework to
implement the MTP and PTP protocols. It creates a character device
that provides an interface for fast transfer of files and
supports transferring files greater than 4GB.

Signed-off-by: Mike Lockwood <lockwood@android.com>
11 years agousb: gadget: Add Android Composite Gadget driver
Benoit Goby [Mon, 12 Dec 2011 21:01:23 +0000 (13:01 -0800)]
usb: gadget: Add Android Composite Gadget driver

The Android Gadget driver is a composite driver that allows
userspace to change at runtime the list of functions enabled in
its configuration and to configure these functions. It supports
multiple functions: acm, adb, rndis, mtp/ptp, mass storage and
accessory.

It is usually controlled by a daemon that changes the configuration
based on user settings. For example, rndis is enabled when the user
enables sharing the phone data connection and adb (Android Debug
Bridge) is only enabled when the user wants to debug applications
for security reasons.

As an example on how to use it, the following shell commands will
make the gadget disconnect from the host and make it be re-enumerated
as a composite with 1 rndis and 2 acm interfaces, and a different
product id:

echo 0       > /sys/class/android_usb/android0/enable
echo rndis,acm > /sys/class/android_usb/android0/functions
echo 2       > /sys/class/android_usb/android0/f_acm/instances
echo 2d01    > /sys/class/android_usb/android0/idProduct
echo 1       > /sys/class/android_usb/android0/enable

The driver requires a gadget controller that supports software
control of the D+ pullup and the controller driver must support
disabling the pullup during composite_bind.

Signed-off-by: Mike Lockwood <lockwood@android.com>
Signed-off-by: Benoit Goby <benoit@android.com>
11 years agousb: otg: otg-wakelock: fix build for 3.3
Colin Cross [Wed, 1 Feb 2012 22:23:15 +0000 (14:23 -0800)]
usb: otg: otg-wakelock: fix build for 3.3

Add missing module.h include

Change-Id: Ib0538ca569c9e0713ceefcd1f91c6bc089d2f2ba
Signed-off-by: Colin Cross <ccross@android.com>
11 years agousb: otg: Temporarily grab wakelock on charger and disconnect events
Todd Poynor [Tue, 27 Sep 2011 03:35:30 +0000 (20:35 -0700)]
usb: otg: Temporarily grab wakelock on charger and disconnect events

Change-Id: If995d4af4adcb08e8369009483f2956ad9627267
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agoHID: Add input_register callback.
Jaikumar Ganesh [Tue, 20 Sep 2011 23:40:43 +0000 (16:40 -0700)]
HID: Add input_register callback.

Add input_register callback which gets called after
hid_configure_usage is called for all the reports
and before the input device is registered. This allows
individual drivers to do extra work like input mapping just
before device registration.

Based on discussions with David Herrmann <dh.herrmann@googlemail.com>

Change-Id: Idab6fb4f7b1e5e569bd0410967288717e9d34c98
Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
Changed to add return code to input_configured instead of
adding input_register

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agofuse: Freeze client on suspend when request sent to userspace
Todd Poynor [Wed, 24 Aug 2011 22:01:30 +0000 (15:01 -0700)]
fuse: Freeze client on suspend when request sent to userspace

Suspend attempts can abort when the FUSE daemon is already frozen
and a client is waiting uninterruptibly for a response, causing
freezing of tasks to fail.

Use the freeze-friendly wait API, but disregard other signals.

Change-Id: Icefb7e4bbc718ccb76bf3c04daaa5eeea7e0e63c
Signed-off-by: Todd Poynor <toddpoynor@google.com>
11 years agohid-multitouch: Filter collections by application usage.
Jeff Brown [Sun, 24 Jul 2011 21:31:14 +0000 (14:31 -0700)]
hid-multitouch: Filter collections by application usage.

This change fixes two problems.

First, it ensures that the hid-multitouch driver does not incorrectly
map GenericDesktop usages that are intended for other applications,
such as a Mouse.

Second, it sets the appropriate input properties so that user-space
can distinguish TouchScreen devices (INPUT_PROP_DIRECT) from
TouchPad devices (INPUT_PROP_POINTER) and configure them accordingly.

Change-Id: I8c2d947929186ffe7cf04b37c76e29b9abecf8cb
Signed-off-by: jeffbrown@android.com
11 years agonet: Only NET_ADMIN is allowed to fully control TUN interfaces.
Chia-chi Yeh [Fri, 15 Jul 2011 22:32:57 +0000 (15:32 -0700)]
net: Only NET_ADMIN is allowed to fully control TUN interfaces.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
11 years agobridge: Have tx_bytes count headers like rx_bytes.
Ashish Sharma [Sat, 8 Oct 2011 00:54:16 +0000 (17:54 -0700)]
bridge: Have tx_bytes count headers like rx_bytes.

Since rx_bytes accounting does not include Ethernet Headers in
br_input.c, excluding ETH_HLEN on the transmit path for consistent
measurement of packet length on both the Tx and Rx chains.

The clean way would be for Rx to include the eth header, but the
skb len has already been adjusted by the time the br code sees the skb.
This is only a temporary workaround until we can completely ignore or
cleanly fix the skb->len handling.

Change-Id: I910de95a4686b2119da7f1f326e2154ef31f9972
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
11 years agonetfilter: ipv6: fix crash caused by ipv6_find_hdr()
JP Abgrall [Thu, 29 Sep 2011 22:36:49 +0000 (15:36 -0700)]
netfilter: ipv6: fix crash caused by ipv6_find_hdr()

When calling:
    ipv6_find_hdr(skb, &thoff, -1, NULL)
on a fragmented packet, thoff would be left with a random
value causing callers to read random memory offsets with:
    skb_header_pointer(skb, thoff, ...)

Now we force ipv6_find_hdr() to return a failure in this case.
Calling:
  ipv6_find_hdr(skb, &thoff, -1, &fragoff)
will set fragoff as expected, and not return a failure.

Change-Id: Ib474e8a4267dd2b300feca325811330329684a88
Signed-off-by: JP Abgrall <jpa@google.com>
11 years agonetfilter: fixup the quota2, and enable.
JP Abgrall [Tue, 12 Jul 2011 19:02:59 +0000 (12:02 -0700)]
netfilter: fixup the quota2, and enable.

The xt_quota2 came from
  http://sourceforge.net/projects/xtables-addons/develop

It needed tweaking for it to compile within the kernel tree.
Fixed kmalloc() and create_proc_entry() invocations within
 a non-interruptible context.
Removed useless copying of current quota back to the iptable's
struct matchinfo:
  - those are per CPU: they will change randomly based on which
    cpu gets to update the value.
  - they prevent matching a rule: e.g.
      -A chain -m quota2 --name q1 --quota 123
     can't be followed by
      -D chain -m quota2 --name q1 --quota 123
    as the 123 will be compared to the struct matchinfo's quota member.
Use the NETLINK NETLINK_NFLOG family to log a single message
when the quota limit is reached.
It uses the same packet type as ipt_ULOG, but
 - never copies skb data,
 - uses 112 as the event number (ULOG's +1)
It doesn't log if the module param "event_num" is 0.

Change-Id: I021d3b743db3b22158cc49acb5c94d905b501492
Signed-off-by: JP Abgrall <jpa@google.com>