7 years agocgroup: Remove call to synchronize_rcu in cgroup_attach_task
Colin Cross [Wed, 24 Nov 2010 05:37:04 +0000]
cgroup: Remove call to synchronize_rcu in cgroup_attach_task

synchronize_rcu can be very expensive, averaging 100 ms in
some cases.  In cgroup_attach_task, it is used to prevent
a task->cgroups pointer dereferenced in an RCU read side
critical section from being invalidated, by delaying the
call to put_css_set until after an RCU grace period.

To avoid the call to synchronize_rcu, make the put_css_set
call rcu-safe by moving the deletion of the css_set links
into free_css_set_work, scheduled by the rcu callback
free_css_set_rcu.

The decrement of the cgroup refcount is no longer
synchronous with the call to put_css_set, which can result
in the cgroup refcount staying positive after the last call
to cgroup_attach_task returns.  To allow the cgroup to be
deleted with cgroup_rmdir synchronously after
cgroup_attach_task, have rmdir check the refcount of all
associated css_sets.  If cgroup_rmdir is called on a cgroup
for which the css_sets all have refcount zero but the
cgroup refcount is nonzero, reuse the rmdir waitqueue to
block the rmdir until free_css_set_work is called.

Signed-off-by: Colin Cross <ccross@android.com>

7 years agocgroup: Set CGRP_RELEASABLE when adding to a cgroup
Colin Cross [Wed, 24 Nov 2010 05:37:03 +0000]
cgroup: Set CGRP_RELEASABLE when adding to a cgroup

Changes the meaning of CGRP_RELEASABLE to be set on any cgroup
that has ever had a task or cgroup in it, or had css_get called
on it.  The bit is set in cgroup_attach_task, cgroup_create,
and __css_get.  It is not necessary to set the bit in
cgroup_fork, as the task is either in the root cgroup, in
which can never be released, or the task it was forked from
already set the bit in croup_attach_task.

Signed-off-by: Colin Cross <ccross@android.com>

7 years agoPM: Wait for completion of the parent resume before resuming
Benoit Goby [Mon, 13 Dec 2010 23:27:06 +0000]
PM: Wait for completion of the parent resume before resuming

If the parent device is in the DPM_RESUMING state, resume might get called
before the parent's resume has completed, because dpm_wait won't get
called. This issue was introduced by:
3d46a3c PM: Prevent waiting forever on asynchronous resume after abort

Wait for completion of the parent resume if the parent state is >= DPM_OFF
or == DPM_RESUMING

Signed-off-by: Benoit Goby <benoit@android.com>
[dima: fixed to work on 2.6.38, use .in_suspend instead of .state]
Signed-off-by: Dima Zavin <dima@android.com>

7 years agocpufreq interactive governor save/restore IRQs around cpumask spinlocks
Todd Poynor [Fri, 3 Dec 2010 19:20:09 +0000]
cpufreq interactive governor save/restore IRQs around cpumask spinlocks

Need to use irqsave/restore spin locking for cpumasks since these
are accessed in timers and in thread context.

Change-Id: I4a53eaf0ced7e73b445feddba90ec11482de9126
Signed-off-by: Todd Poynor <toddpoynor@google.com>

7 years agocpufreq: interactive: New 'interactive' governor
Mike Chan [Tue, 22 Jun 2010 18:26:45 +0000]
cpufreq: interactive: New 'interactive' governor

This governor is designed for latency-sensitive workloads, such as
interactive user interfaces.  The interactive governor aims to be
significantly more responsive to ramp CPU quickly up when CPU-intensive
activity begins.

Existing governors sample CPU load at a particular rate, typically
every X ms.  This can lead to under-powering UI threads for the period of
time during which the user begins interacting with a previously-idle system
until the next sample period happens.

The 'interactive' governor uses a different approach. Instead of sampling
the CPU at a specified rate, the governor will check whether to scale the
CPU frequency up soon after coming out of idle.  When the CPU comes out of
idle, a timer is configured to fire within 1-2 ticks.  If the CPU is very
busy from exiting idle to when the timer fires then we assume the CPU is
underpowered and ramp to MAX speed.

If the CPU was not sufficiently busy to immediately ramp to MAX speed, then
the governor evaluates the CPU load since the last speed adjustment,
choosing the highest value between that longer-term load or the short-term
load since idle exit to determine the CPU speed to ramp to.

A realtime thread is used for scaling up, giving the remaining tasks the
CPU performance benefit, unlike existing governors which are more likely to
schedule rampup work to occur after your performance starved tasks have
completed.

The tuneables for this governor are:
/sys/devices/system/cpu/cpufreq/interactive/min_sample_time:
The minimum amount of time to spend at the current frequency before
ramping down. This is to ensure that the governor has seen enough
historic CPU load data to determine the appropriate workload.
Default is 80000 uS.
/sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
The CPU load at which to ramp to max speed.  Default is 85.

Change-Id: Ib2b362607c62f7c56d35f44a9ef3280f98c17585
Signed-off-by: Mike Chan <mike@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Bug: 3152864

7 years agoARM: fiq_debugger: Add help command
Dmitry Shmidt [Tue, 16 Nov 2010 23:40:13 +0000]
ARM: fiq_debugger: Add help command

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years agomisc: kernel_debugger: Add help command
Dmitry Shmidt [Tue, 16 Nov 2010 23:39:43 +0000]
misc: kernel_debugger: Add help command

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years agoARM: fiq_debugger: make fiq_debugger be in debug mode by default
Dima Zavin [Wed, 10 Nov 2010 23:39:07 +0000]
ARM: fiq_debugger: make fiq_debugger be in debug mode by default

Adds a config option that controls whether or not the console is on at
boot, defaulting to no.

Change-Id: Id4a3cad1c9dd4fb3c2b8c2298ca5d385a8bd0f8d
Signed-off-by: Dima Zavin <dima@android.com>

7 years agosdhci: Always pass clock request value zero to set_clock host op
Todd Poynor [Mon, 11 Oct 2010 23:51:28 +0000]
sdhci: Always pass clock request value zero to set_clock host op

To allow the set_clock host op to disable the SDCLK source when not
needed, always call the host op when the requested clock speed is
zero.  Do this even if host->clock already equals zero, because
the SDHCI driver may set that value (without calling the host op)
to force an update at the next (non-zero-speed) call.

Change-Id: If99230d76138679b5767f77cb925f15408ae518e
Signed-off-by: Todd Poynor <toddpoynor@google.com>

7 years ago[ARM] fiq_debugger: Print local timer irqs count
Rebecca Schultz Zavin [Fri, 22 Oct 2010 22:55:17 +0000]
[ARM] fiq_debugger: Print local timer irqs count

Prints the number of local timer irqs on each cpu when
 the irqs command is executed.

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

7 years agostaging: remove Greg's TODO, now obsolete.
Brian Swetland [Thu, 21 Oct 2010 21:19:31 +0000]
staging: remove Greg's TODO, now obsolete.

Signed-off-by: Brian Swetland <swetland@google.com>

7 years agommc: Fix pm_notifier obeying deferred resume
Dmitry Shmidt [Thu, 14 Oct 2010 22:20:21 +0000]
mmc: Fix pm_notifier obeying deferred resume

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years agomisc: kernel_debugger: fix handle_sysrq call
Erik Gilling [Tue, 31 Aug 2010 01:16:30 +0000]
misc: kernel_debugger: fix handle_sysrq call

Change-Id: I58376b7de56751fd57a038fb8f908f36fe60dda1
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Author:    Erik Gilling <konkers@android.com>

7 years ago[ARM] fiq glue: Align fiq stacks
Colin Cross [Wed, 6 Oct 2010 05:08:01 +0000]
[ARM] fiq glue: Align fiq stacks

Change-Id: I956f05d0b0ce48572e611765e56a439dc036c052
Signed-off-by: Colin Cross <ccross@android.com>

7 years agommc: Add "ignore mmc pm notify" functionality
Dmitry Shmidt [Thu, 7 Oct 2010 21:39:16 +0000]
mmc: Add "ignore mmc pm notify" functionality

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years ago[ARM] fiq debugger: Allow selection of target cpu
Colin Cross [Sat, 2 Oct 2010 06:41:38 +0000]
[ARM] fiq debugger: Allow selection of target cpu

Change-Id: I676bac08ba12dfa506aea16800fc80432b4bc83d
Signed-off-by: Colin Cross <ccross@android.com>

7 years agommc: sdio: Fix enable_hs and enable_wide in sdio_reset_comm()
Dmitry Shmidt [Thu, 7 Oct 2010 00:25:02 +0000]
mmc: sdio: Fix enable_hs and enable_wide in sdio_reset_comm()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years agoARM: fiq debugger: Add tty to fiq debugger
Colin Cross [Mon, 16 Aug 2010 21:51:51 +0000]
ARM: fiq debugger: Add tty to fiq debugger

Change-Id: I80347cdb70cda104b96562c63f972c1f217e3822
Signed-off-by: Colin Cross <ccross@google.com>

7 years agoARM: Add generic fiq serial debugger
Iliyan Malchev [Sun, 6 Jun 2010 00:36:24 +0000]
ARM: Add generic fiq serial debugger

Change-Id: Ibb536c88f0dbaf4766d0599296907e35e42cbfd6
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agoARM: Add fiq_glue
Arve Hjønnevåg [Tue, 28 Sep 2010 00:50:00 +0000]
ARM: Add fiq_glue

Change-Id: I27d2554e07d9de204e0a06696d38db51608d9f6b
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Colin Cross <ccross@android.com>

7 years agoAllow CONFIG_STACKTRACE to be enabled by itself.
Arve Hjønnevåg [Thu, 3 Jun 2010 23:33:07 +0000]
Allow CONFIG_STACKTRACE to be enabled by itself.

This allows us to get a kernel stacktrace for a thread though /proc.
Also enable it by default.

Change-Id: If8c21cd02feaf9863f4841ace524fa30c7328d49
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agoSupport lseek(2) in ashmem driver
Bjorn Bringert [Thu, 26 Aug 2010 14:08:32 +0000]
Support lseek(2) in ashmem driver

Signed-off-by: Bjorn Bringert <bringert@android.com>
Change-Id: I509d18b21832e229737ea7ebaa231fb107eb61d7

7 years agommc: subtract boot sectors from disk size for eMMC 4.3+ devices
Gary King [Fri, 16 Jul 2010 00:11:32 +0000]
mmc: subtract boot sectors from disk size for eMMC 4.3+ devices

the csd sector count reported by eMMC 4.3+ cards includes the boot
partition size; subtract this from the size reported to the disk
since the boot partition is inaccessible

Change-Id: I601b83aa0159b7aa446409ea8c945b256dd0b5b1
Signed-off-by: Gary King <gking@nvidia.com>

7 years agommc_block: Allow more than 8 partitions per card
Colin Cross [Fri, 3 Sep 2010 19:41:21 +0000]
mmc_block: Allow more than 8 partitions per card

Set the GENHD_FL_EXT_DEVT flag, which will allocate minor numbers
in major 259 for partitions past disk->minors.

Also remove the use of disk_devt to determine devidx from md->disk.
md->disk->first_minor is always initialized from devidx and can
always be used to recover it.

Signed-off-by: Colin Cross <ccross@android.com>

7 years agoPM: Prevent waiting forever on asynchronous resume after abort
Colin Cross [Thu, 2 Sep 2010 01:35:55 +0000]
PM: Prevent waiting forever on asynchronous resume after abort

Only wait on a parent device during resume if the parent device is
suspended.

Consider three drivers, A, B, and C.  The parent of A is C, and C
has async_suspend set.  On boot, C->power.completion is initialized
to 0.

During the first suspend:
suspend_devices_and_enter(...)
 dpm_resume(...)
  device_suspend(A)
  device_suspend(B) returns error, aborts suspend
 dpm_resume_end(...)
   dpm_resume(...)
    device_resume(A)
     dpm_wait(A->parent == C)
      wait_for_completion(C->power.completion)

The wait_for_completion will never complete, because
complete_all(C->power.completion) will only be called from
device_suspend(C) or device_resume(C), neither of which is called
if suspend is aborted before C.

After a successful suspend->resume cycle, where B doesn't abort
suspend, C->power.completion is left in the completed state by the
call to device_resume(C), and the same call path will work if B
aborts suspend.

Signed-off-by: Colin Cross <ccross@android.com>

7 years agopower: wakelock: call __get_wall_to_monotonic() instead of using wall_to_monotonic
Erik Gilling [Tue, 31 Aug 2010 01:22:20 +0000]
power: wakelock: call __get_wall_to_monotonic() instead of using wall_to_monotonic

Change-Id: I9e9c3b923bf9a22ffd48f80a72050289496e57d8

7 years agonet: Fix CONFIG_RPS option to be turned off
Dmitry Shmidt [Mon, 30 Aug 2010 17:29:37 +0000]
net: Fix CONFIG_RPS option to be turned off

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years agowakelock: Fix operator precedence bug
Colin Cross [Sun, 22 Aug 2010 00:27:02 +0000]
wakelock: Fix operator precedence bug

Change-Id: I21366ace371d1b8f4684ddbe4ea8d555a926ac21
Signed-off-by: Colin Cross <ccross@google.com>

7 years agoashmem: Update arguments of shrinker for 2.6.35
Colin Cross [Sun, 22 Aug 2010 00:26:52 +0000]
ashmem: Update arguments of shrinker for 2.6.35

Change-Id: Ie527d18f3352ede06d565826c8d35ded1638203a
Signed-off-by: Colin Cross <ccross@google.com>

7 years agolowmemorykiller: Update arguments of shrinker for 2.6.35
Colin Cross [Sun, 22 Aug 2010 00:25:42 +0000]
lowmemorykiller: Update arguments of shrinker for 2.6.35

Change-Id: I6bb09b36639527f91c48704118acad5e50c4163f
Signed-off-by: Colin Cross <ccross@google.com>

7 years agoUSB: g_mass_storage: Always allow disabling mass storage by writing to lun file
Mike Lockwood [Thu, 29 Jul 2010 18:42:24 +0000]
USB: g_mass_storage: Always allow disabling mass storage by writing to lun file

For android builds we disable the check for curlun->prevent_medium_removal.
Instead we let the framework manage unmounting policy, as we sometimes need
to unmount after the media has been removed.
This also helps support hosts that do not inform the device when the media
has been unmounted.

Signed-off-by: Mike Lockwood <lockwood@android.com>

7 years agoinput: gpio_event: make driver be more robust against incorrectly configured lvl...
Dima Zavin [Sat, 10 Apr 2010 06:26:09 +0000]
input: gpio_event: make driver be more robust against incorrectly configured lvl trigger irqs

Change-Id: Ie378600668500dcffeaaddeaba3628e5c2141aa4
Signed-off-by: Dima Zavin <dima@android.com>

7 years agoInput: gpio_event: Don't call gpio_cansleep before gpio_request.
Arve Hjønnevåg [Fri, 2 Apr 2010 02:52:27 +0000]
Input: gpio_event: Don't call gpio_cansleep before gpio_request.

If the gpio did not exist it would crash in gpiolib.

Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agoashmem: Fix ASHMEM_SET_PROT_MASK.
Arve Hjønnevåg [Thu, 15 Jul 2010 23:31:16 +0000]
ashmem: Fix ASHMEM_SET_PROT_MASK.

Change-Id: I1412cc9560de8c4feb1162fc30922f0e3362a476
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agoscheduler: cpuacct: Enable platform callbacks for cpuacct power tracking
Mike Chan [Wed, 12 May 2010 22:52:14 +0000]
scheduler: cpuacct: Enable platform callbacks for cpuacct power tracking

Platform must register cpu power function that return power in
milliWatt seconds.

Change-Id: I1caa0335e316c352eee3b1ddf326fcd4942bcbe8
Signed-off-by: Mike Chan <mike@android.com>

7 years agoscheduler: cpuacct: Enable platform hooks to track cpuusage for CPU frequencies
Mike Chan [Tue, 11 May 2010 00:54:48 +0000]
scheduler: cpuacct: Enable platform hooks to track cpuusage for CPU frequencies

Introduce new platform callback hooks for cpuacct for tracking CPU frequencies

Not all platforms / architectures have a set CPU_FREQ_TABLE defined
for CPU transition speeds. In order to track time spent in at various
CPU frequencies, we enable platform callbacks from cpuacct for this accounting.

Architectures that support overclock boosting, or don't have pre-defined
frequency tables can implement their own bucketing system that makes sense
given their cpufreq scaling abilities.

New file:
cpuacct.cpufreq reports the CPU time (in nanoseconds) spent at each CPU
frequency.

Change-Id: I10a80b3162e6fff3a8a2f74dd6bb37e88b12ba96
Signed-off-by: Mike Chan <mike@android.com>

7 years agomisc: add akm8975 compass driver
Colin Cross [Wed, 21 Apr 2010 02:54:09 +0000]
misc: add akm8975 compass driver

Originally written by HTC. Contributions by Motorola and AKM.
  misc: Import akm8975 from Motorola

Major style and code cleanups by Praveen Bharathi <pbharathi@motorola.com>
  misc: akm8975: clean up code violations in akm8975.c
  misc: akm8975: Clean up coding style, add suspend and resume

Change-Id: I4196913f15aec2dfbed47506d3dc085aada8e92d
Signed-off-by: Dima Zavin <dima@android.com>

7 years agodrivers: input: misc: Fix section mismatch warning
Dmitry Shmidt [Fri, 2 Jul 2010 19:48:48 +0000]
drivers: input: misc: Fix section mismatch warning

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years agoImplement read(2) in ashmem driver
Bjorn Bringert [Thu, 15 Apr 2010 09:04:01 +0000]
Implement read(2) in ashmem driver

Bug: 2595601
Change-Id: I47c0016f594f9354fb8658ccb26e3d395bcb137b
Signed-off-by: Bjorn Bringert <bringert@android.com>

7 years agonet: wireless: bcm4329: convert sempahore mutexes to real mutexes
Dima Zavin [Thu, 6 Jan 2011 00:04:43 +0000]
net: wireless: bcm4329: convert sempahore mutexes to real mutexes

Change-Id: I1cf1b0bfc2167d1be535d5066951796a569788e5
Signed-off-by: Dima Zavin <dima@android.com>

7 years agonetwork: wireless: bcm4329: Add bcm4329 driver
Dmitry Shmidt [Thu, 20 May 2010 01:53:11 +0000]
network: wireless: bcm4329: Add bcm4329 driver

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Add "HANG" event and console monitoring

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Remove unnecessary set_freezable() calls

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Update to Version 4.218.238

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Fix MAC address import

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Fix wlan card removal

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Update to Version 4.218.239
    Add reading mac address from platform data
    Add dhd_os_proto_block protection for dhd_preinit_ioctls
    Revert dhdsdio_clk() changes

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Add SoftAP MAC address randomization

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Add 2.6.35 compatibility and fix memory leak in set_multicast_list

Signed-off-by: Dmitry Shmidt <dimitrysh@android.com>
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Reduce driver loading time

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Set special OUI: 02:1A:11:FH:HH:HH for SoftAP

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Fix BUS DOWN in IOCTL

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

network: wireless: bcm4329: Add driver SETSUSPEND command

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix packet filter to only filter out non-unicast frames

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Add wakelock processing in ioctl and messaging

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to 4.218.245 (combo scan)

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to Version 4.218.246 and setband fix

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Add wakelock processing to WEXT requests

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Force scan when driver is loaded

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix scan timeout for abg case

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix dhd_bus_watchdog() race conditions

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix unregister_early_suspend() in dhd_detach()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Add memory barriers to wait functions

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix "setsuspend" behavior

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Increase PMU_MAX_TRANSITION_DLY to 1 sec

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Turn OFF packet filtering during DHCP session

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Disable packet filtering

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Send "HANG" message only once

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to Version 4.218.248

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix HW_OOB interrupt processing

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix interrupt enabling for level interrupt

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

Revert "net: wireless: bcm4329: Fix interrupt enabling for level interrupt"

This reverts commit 261d21bbfffef6261696d0d13672d2e4f9d76f05.

Revert "net: wireless: bcm4329: Fix HW_OOB interrupt processing"

This reverts commit 8bd035daa820dc5612ae311262c71dc133871046.

net: wireless: bcm4329: Fix HW_OOB interrupt processing

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix roaming failure case

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix roaming setting on resume

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Add debug print for cscan failure

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Ignore error if scan results are empty

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Enable packet filtering during low power mode

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to Version 4.218.248.6

Fix watchdog time rescheduling, fix first scan no-return

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix interrupt enabling in case of error

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix setting HT clock race conditions

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix setting HT clock race conditions in driver start

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to Version 4.218.248-10

Add KEEP_ALIVE feature, fix 'driver rssi' processing, fix roaming processing

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Improve BT-coex for eSCO

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix race conditions for sysioc_thread

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to version 4.218.248-11

Check for 'driver start' failure, Set keep-alive feature forever

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Check for out of bounds in scan results parsing

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Add check for out of bounds scan buffer

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to version 4.218.248-12

 - Fix crash during Specific Scan handling
 - Fix potential insmod crash by increase Registration Timeout to 12 sec
 - Added max time restriction to PNO scan timer
 - New IWPRIV "AP_STA_DISASSOC" to disassoc STAs in SoftAP mode
 - Add new setting to SoftAP "AP_SET_CFG" to enable Hidden SSID
 - Fixs bugs for SoftAP AP_SET_MAC_FLTR iwpriv commnd
 - Add STAs rssi filed to SoftAP "AP_GET_STA_LIST" IWPRIV commnd

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix watchdog termination after 'driver stop'

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Enable KEEP_ALIVE feature

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Add FW Reload event processing

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix Softap start/stop race conditions

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Set first channel passive scan to 30 ms

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to Version 4.218.248-15

- Increase default Listen Interval to 20 Beacons
- Add logic to adjust SKIP_DTIM if Listen Interval < DTIM * DTIM_SKIP to
  avoid data lost due to fact that packet maybe not retrieved during Listen
  Interval and AP may toss it
- Fix problem with Hidden AP setting after AP reconfigure
- Add new SoftAP optional parameter as COUNTRY to pass country code to SoftAP

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Improve way to detect BT SCO connection for BT-coex

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Use non-DFS channels only for US

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Add 'setdfschannels' command

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix watchdog syncronization during start/stop

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix driver 'start' retry ability

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Fix memory leak in case of dhd_bus_init() failure

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Add CONFIG_FIRST_SCAN option

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to Version 4.218.248-17

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net: wireless: bcm4329: Update to version 4.218.248-18

- Improve BT-coex to differentiate HID and SCO device during DHCP session
- Enforce DTIM=1 for any SoftAP settings to optimize internal memory logic

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years agonetwork: wireless: Add get_mac_addr functionality to platform
Dmitry Shmidt [Thu, 3 Jun 2010 17:55:33 +0000]
network: wireless: Add get_mac_addr functionality to platform

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years agonet: activity_stats: Add statistics for network transmission activity
Mike Chan [Fri, 28 May 2010 21:32:19 +0000]
net: activity_stats: Add statistics for network transmission activity

When enabled, tracks the frequency of network transmissions
(inbound and outbound) and buckets them accordingly.
Buckets are determined by time between network activity.

Each bucket represents the number of network transmisions that were
N sec or longer apart. Where N is defined as 1 << bucket index.

This network pattern tracking is particularly useful for wireless
networks (ie: 3G) where batching network activity closely together
is more power efficient than far apart.

New file: /proc/net/stat/activity

output:

Min Bucket(sec) Count
              1 7
              2 0
              4 1
              8 0
             16 0
             32 2
             64 1
            128 0

Change-Id: I4c4cd8627b872a55f326b1715c51bc3bdd6e8d92
Signed-off-by: Mike Chan <mike@android.com>

7 years agostaging: android: lowmemorykiller: Remove bitrotted codepath
San Mehat [Thu, 6 May 2010 22:43:46 +0000]
staging: android: lowmemorykiller: Remove bitrotted codepath

Now that we're murder-synchronous, this code path will never be
called (and if it does, it doesn't tell us anything useful other
than we killed a task that was already being killed by somebody
else but hadn't gotten its' signal yet)

Signed-off-by: San Mehat <san@google.com>

7 years agostaging: android: lowmemorykiller: Fix task_struct leak
San Mehat [Thu, 6 May 2010 22:40:07 +0000]
staging: android: lowmemorykiller: Fix task_struct leak

As it turns out, the CONFIG_PROFILING interfaces leak a
task struct if the notifier chain returns NOTIFY_OK.. doh.

This patch reworks lowmemkiller to use the new generic task
free notifier chain.

Signed-off-by: San Mehat <san@google.com>

7 years agosched: Add a generic notifier when a task struct is about to be freed
San Mehat [Thu, 6 May 2010 22:37:55 +0000]
sched: Add a generic notifier when a task struct is about to be freed

This patch adds a notifier which can be used by subsystems that may
be interested in when a task has completely died and is about to
have it's last resource freed.

  The Android lowmemory killer uses this to determine when a task
it has killed has finally given up its goods.

Signed-off-by: San Mehat <san@google.com>

7 years agobinder: Fix memory corruption via page aliasing
Christopher Lais [Sat, 1 May 2010 20:51:48 +0000]
binder: Fix memory corruption via page aliasing

binder_deferred_release was not unmapping the page from the buffer
before freeing it, causing memory corruption.  This only happened
when page(s) had not been freed by binder_update_page_range, which
properly unmaps the pages.

This only happens on architectures with VIPT aliasing.

To reproduce, create a program which opens, mmaps, munmaps, then closes
the binder very quickly.  This should leave a page allocated when the
binder is released.  When binder_deferrred_release is called on the
close, the page will remain mapped to the address in the linear
proc->buffer.  Later, we may map the same physical page to a different
virtual address that has different coloring, and this may cause
aliasing to occur.

PAGE_POISONING will greatly increase your chances of noticing any
problems.

Change-Id: I6941bf212881b8bf846bdfda43d3609c7ae4892e

Signed-off-by: Christopher Lais <chris+android@zenthought.org>

7 years agostaging: android: lowmemkiller: Substantially reduce overhead during reclaim
San Mehat [Wed, 5 May 2010 18:38:42 +0000]
staging: android: lowmemkiller: Substantially reduce overhead during reclaim

This patch optimizes lowmemkiller to not do any work when it has an outstanding
kill-request. This greatly reduces the pressure on the task_list lock
(improving interactivity), as well as improving the vmscan performance
when under heavy memory pressure (by up to 20x in tests).

Note: For this enhancement to work, you need CONFIG_PROFILING

Signed-off-by: San Mehat <san@google.com>

7 years ago[ARM] Do not call flush_cache_user_range with mmap_sem held
Dima Zavin [Wed, 28 Apr 2010 03:57:04 +0000]
[ARM] Do not call flush_cache_user_range with mmap_sem held

We can't be holding the mmap_sem while calling flush_cache_user_range
because the flush can fault. If we fault on a user address, the
page fault handler will try to take mmap_sem again. Since both places
acquire the read lock, most of the time it succeeds. However, if another
thread tries to acquire the write lock on the mmap_sem (e.g. mmap) in
between the call to flush_cache_user_range and the fault, the down_read
in do_page_fault will deadlock.

Also, since we really can't be holding the mmap_sem while calling
flush_cache_user_range AND vma is actually unused by the flush itself,
get rid of vma as an argument.

Change-Id: If55409bde41ad1060fa4fe7cbd4ac530d4d9a106
Signed-off-by: Dima Zavin <dima@android.com>

7 years agolowmemorykiller: Don't try to kill the same pid over and over
San Mehat [Mon, 26 Apr 2010 22:11:04 +0000]
lowmemorykiller: Don't try to kill the same pid over and over

  Under certain circumstances, a process can take awhile to
handle a sig-kill (especially if it's in a scheduler group with
a very low share ratio). When this occurs, lowmemkiller returns
to vmscan indicating the process memory has been freed - even
though the process is still waiting to die. Since the memory
hasn't actually freed, lowmemkiller is called again shortly after,
and picks the same process to die; regardless of the fact that
it has already been 'scheduled' to die and the memory has already
been reported to vmscan as having been freed.

  Solution is to check fatal_signal_pending() on the selected
task, and if it's already pending destruction return; indicating
to vmscan that no resources were freed on this pass.

Signed-off-by: San Mehat <san@google.com>

7 years agoStaging: android: binder: Create dedicated workqueue for binder deferred work
Arve Hjønnevåg [Thu, 22 Apr 2010 22:53:23 +0000]
Staging: android: binder: Create dedicated workqueue for binder deferred work

Some drivers flush the global workqueue when closed. This would deadlock if
the last reference to the file was released from the binder.

Change-Id: Ifdabc0b383fecb20836d1bbb9786c632402a14e1
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agoStaging: android: timed_gpio: Properly discard invalid timeout values.
Mike Lockwood [Sat, 17 Apr 2010 16:01:35 +0000]
Staging: android: timed_gpio: Properly discard invalid timeout values.

The timed output device never previously checked the return value of sscanf,
resulting in an uninitialized int being passed to enable() if input value
was invalid.

Signed-off-by: Mike Lockwood <lockwood@android.com>

7 years agoandroid-common: include linux/slab.h
Arve Hjønnevåg [Wed, 21 Apr 2010 05:33:05 +0000]
android-common: include linux/slab.h

Change-Id: Ib9655177bfaf00bd5682e1ac0d7e813e16a47eea

7 years agoandroid-common: Fix slab.h includes for 2.6.34-rc4
Colin Cross [Thu, 15 Apr 2010 22:21:51 +0000]
android-common: Fix slab.h includes for 2.6.34-rc4

7 years agortc: alarm: Don't use save_time_delta.
Arve Hjønnevåg [Sat, 13 Mar 2010 04:05:32 +0000]
rtc: alarm: Don't use save_time_delta.

Change-Id: Iaefeca497de02fe36b7f5d79075912f6e349ec53
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agobinder: Move debugging information from procfs to debugfs
Arve Hjønnevåg [Wed, 29 Apr 2009 03:57:50 +0000]
binder: Move debugging information from procfs to debugfs

Change-Id: Ia0f9c8cec68054c6600a799ef864ebf1185c93ab
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agobinder: Use seq_file for debug interface.
Arve Hjønnevåg [Wed, 29 Apr 2009 03:57:50 +0000]
binder: Use seq_file for debug interface.

Change-Id: I6e9c064ba024329099cb833b2ae9ab43c2ad8c6d
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agofs: partitions: Fix warnings in fs/partitions/check.c
Colin Cross [Wed, 7 Apr 2010 19:08:27 +0000]
fs: partitions: Fix warnings in fs/partitions/check.c

Change-Id: I4398ace0c55d4833b1fcbb7a4e71ab8f0b1b044a
Signed-off-by: Colin Cross <ccross@android.com>

7 years agowlan: Extract generic wlan platform data from tiwlan specific header
Dmitry Shmidt [Thu, 18 Mar 2010 23:04:18 +0000]
wlan: Extract generic wlan platform data from tiwlan specific header

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

7 years agoapanic: make APANIC_LABEL depend on APANIC
Iliyan Malchev [Wed, 17 Mar 2010 19:02:26 +0000]
apanic: make APANIC_LABEL depend on APANIC

Signed-off-by: Iliyan Malchev <malchev@google.com>

7 years agoandroid: logger: Add new system log for framework/system log messages
San Mehat [Wed, 24 Feb 2010 00:09:47 +0000]
android: logger: Add new system log for framework/system log messages

Signed-off-by: San Mehat <san@google.com>

7 years agopower: wakelock: Print active wakelocks when has_wake_lock() is called
Mike Chan [Tue, 16 Feb 2010 22:18:55 +0000]
power: wakelock: Print active wakelocks when has_wake_lock() is called

When DEBUG_SUSPEND is enabled print active wakelocks when we check
if there are any active wakelocks.

In print_active_locks(), print expired wakelocks if DEBUG_EXPIRE is enabled

Change-Id: Ib1cb795555e71ff23143a2bac7c8a58cbce16547
Signed-off-by: Mike Chan <mike@android.com>

7 years agommc: core: Release delayed mmc work wakelock after deep disable
San Mehat [Tue, 9 Feb 2010 20:08:48 +0000]
mmc: core: Release delayed mmc work wakelock after deep disable

Signed-off-by: San Mehat <san@google.com>

7 years agoblock: genhd: Add disk/partition specific uevent callbacks for partition info
San Mehat [Sat, 10 Oct 2009 16:35:24 +0000]
block: genhd: Add disk/partition specific uevent callbacks for partition info

For disk devices, a new uevent parameter 'NPARTS' specifies the number
of partitions detected by the kernel. Partition devices get 'PARTN' which
specifies the partitions index in the table.

Signed-off-by: San Mehat <san@google.com>

7 years agoStaging: android: timed_gpio: Request gpios.
Arve Hjønnevåg [Thu, 7 Jan 2010 01:17:33 +0000]
Staging: android: timed_gpio: Request gpios.

Change-Id: I9e98250a04e5505ce2db2edd355e8fdf8391cabd
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agoStaging: android: ram_console: Start ram console earlier
Arve Hjønnevåg [Fri, 18 Dec 2009 07:42:08 +0000]
Staging: android: ram_console: Start ram console earlier

Change-Id: I15d809d8c3002e5bf397a2b154e3803ea0e73642
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agomisc: apanic: erase kpanic when no data
Tom Zhu [Thu, 24 Sep 2009 15:58:50 +0000]
misc: apanic: erase kpanic when no data

erase kpanic partition when there is no data(console and thread)

Signed-off-by: Tom Zhu <a2289c@android-hal-04.(none)>
Signed-off-by: San Mehat <san@google.com>

7 years agomisc: apanic: bad block handling
Tom Zhu [Mon, 21 Sep 2009 21:36:05 +0000]
misc: apanic: bad block handling

Add bad block handling in apanic

Signed-off-by: Tom Zhu <ling.zhu@motorola.com>
Signed-off-by: San Mehat <san@google.com>

misc: apanic: Improved bad-block / watchdog handling

1. handle cases that there is no more good blocks
2. touch softlockup watchdog at the start of apanic
3. change unsigned char get_bb() to unsigned int get_bb()
4. return idx instead of rc2, to keep the previous written pages.

Signed-off-by: Tom Zhu <ling.zhu@motorola.com>
Signed-off-by: San Mehat <san@google.com>

7 years agoramconsole/apanic: Ensure ramconsole does not get cluttered by apanic threads
San Mehat [Thu, 17 Sep 2009 21:27:41 +0000]
ramconsole/apanic: Ensure ramconsole does not get cluttered by apanic threads

Signed-off-by: San Mehat <san@google.com>

7 years agodrivers: apanic: Android kernel panic handler.
San Mehat [Tue, 1 Sep 2009 20:43:01 +0000]
drivers: apanic: Android kernel panic handler.

This driver triggers when the kernel panics and attempts to
write critical debug data to the flash.

Signed-off-by: San Mehat <san@google.com>

drivers: apanic: checkpatch fixes

Signed-off-by: San Mehat <san@google.com>

apanic: Fix a few cases of calling non-atomic things from atomic

We need to pay special care to not enrage cond_resched(), and the
base nand bb stuff calls schedule() so thats out.

Signed-off-by: San Mehat <san@google.com>

7 years agoproc: smaps: Allow smaps access for CAP_SYS_RESOURCE
San Mehat [Wed, 16 Sep 2009 19:39:10 +0000]
proc: smaps: Allow smaps access for CAP_SYS_RESOURCE

Signed-off-by: San Mehat <san@google.com>

7 years agokernel: printk: Add non exported function for clearing the log ring buffer
San Mehat [Thu, 6 Aug 2009 17:25:21 +0000]
kernel: printk: Add non exported function for clearing the log ring buffer

Signed-off-by: San Mehat <san@google.com>

7 years ago[ARM] process: Add display of memory around registers when displaying regs.
San Mehat [Tue, 25 Aug 2009 23:52:22 +0000]
[ARM] process: Add display of memory around registers when displaying regs.

This is extremely useful in diagnosing remote crashes, and is based heavily
on original work by <md@google.com>.

Signed-off-by: San Mehat <san@google.com>
Cc: Michael Davidson <md@google.com>

[ARM] process: Use uber-safe probe_kernel_address() to read mem when dumping.

This prevents the dump from taking pagefaults / external aborts.

Signed-off-by: San Mehat <san@google.com>

7 years agomtd: nand: Add naieve panic_write support for generic nand devices.
San Mehat [Thu, 20 Aug 2009 17:50:45 +0000]
mtd: nand: Add naieve panic_write support for generic nand devices.

Signed-off-by: San Mehat <san@google.com>

mtd: nand_base: fix nand_panic_wait

fix the problem of nand_panic_wait

Signed-off-by: Tom Zhu <a2289c@android-hal-04.(none)>
Signed-off-by: San Mehat <san@google.com>

7 years agodrivers: power: Add watchdog timer to catch drivers which lockup during suspend.
San Mehat [Thu, 13 Aug 2009 16:40:42 +0000]
drivers: power: Add watchdog timer to catch drivers which lockup during suspend.

Rather than hard-lock the kernel, we now BUG() when a driver takes
> 3 seconds to suspend. If the underlying platform supports panic dumps,
then the data can be collected for debug.

Signed-off-by: San Mehat <san@google.com>

7 years agoBluetooth: Add ACL MTU, available buffers and total buffers to hci_conn_info.
Nick Pelly [Wed, 9 Dec 2009 08:15:41 +0000]
Bluetooth: Add ACL MTU, available buffers and total buffers to hci_conn_info.

This provides userspace debugging tools access to ACL flow control state.

Signed-off-by: Nick Pelly <npelly@google.com>

7 years agoBluetooth: Fallback to SCO on error code 0x10 (Connection Accept Timeout).
Nick Pelly [Tue, 22 Sep 2009 22:19:46 +0000]
Bluetooth: Fallback to SCO on error code 0x10 (Connection Accept Timeout).

This is to support the Motorola HF850 carkit which reports the error code 0x10
for an eSCO attempt, even though it advertises eSCO support. Here is the
hcidump:

2009-09-22 15:40:24.492391 < HCI Command: Setup Synchronous Connection
(0x01|0x0028) plen 17
    handle 1 voice setting 0x0060
2009-09-22 15:40:24.493002 > HCI Event: Command Status (0x0f) plen 4
    Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
2009-09-22 15:40:30.594869 > HCI Event: Synchronous Connect Complete (0x2c)
plen 17
    status 0x10 handle 257 bdaddr 00:50:CD:20:C6:84 type eSCO
    Error: Connection Accept Timeout Exceeded

With this patch we will retry with a SCO connection, which succeeds.

Unfortunately the Moto HF850 also takes 5 seconds to return the error for the
eSCO attempt, so it will still take 5 seconds to fallback to SCO with this
patch.

Signed-off-by: Nick Pelly <npelly@google.com>

7 years agoBluetooth: Increase timeout for legacy pairing from 10 seconds to 40 seconds.
Nick Pelly [Sat, 19 Sep 2009 01:29:23 +0000]
Bluetooth: Increase timeout for legacy pairing from 10 seconds to 40 seconds.

Legacy pairing is a bit of a problem because on the incoming end it is
impossible to know pairing has begun:

2009-09-18 18:29:24.115692 > HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:23:D4:04:51:7A class 0x58020c type ACL
2009-09-18 18:29:24.115966 < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr 00:23:D4:04:51:7A role 0x00
    Role: Master
2009-09-18 18:29:24.117065 > HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
2009-09-18 18:29:24.282928 > HCI Event: Role Change (0x12) plen 8
    status 0x00 bdaddr 00:23:D4:04:51:7A role 0x00
    Role: Master
2009-09-18 18:29:24.291534 > HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 1 bdaddr 00:23:D4:04:51:7A type ACL encrypt 0x00
2009-09-18 18:29:24.291839 < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 1
2009-09-18 18:29:24.292144 > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr 00:23:D4:04:51:7A mode 1
2009-09-18 18:29:24.293823 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
2009-09-18 18:29:24.303588 > HCI Event: Max Slots Change (0x1b) plen 3
    handle 1 slots 5
2009-09-18 18:29:24.309448 > HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 1
    Features: 0xff 0xff 0x2d 0xfe 0x9b 0xff 0x79 0x83
2009-09-18 18:29:24.345916 < HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:23:D4:04:51:7A mode 2 clkoffset 0x0000
2009-09-18 18:29:24.346923 > HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
2009-09-18 18:29:24.375793 > HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:23:D4:04:51:7A name 'test'
2009-09-18 18:29:34.332190 < HCI Command: Disconnect (0x01|0x0006) plen 3
    handle 1 reason 0x13

There are some mainline patches such as "Add different pairing timeout for
Legacy Pairing" but they do not address the HCI sequence above.

I think the real solution is to avoid using CreateBond(), and instead make
the profile connection immediately. This way both sides will use a longer
timeout because there is a higher level connection in progress, and we will
not end up with the useless HCI sequence above.

Signed-off-by: Nick Pelly <npelly@google.com>

7 years agoBluetooth: Do not attempt to send dlci disconnect when in BT_CONFIG.
Nick Pelly [Thu, 9 Jul 2009 19:23:44 +0000]
Bluetooth: Do not attempt to send dlci disconnect when in BT_CONFIG.

This fixes a bug where shutdown() and close() on a rfcomm socket during ACL
connection would not cause HCI Create Connection Cancel.

Signed-off-by: Nick Pelly <npelly@google.com>

7 years agoserial_core: Add wake_peer uart operation which is called before starting UART TX...
San Mehat [Thu, 30 Jul 2009 03:21:28 +0000]
serial_core: Add wake_peer uart operation which is called before starting UART TX. The idea here is to provide a mechanism where we can wakeup our peer before sending data.

Signed-off-by: San Mehat <san@google.com>

7 years agorfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to power down
Nick Pelly [Fri, 5 Dec 2008 01:37:05 +0000]
rfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to power down

Some platforms do not want to power down rfkill devices on suspend.

Change-Id: I62a11630521c636d54a4a02ab9037a43435925f5
Signed-off-by: Nick Pelly <npelly@google.com>

7 years agowl127x-rfkill: Add power control driver for TI WL127X Bluetooth chips
Nick Pelly [Thu, 11 Jun 2009 17:49:48 +0000]
wl127x-rfkill: Add power control driver for TI WL127X Bluetooth chips

Signed-off-by: Nick Pelly <npelly@google.com>

7 years agokernel_debugger_core: add interrupt-context debugger core
Brian Swetland [Wed, 9 Apr 2008 05:34:46 +0000]
kernel_debugger_core: add interrupt-context debugger core

This provides kernel_debugger() which can be called from an interrupt
context low level debugger wedge to execute commands that inspect
kernel state.  It doesn't do much on its own.

Signed-off-by: Brian Swetland <swetland@google.com>

kernel_debugger_core: Add sysrq command.

sysrq <c> will run the sysrq command <c> and dump what
was added to the kernel log while the command ran.

Signed-off-by: Brian Swetland <swetland@google.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>

7 years agoprintk: Fix log_buf_copy termination.
Arve Hjønnevåg [Tue, 15 Apr 2008 04:35:25 +0000]
printk: Fix log_buf_copy termination.

If idx was non-zero and the log had wrapped, len did not get truncated
to stop at the last byte written to the log.

7 years agoRevert "printk: remove unused code from kernel/printk.c"
Arve Hjønnevåg [Fri, 16 Jan 2009 03:07:27 +0000]
Revert "printk: remove unused code from kernel/printk.c"

This reverts commit acff181d3574244e651913df77332e897b88bff4.

7 years agonet: Replace AID_NET_RAW checks with capable(CAP_NET_RAW).
Chia-chi Yeh [Tue, 30 Jun 2009 03:23:04 +0000]
net: Replace AID_NET_RAW checks with capable(CAP_NET_RAW).

Signed-off-by: Chia-chi Yeh <chiachi@android.com>

7 years agosecurity: Add AID_NET_RAW and AID_NET_ADMIN capability check in cap_capable().
Chia-chi Yeh [Thu, 18 Jun 2009 23:15:05 +0000]
security: Add AID_NET_RAW and AID_NET_ADMIN capability check in cap_capable().

Signed-off-by: Chia-chi Yeh <chiachi@android.com>

7 years agonet: PPPoPNS and PPPoLAC fixes.
Chia-chi Yeh [Fri, 12 Jun 2009 18:29:04 +0000]
net: PPPoPNS and PPPoLAC fixes.

net: Fix a bitmask in PPPoPNS and rename constants in PPPoPNS and PPPoLAC.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>

net: Fix a potential deadlock while releasing PPPoLAC/PPPoPNS socket.

PPP driver guarantees that no thread will be executing start_xmit() after
returning from ppp_unregister_channel(). To achieve this, a spinlock (downl)
is used. In pppolac_release(), ppp_unregister_channel() is called after sk_udp
is locked. At the same time, another thread might be running in pppolac_xmit()
with downl. Thus a deadlock will occur if the thread tries to lock sk_udp.
The same situation might happen on sk_raw in pppopns_release().

Signed-off-by: Chia-chi Yeh <chiachi@android.com>

net: Force PPPoLAC and PPPoPNS to bind an interface before creating PPP channel.

It is common to manipulate the routing table after configuring PPP device.
Since both PPPoLAC and PPPoPNS run over IP, care must be taken to make sure
that there is no loop in the routing table.
Although this can be done by adding a host route, it might still cause
problems when the interface is down for some reason.

To solve this, this patch forces both drivers to bind an interface before
creating PPP channel, so the system will not re-route the tunneling sockets
to another interface when the original one is down. Another benefit is that
now the host route is no longer required, so there is no need to remove it
when PPP channel is closed.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>

net: Avoid sleep-inside-spinlock in PPPoLAC and PPPoPNS.

Since recv() and xmit() are called with a spinlock held, routines which might
sleep cannot be used. This issue is solved by following changes:

Incoming packets are now processed in backlog handler, recv_core(), instead of
recv(). Since backlog handler is always executed with socket spinlock held, the
requirement of ppp_input() is still satisfied.

Outgoing packets are now processed in workqueue handler, xmit_core(), instead of
xmit(). Note that kernel_sendmsg() is no longer used to prevent touching dead
sockets.

In release(), lock_sock() and pppox_unbind_sock() ensure that no thread is in
recv_core() or xmit(). Then socket handlers are restored before release_sock(),
so no packets will leak in backlog queue.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>

net: Fix msg_iovlen in PPPoLAC and PPPoPNS.

Although any positive value should work (which is always true in both drivers),
the correct value should be 1.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>

7 years agonet: add PPP on PPTP Network Server (PPPoPNS) driver.
Chia-chi Yeh [Thu, 11 Jun 2009 17:09:30 +0000]
net: add PPP on PPTP Network Server (PPPoPNS) driver.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>

ppopns: dont include px_proto define in if_pppopns.h

Change-Id: I27e687667db5b45182562f4a517a2e6cec6b1350
Signed-off-by: Dima Zavin <dima@android.com>

7 years agonet: add PPP on L2TP Access Concentrator (PPPoLAC) driver.
Chia-chi Yeh [Thu, 7 May 2009 20:02:40 +0000]
net: add PPP on L2TP Access Concentrator (PPPoLAC) driver.

Change-Id: I3ae3ee7520951ae24269db0ef2898c6455cf6bcc
Signed-off-by: Chia-chi Yeh <chiachi@android.com>

ppolac: dont include px_proto define in if_pppolac.h

Change-Id: I55bc9cf91ea0e9e8f7bf5d6e241d188e1269343a
Signed-off-by: Dima Zavin <dima@android.com>

7 years agocgroup: Add generic cgroup subsystem permission checks.
San Mehat [Thu, 21 May 2009 21:10:06 +0000]
cgroup: Add generic cgroup subsystem permission checks.

    Rather than using explicit euid == 0 checks when trying to move
tasks into a cgroup via CFS, move permission checks into each
specific cgroup subsystem. If a subsystem does not specify a
'can_attach' handler, then we fall back to doing our checks the old way.

    This way non-root processes can add arbitrary processes to
a cgroup if all the registered subsystems on that cgroup agree.

    Also change explicit euid == 0 check to CAP_SYS_ADMIN

Signed-off-by: San Mehat <san@google.com>

7 years agofs: yaffs: don't force YAFFS_TRACE_ALWAYS for all trace levels
Dima Zavin [Thu, 6 Jan 2011 00:03:21 +0000]
fs: yaffs: don't force YAFFS_TRACE_ALWAYS for all trace levels

Change-Id: I9ddc676382d26aef7f12145d412fe670cb486317
Signed-off-by: Dima Zavin <dima@android.com>

7 years agofs: yaffs: Import yaffs from Thu Dec 23 13:31:37 2010 +1300
Arve Hjønnevåg [Wed, 19 May 2010 03:35:30 +0000]
fs: yaffs: Import yaffs from Thu Dec 23 13:31:37 2010 +1300

commit ddf33fed15c2376bfb602d62dd018c63fce60df8
Author: Timothy Manning <tfhmanning@gmail.com>
Date:   Thu Dec 23 13:31:37 2010 +1300

    yaffs updated direct/timothy_tests/quick_tests
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>

Change-Id: I5bbe5a05277bdf8a6fe188bbe4c77725b3fa2aae
Signed-off-by: Dima Zavin <dima@android.com>

7 years agofs: block_dump: Don't display inode changes if block_dump < 2
San Mehat [Sun, 22 Mar 2009 01:48:54 +0000]
fs: block_dump: Don't display inode changes if block_dump < 2

Signed-off-by: San Mehat <san@android.com>

7 years agotiwlan: Add abstract wifi control functions support
Dmitry Shmidt [Thu, 18 Dec 2008 17:55:20 +0000]
tiwlan: Add abstract wifi control functions support

7 years agousb: gadget: android: fix compilation on 2.6.37
Dima Zavin [Thu, 6 Jan 2011 00:13:41 +0000]
usb: gadget: android: fix compilation on 2.6.37

Change-Id: I9a99f007415c5be1bd1a86b138486eac51784e0d
Signed-off-by: Dima Zavin <dima@android.com>

7 years agoUSB: gadget: composite: Use separate switches for connected and config state
Mike Lockwood [Sat, 11 Dec 2010 00:30:15 +0000]
USB: gadget: composite: Use separate switches for connected and config state

Also remove disconnect debouncing, which didn't actually work on some platforms

Signed-off-by: Mike Lockwood <lockwood@android.com>

7 years agoUSB: gadget: acm,rndis: IAD class, subclass & prot should match 1st iface
John Michelau [Fri, 10 Dec 2010 19:51:19 +0000]
USB: gadget: acm,rndis: IAD class, subclass & prot should match 1st iface

Microsoft recommends that the class and subclass fields of
an IAD match the same fields from the first interface in the
collection that the IAD is grouping. In practice, we are also
finding that the protocol fields should also match. Without
this change, the default Microsoft composite driver may not
group interfaces properly, which is what allows child
function drivers with IAD's to load correctly.

Signed-off-by: Mike Lockwood <lockwood@android.com>

7 years agoUSB: gadget: composite: Dynamically set IAD bFirstInterface
John Michelau [Fri, 10 Dec 2010 18:09:53 +0000]
USB: gadget: composite: Dynamically set IAD bFirstInterface

bFirstInterface should be set equal to bInterfaceNumber of
the first interface in a grouping. It's currently being set
only when a composite device is bound, and it does not get
updated when functions are enabled or disabled.

Signed-off-by: Mike Lockwood <lockwood@android.com>

7 years agoUSB: gadget: android Fix gadget descriptor compliance for IAD's
John Michelau [Fri, 10 Dec 2010 17:33:54 +0000]
USB: gadget: android Fix gadget descriptor compliance for IAD's

USB-IF core team mandates that composite devices containing
IAD's must use bDeviceClass=0xEF, bDeviceSubClass=0x02, &
bDeviceProtocol=0x01 instead of the usual 0x00 in all fields.
This is not a problem currently on Linux hosts, but it is a
problem when connecting to Windows hosts. Without this change
the default Microsoft composite driver will not group
interfaces properly, which is what allows child function
drivers with IAD's to load correctly.

Signed-off-by: Mike Lockwood <lockwood@android.com>