platform/kernel/kernel-mfld-blackbay.git
13 years agonet: wireless: bcm4329: Fix disable pno call
Greg Goldman [Sat, 19 Feb 2011 01:12:19 +0000 (17:12 -0800)]
net: wireless: bcm4329: Fix disable pno call

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agonet: wireless: bcm4329: Get country translation from platform data
Dmitry Shmidt [Tue, 15 Feb 2011 01:48:56 +0000 (17:48 -0800)]
net: wireless: bcm4329: Get country translation from platform data

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agonet: wireless: Add get_country_code functionality to platform
Dmitry Shmidt [Tue, 15 Feb 2011 00:58:48 +0000 (16:58 -0800)]
net: wireless: Add get_country_code functionality to platform

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agonet: wireless: bcm4329: Update to version 4.218.248-23
Greg Goldman [Mon, 14 Feb 2011 23:54:42 +0000 (15:54 -0800)]
net: wireless: bcm4329: Update to version 4.218.248-23

- Add support to PNO with adaptive scan time
- Remove logic to generate Link Down based on Roaming Event
- Improve sco/esco detection method for BT COEX
- Add new function TXPOWER to reduce power if needed

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agonet: wireless: bcm4329: Fix mem leak in wl_iw_handle_scanresults_ies
Mike Corrigan [Sat, 12 Feb 2011 01:05:54 +0000 (17:05 -0800)]
net: wireless: bcm4329: Fix mem leak in wl_iw_handle_scanresults_ies

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agonet: wireless: bcm4329: Fix memleak in dev->p
Andrei Warkentin [Sat, 12 Feb 2011 01:01:28 +0000 (17:01 -0800)]
net: wireless: bcm4329: Fix memleak in dev->p

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agonet: wireless: bcm4329: Add sdlock to firmware loading
Dmitry Shmidt [Sat, 12 Feb 2011 00:54:39 +0000 (16:54 -0800)]
net: wireless: bcm4329: Add sdlock to firmware loading

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoPM: Increase dpm suspend timeout
Benoit Goby [Mon, 7 Feb 2011 21:55:26 +0000 (13:55 -0800)]
PM: Increase dpm suspend timeout

usbhid devices have a 10s timeout waiting for the out queue to clear.
Increased the watchdog to 12s.

Change-Id: I96368fca6dff98e4eba8aedb09c23be964c8f4b4
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agoUSB: gadget: f_mtp: Don't block in mtp_send_event
Mike Lockwood [Thu, 10 Feb 2011 16:54:53 +0000 (11:54 -0500)]
USB: gadget: f_mtp: Don't block in mtp_send_event

We used to wait for the previous interrupt packet to complete before sending
the next packet.  But unfortunately the previous packet will not complete
until USB is disconnected if the host is not listening on the interrupt
endpoint (which is the case with libmtp on Linux and Mac).
To avoid hanging indefinitely in this case, we now simply return -EBUSY
if the previous interrupt packet has not completed yet.

Signed-off-by: Mike Lockwood <lockwood@android.com>
13 years agoUSB: gadget: android: Support switching vendor ID when configuration changes
Mike Lockwood [Wed, 9 Feb 2011 14:38:26 +0000 (09:38 -0500)]
USB: gadget: android: Support switching vendor ID when configuration changes

Based on the list of enabled USB functions, we can now switch the vendor ID
as well as the product ID.

Signed-off-by: Mike Lockwood <lockwood@android.com>
13 years agoRevert "mmc: subtract boot sectors from disk size for eMMC 4.3+ devices"
Colin Cross [Sat, 12 Feb 2011 21:21:32 +0000 (13:21 -0800)]
Revert "mmc: subtract boot sectors from disk size for eMMC 4.3+ devices"

This reverts commit f0b0e4bec1e89014f3dcef4da8bcf95428cc771c.

The reverted commit incorrectly calculates the size of eMMC
devices in some (all?) cases.

This revert may cause problems in cases where the bootloader was
bug-compatible and puts a GPT partition at the incorrect end of
the eMMC device.

Signed-off-by: Colin Cross <ccross@android.com>
13 years agopower: wakelock: use get_xtime_and_monotonic_and_sleep_offset in get_expired_time
Colin Cross [Wed, 30 Mar 2011 19:37:49 +0000 (12:37 -0700)]
power: wakelock: use get_xtime_and_monotonic_and_sleep_offset in get_expired_time

Change-Id: I6ebe6b954b2ff328d46898d683650dafb9c4fe74
Signed-off-by: Erik Gilling <konkers@android.com>
13 years agousb: gadget: composite: USB_GET_CONFIGURATION must return 0 in unconfigured state.
Oleg Matcovschi [Fri, 11 Mar 2011 18:24:30 +0000 (10:24 -0800)]
usb: gadget: composite: USB_GET_CONFIGURATION must return 0 in unconfigured state.

Change-Id: I5212ca9990308d0c4ae6a55c60cba42d6b0e4fee
Signed-off-by: Oleg Matcovschi <olegmatcovsky@gmail.com>
13 years agoUSB: gadget: f_adb: dequeue request on error in adb_read
Iliyan Malchev [Fri, 18 Feb 2011 19:28:32 +0000 (11:28 -0800)]
USB: gadget: f_adb: dequeue request on error in adb_read

In adb_read(), if wait_event_interruptible() returns an error, we need to
remove the request from the EP queue.  Else, on the next call to adb_read(), we
will attempt to enqueue the request again, potentially corrupting the
queue.  This is what happens with musb_gadget_queue(), which does not check for
duplicate requests.

Signed-off-by: Iliyan Malchev <malchev@google.com>
13 years agoUSB: gadget: f_mtp: Fix problems transferring files from device to host
Mike Lockwood [Mon, 7 Feb 2011 16:51:07 +0000 (11:51 -0500)]
USB: gadget: f_mtp: Fix problems transferring files from device to host

Exit from send_file_work immediately when a cancel request is received.

Only busy status if there is a cancel pending that has not been repoorted to userspace.
This avoids a race condition that can occur when mtp_read resets the state
to STATE_BUSY before we report status OK back to the host.

Signed-off-by: Mike Lockwood <lockwood@android.com>
13 years agoUSB: gadget: composite: fix compile issues
Vikram Pandita [Tue, 8 Feb 2011 05:20:50 +0000 (21:20 -0800)]
USB: gadget: composite: fix compile issues

In file included from drivers/usb/gadget/ether.c:114:
drivers/usb/gadget/composite.c: In function 'usb_composite_force_reset':
drivers/usb/gadget/composite.c:121: error: implicit declaration of function 'msleep'
drivers/usb/gadget/composite.c: In function 'usb_add_function':
drivers/usb/gadget/composite.c:158: error: implicit declaration of function 'MKDEV'

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
13 years agoblock: genhd: Add partition name to the partition info uevent callback
Brian Swetland [Fri, 4 Feb 2011 21:19:10 +0000 (13:19 -0800)]
block: genhd: Add partition name to the partition info uevent callback

For disk and partition devices, add new uevent parameter:
PARTNAME specifices the partition name of a partition device

Signed-off-by: Dima Zavin <dima@android.com>
13 years agoARM: vfp: Move exception address fixup into vfphw.S
Colin Cross [Thu, 27 Jan 2011 23:46:20 +0000 (15:46 -0800)]
ARM: vfp: Move exception address fixup into vfphw.S

If the PC on the stack is updated in entry-armv.S,
do_undefinstr can get called after the fixup.  do_undefinstr
does its own fixup, and doing both causes the PC to point to
half way through an instruction.

Instead, do the fixup in do_vfp, where only the vfp code
can get called.

Change-Id: I6d966887adc8ed58d88bfe0cb3c0ba29213be488
Signed-off-by: Colin Cross <ccross@android.com>
13 years agocpufreq: Prevent memory leak in cpufreq_stats on hotplug
Colin Cross [Sat, 29 Jan 2011 03:32:31 +0000 (19:32 -0800)]
cpufreq: Prevent memory leak in cpufreq_stats on hotplug

Ensures that cpufreq_stats_free_table is called before
__cpufreq_remove_dev on cpu hotplug (which also occurs during
suspend on SMP systems) to make sure that sysfs_remove_group
can get called before the cpufreq kobj is freed.  Otherwise,
the sysfs file structures are leaked.

Change-Id: I87e55277272f5cfad47e9e7c92630e990bb90069
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoPM: Change dpm watchdog to support async suspend
Benoit Goby [Thu, 27 Jan 2011 02:28:33 +0000 (18:28 -0800)]
PM: Change dpm watchdog to support async suspend

Exclude from the watchdog the time spent waiting for children that
are resumed asynchronously and time every devices, whether or not they
resumed synchronously.

Change-Id: I84209dfd5df72842e045096c906fd61e20e6d183
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agoPrint pending wakeup IRQ preventing suspend to dmesg
Todd Poynor [Mon, 24 Jan 2011 22:36:39 +0000 (14:36 -0800)]
Print pending wakeup IRQ preventing suspend to dmesg

Change-Id: I36f90735c75fb7c7ab1084775ec0d0ab02336e6e
Signed-off-by: Todd Poynor <toddpoynor@google.com>
13 years agoinput: keyreset: Only print message for default handler
Colin Cross [Fri, 21 Jan 2011 21:42:46 +0000 (13:42 -0800)]
input: keyreset: Only print message for default handler

Change-Id: I68e5451fef2e6f08bf1035077ea999e34a619f87
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoPM: Dump suspend thread stack on dpm suspend timeout
Benoit Goby [Fri, 21 Jan 2011 23:53:44 +0000 (15:53 -0800)]
PM: Dump suspend thread stack on dpm suspend timeout

When a driver takes more than 3 seconds to suspend, dump the suspend
thread stack since BUG() might only dump the idle thread stack.

Change-Id: If854db355fdcf3b773ea20b1b5e031def6d4b114
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agoinput: evdev: Add missing wake_lock_destroy
Benoit Goby [Wed, 19 Jan 2011 22:10:37 +0000 (14:10 -0800)]
input: evdev: Add missing wake_lock_destroy

Change-Id: Ief1ef44d98a197e5b457f5e8617c413e76e3c6d2
Signed-off-by: Benoit Goby <benoit@android.com>
13 years agoARM: Fix up vfp exception location in thumb mode
Colin Cross [Fri, 14 Jan 2011 22:32:49 +0000 (14:32 -0800)]
ARM: Fix up vfp exception location in thumb mode

The exception handler in entry-armv.S checks for thumb mode and
correctly determines the exception location and instruction,
but VFP_bounce uses the uncorrected location off the stack.
If the VFP exception occured in Thumb mode, fix up the
exception location on the stack to match the value that would
be returned in ARM mode.

Fixes segfaults in userspace applications running in Thumb mode
caused by a handled VFP exception returning to the middle of the
instruction that triggered the exception.

Change-Id: I02be4c5b546561d9a967a02c1e9eb1de876cff07
Original-author: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoUSB: gadget: f_mtp: Make sure request is dequeued if transfer is canceled
Mike Lockwood [Thu, 13 Jan 2011 21:19:57 +0000 (16:19 -0500)]
USB: gadget: f_mtp: Make sure request is dequeued if transfer is canceled

If the host cancels a file transfer while we have a read request pending,
call usb_ep_dequeue to cancel the read.
Also return -ECANCELED from mtp_ioctl if we are canceled in MTP_RECEIVE_FILE

Signed-off-by: Mike Lockwood <lockwood@android.com>
13 years agonet: wireless: bcm4329: Turn off CONFIG_US_NON_DFS_CHANNELS_ONLY
Dmitry Shmidt [Thu, 13 Jan 2011 04:12:26 +0000 (20:12 -0800)]
net: wireless: bcm4329: Turn off CONFIG_US_NON_DFS_CHANNELS_ONLY

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agonet: wireless: bcm4329: Update to version 4.218.248-20
Dmitry Shmidt [Thu, 13 Jan 2011 00:22:14 +0000 (16:22 -0800)]
net: wireless: bcm4329: Update to version 4.218.248-20

- Use US/69 locale for US
- Remove dhdsdio_mem_dump() function

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agortc: alarm: Update hrtimer if alarm at the head of the queue is reprogrammed
Arve Hjønnevåg [Sat, 8 Jan 2011 03:00:01 +0000 (19:00 -0800)]
rtc: alarm: Update hrtimer if alarm at the head of the queue is reprogrammed

If an alarm was restarted with a value that moved it away from the head
of a queue, the hrtimer would not be updated. This would cause unnecessary
wakeups.

Change-Id: If379f8dd92b0bdb3173bd8d057adfe0dc1d15259
Signed-off-by: Arve Hjønnevåg <arve@android.com>
13 years agoinput: keyreset: Allow reset function to be overriden
Colin Cross [Fri, 7 Jan 2011 22:52:56 +0000 (14:52 -0800)]
input: keyreset: Allow reset function to be overriden

Change-Id: Ibb3dda05772b2e89d7b2646689944d309cb1f74e
Signed-off-by: Colin Cross <ccross@android.com>
13 years agocpufreq interactive governor: fix crash on CPU shutdown
Todd Poynor [Fri, 24 Dec 2010 01:33:07 +0000 (17:33 -0800)]
cpufreq interactive governor: fix crash on CPU shutdown

Don't reference the saved copy of the CPU's cpufreq policy
pointer after the governor has been stopped for the CPU.

When the governor is stopped for a CPU:

* Use del_timer_sync() to wait for a currently-running timer
function to stop.

* Delete the timer when the governor is stopped for the
associated CPU, not when the last CPU is stopped.

* Flush any speed down work ongoing.

* Reset the timestamp that is used to tell if the timer function
has had a chance to run since last idle exit.

Check the governor enabled flag for the CPU before re-arming the
timer from within the timer function and at idle exit (in case
stopping the governor at runtime).

Check the governor enabled flag for the CPU in the worker
function and thread before using the policy pointer.  (There is
still a tiny window in the thread that needs more work to close.)

Change-Id: Ifaddf7a495a8dae15a579a57bdc654f7c47f6ada
Signed-off-by: Todd Poynor <toddpoynor@google.com>
13 years agostaging: android: lowmemorykiller: Ignore shmem pages in page-cache
Arve Hjønnevåg [Wed, 24 Nov 2010 01:29:04 +0000 (17:29 -0800)]
staging: android: lowmemorykiller: Ignore shmem pages in page-cache

Change-Id: Ia54fc50b7dcabfeb71eb487c652803f83e2f3d8e
Signed-off-by: Arve Hjønnevåg <arve@android.com>
13 years agostaging: android: lowmemorykiller: Don't wait more than one second for a process...
Arve Hjønnevåg [Wed, 24 Nov 2010 02:20:28 +0000 (18:20 -0800)]
staging: android: lowmemorykiller: Don't wait more than one second for a process to die

If a process forked and the child process was killed by the
lowmemorykiller, the lowmemory killer would be disabled until
the parent process reaped the child or it died itself.

Change-Id: I709b1a4e1b1a1970e51d26a39fcbee57977bbc7f
Signed-off-by: Arve Hjønnevåg <arve@android.com>
13 years agolowmemorykiller: don't unregister notifier from atomic context
Rabin Vincent [Thu, 9 Sep 2010 05:18:21 +0000 (10:48 +0530)]
lowmemorykiller: don't unregister notifier from atomic context

The lowmemorykiller registers an atomic notifier for notfication of when
the task is freed.  From this atomic notifier callback, it removes the
atomic notifier via task_free_unregister().  This is incorrect because
atomic_notifier_chain_unregister() calls syncronize_rcu(), which can
sleep, which shouldn't be done from an atomic notifier.

Fix this by registering the notifier during init, and only unregister it
if the lowmemorykiller is unloaded.

Change-Id: I1577b04e617bc2b2e39dcb490fcfc9ce660eb7ec
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
13 years agocgroup: Remove call to synchronize_rcu in cgroup_attach_task
Colin Cross [Wed, 24 Nov 2010 05:37:04 +0000 (21:37 -0800)]
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>
13 years agocgroup: Set CGRP_RELEASABLE when adding to a cgroup
Colin Cross [Wed, 24 Nov 2010 05:37:03 +0000 (21:37 -0800)]
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>
13 years agoPM: Wait for completion of the parent resume before resuming
Benoit Goby [Mon, 13 Dec 2010 23:27:06 +0000 (15:27 -0800)]
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>
13 years agocpufreq interactive governor save/restore IRQs around cpumask spinlocks
Todd Poynor [Fri, 3 Dec 2010 19:20:09 +0000 (11:20 -0800)]
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>
13 years agocpufreq: interactive: New 'interactive' governor
Mike Chan [Tue, 22 Jun 2010 18:26:45 +0000 (11:26 -0700)]
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

13 years agoARM: fiq_debugger: Add help command
Dmitry Shmidt [Tue, 16 Nov 2010 23:40:13 +0000 (15:40 -0800)]
ARM: fiq_debugger: Add help command

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agomisc: kernel_debugger: Add help command
Dmitry Shmidt [Tue, 16 Nov 2010 23:39:43 +0000 (15:39 -0800)]
misc: kernel_debugger: Add help command

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoARM: fiq_debugger: make fiq_debugger be in debug mode by default
Dima Zavin [Wed, 10 Nov 2010 23:39:07 +0000 (15:39 -0800)]
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>
13 years agosdhci: Always pass clock request value zero to set_clock host op
Todd Poynor [Mon, 11 Oct 2010 23:51:28 +0000 (16:51 -0700)]
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>
13 years ago[ARM] fiq_debugger: Print local timer irqs count
Rebecca Schultz Zavin [Fri, 22 Oct 2010 22:55:17 +0000 (15:55 -0700)]
[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>
13 years agostaging: remove Greg's TODO, now obsolete.
Brian Swetland [Thu, 21 Oct 2010 21:19:31 +0000 (14:19 -0700)]
staging: remove Greg's TODO, now obsolete.

Signed-off-by: Brian Swetland <swetland@google.com>
13 years agommc: Fix pm_notifier obeying deferred resume
Dmitry Shmidt [Thu, 14 Oct 2010 22:20:21 +0000 (15:20 -0700)]
mmc: Fix pm_notifier obeying deferred resume

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agomisc: kernel_debugger: fix handle_sysrq call
Erik Gilling [Tue, 31 Aug 2010 01:16:30 +0000 (18:16 -0700)]
misc: kernel_debugger: fix handle_sysrq call

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

13 years ago[ARM] fiq glue: Align fiq stacks
Colin Cross [Wed, 6 Oct 2010 05:08:01 +0000 (22:08 -0700)]
[ARM] fiq glue: Align fiq stacks

Change-Id: I956f05d0b0ce48572e611765e56a439dc036c052
Signed-off-by: Colin Cross <ccross@android.com>
13 years agommc: Add "ignore mmc pm notify" functionality
Dmitry Shmidt [Thu, 7 Oct 2010 21:39:16 +0000 (14:39 -0700)]
mmc: Add "ignore mmc pm notify" functionality

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years ago[ARM] fiq debugger: Allow selection of target cpu
Colin Cross [Sat, 2 Oct 2010 06:41:38 +0000 (23:41 -0700)]
[ARM] fiq debugger: Allow selection of target cpu

Change-Id: I676bac08ba12dfa506aea16800fc80432b4bc83d
Signed-off-by: Colin Cross <ccross@android.com>
13 years agommc: sdio: Fix enable_hs and enable_wide in sdio_reset_comm()
Dmitry Shmidt [Thu, 7 Oct 2010 00:25:02 +0000 (17:25 -0700)]
mmc: sdio: Fix enable_hs and enable_wide in sdio_reset_comm()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoARM: fiq debugger: Add tty to fiq debugger
Colin Cross [Mon, 16 Aug 2010 21:51:51 +0000 (14:51 -0700)]
ARM: fiq debugger: Add tty to fiq debugger

Change-Id: I80347cdb70cda104b96562c63f972c1f217e3822
Signed-off-by: Colin Cross <ccross@google.com>
13 years agoARM: Add generic fiq serial debugger
Iliyan Malchev [Sun, 6 Jun 2010 00:36:24 +0000 (17:36 -0700)]
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>
13 years agoARM: Add fiq_glue
Arve Hjønnevåg [Tue, 28 Sep 2010 00:50:00 +0000 (17:50 -0700)]
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>
13 years agoAllow CONFIG_STACKTRACE to be enabled by itself.
Arve Hjønnevåg [Thu, 3 Jun 2010 23:33:07 +0000 (16:33 -0700)]
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>
13 years agoSupport lseek(2) in ashmem driver
Bjorn Bringert [Thu, 26 Aug 2010 14:08:32 +0000 (15:08 +0100)]
Support lseek(2) in ashmem driver

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

13 years agommc: subtract boot sectors from disk size for eMMC 4.3+ devices
Gary King [Fri, 16 Jul 2010 00:11:32 +0000 (17:11 -0700)]
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>
13 years agommc_block: Allow more than 8 partitions per card
Colin Cross [Fri, 3 Sep 2010 19:41:21 +0000 (12:41 -0700)]
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>
13 years agoPM: Prevent waiting forever on asynchronous resume after abort
Colin Cross [Thu, 2 Sep 2010 01:35:55 +0000 (18:35 -0700)]
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>
13 years agopower: wakelock: call __get_wall_to_monotonic() instead of using wall_to_monotonic
Erik Gilling [Tue, 31 Aug 2010 01:22:20 +0000 (18:22 -0700)]
power: wakelock: call __get_wall_to_monotonic() instead of using wall_to_monotonic

Change-Id: I9e9c3b923bf9a22ffd48f80a72050289496e57d8

13 years agonet: Fix CONFIG_RPS option to be turned off
Dmitry Shmidt [Mon, 30 Aug 2010 17:29:37 +0000 (10:29 -0700)]
net: Fix CONFIG_RPS option to be turned off

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agowakelock: Fix operator precedence bug
Colin Cross [Sun, 22 Aug 2010 00:27:02 +0000 (17:27 -0700)]
wakelock: Fix operator precedence bug

Change-Id: I21366ace371d1b8f4684ddbe4ea8d555a926ac21
Signed-off-by: Colin Cross <ccross@google.com>
13 years agoashmem: Update arguments of shrinker for 2.6.35
Colin Cross [Sun, 22 Aug 2010 00:26:52 +0000 (17:26 -0700)]
ashmem: Update arguments of shrinker for 2.6.35

Change-Id: Ie527d18f3352ede06d565826c8d35ded1638203a
Signed-off-by: Colin Cross <ccross@google.com>
13 years agolowmemorykiller: Update arguments of shrinker for 2.6.35
Colin Cross [Sun, 22 Aug 2010 00:25:42 +0000 (17:25 -0700)]
lowmemorykiller: Update arguments of shrinker for 2.6.35

Change-Id: I6bb09b36639527f91c48704118acad5e50c4163f
Signed-off-by: Colin Cross <ccross@google.com>
13 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 (14:42 -0400)]
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>
13 years agoinput: gpio_event: make driver be more robust against incorrectly configured lvl...
Dima Zavin [Sat, 10 Apr 2010 06:26:09 +0000 (23:26 -0700)]
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>
13 years agoInput: gpio_event: Don't call gpio_cansleep before gpio_request.
Arve Hjønnevåg [Fri, 2 Apr 2010 02:52:27 +0000 (19:52 -0700)]
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>
13 years agoashmem: Fix ASHMEM_SET_PROT_MASK.
Arve Hjønnevåg [Thu, 15 Jul 2010 23:31:16 +0000 (16:31 -0700)]
ashmem: Fix ASHMEM_SET_PROT_MASK.

Change-Id: I1412cc9560de8c4feb1162fc30922f0e3362a476
Signed-off-by: Arve Hjønnevåg <arve@android.com>
13 years agoscheduler: cpuacct: Enable platform callbacks for cpuacct power tracking
Mike Chan [Wed, 12 May 2010 22:52:14 +0000 (15:52 -0700)]
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>
13 years agoscheduler: cpuacct: Enable platform hooks to track cpuusage for CPU frequencies
Mike Chan [Tue, 11 May 2010 00:54:48 +0000 (17:54 -0700)]
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>
13 years agomisc: add akm8975 compass driver
Colin Cross [Wed, 21 Apr 2010 02:54:09 +0000 (19:54 -0700)]
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>
13 years agodrivers: input: misc: Fix section mismatch warning
Dmitry Shmidt [Fri, 2 Jul 2010 19:48:48 +0000 (12:48 -0700)]
drivers: input: misc: Fix section mismatch warning

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoImplement read(2) in ashmem driver
Bjorn Bringert [Thu, 15 Apr 2010 09:04:01 +0000 (10:04 +0100)]
Implement read(2) in ashmem driver

Bug: 2595601
Change-Id: I47c0016f594f9354fb8658ccb26e3d395bcb137b
Signed-off-by: Bjorn Bringert <bringert@android.com>
13 years agonet: wireless: bcm4329: convert sempahore mutexes to real mutexes
Dima Zavin [Thu, 6 Jan 2011 00:04:43 +0000 (16:04 -0800)]
net: wireless: bcm4329: convert sempahore mutexes to real mutexes

Change-Id: I1cf1b0bfc2167d1be535d5066951796a569788e5
Signed-off-by: Dima Zavin <dima@android.com>
13 years agonetwork: wireless: bcm4329: Add bcm4329 driver
Dmitry Shmidt [Thu, 20 May 2010 01:53:11 +0000 (18:53 -0700)]
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>
13 years agonetwork: wireless: Add get_mac_addr functionality to platform
Dmitry Shmidt [Thu, 3 Jun 2010 17:55:33 +0000 (10:55 -0700)]
network: wireless: Add get_mac_addr functionality to platform

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agonet: activity_stats: Add statistics for network transmission activity
Mike Chan [Fri, 28 May 2010 21:32:19 +0000 (14:32 -0700)]
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>
13 years agostaging: android: lowmemorykiller: Remove bitrotted codepath
San Mehat [Thu, 6 May 2010 22:43:46 +0000 (15:43 -0700)]
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>
13 years agostaging: android: lowmemorykiller: Fix task_struct leak
San Mehat [Thu, 6 May 2010 22:40:07 +0000 (15:40 -0700)]
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>
13 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 (15:37 -0700)]
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>
13 years agobinder: Fix memory corruption via page aliasing
Christopher Lais [Sat, 1 May 2010 20:51:48 +0000 (15:51 -0500)]
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>
13 years agostaging: android: lowmemkiller: Substantially reduce overhead during reclaim
San Mehat [Wed, 5 May 2010 18:38:42 +0000 (11:38 -0700)]
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>
13 years ago[ARM] Do not call flush_cache_user_range with mmap_sem held
Dima Zavin [Wed, 28 Apr 2010 03:57:04 +0000 (20:57 -0700)]
[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>
13 years agolowmemorykiller: Don't try to kill the same pid over and over
San Mehat [Mon, 26 Apr 2010 22:11:04 +0000 (15:11 -0700)]
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>
13 years agoStaging: android: binder: Create dedicated workqueue for binder deferred work
Arve Hjønnevåg [Thu, 22 Apr 2010 22:53:23 +0000 (15:53 -0700)]
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>
13 years agoStaging: android: timed_gpio: Properly discard invalid timeout values.
Mike Lockwood [Sat, 17 Apr 2010 16:01:35 +0000 (12:01 -0400)]
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>
13 years agoandroid-common: include linux/slab.h
Arve Hjønnevåg [Wed, 21 Apr 2010 05:33:05 +0000 (22:33 -0700)]
android-common: include linux/slab.h

Change-Id: Ib9655177bfaf00bd5682e1ac0d7e813e16a47eea

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

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

Change-Id: Iaefeca497de02fe36b7f5d79075912f6e349ec53
Signed-off-by: Arve Hjønnevåg <arve@android.com>
13 years agobinder: Move debugging information from procfs to debugfs
Arve Hjønnevåg [Wed, 29 Apr 2009 03:57:50 +0000 (20:57 -0700)]
binder: Move debugging information from procfs to debugfs

Change-Id: Ia0f9c8cec68054c6600a799ef864ebf1185c93ab
Signed-off-by: Arve Hjønnevåg <arve@android.com>
13 years agobinder: Use seq_file for debug interface.
Arve Hjønnevåg [Wed, 29 Apr 2009 03:57:50 +0000 (20:57 -0700)]
binder: Use seq_file for debug interface.

Change-Id: I6e9c064ba024329099cb833b2ae9ab43c2ad8c6d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
13 years agofs: partitions: Fix warnings in fs/partitions/check.c
Colin Cross [Wed, 7 Apr 2010 19:08:27 +0000 (12:08 -0700)]
fs: partitions: Fix warnings in fs/partitions/check.c

Change-Id: I4398ace0c55d4833b1fcbb7a4e71ab8f0b1b044a
Signed-off-by: Colin Cross <ccross@android.com>
13 years agowlan: Extract generic wlan platform data from tiwlan specific header
Dmitry Shmidt [Thu, 18 Mar 2010 23:04:18 +0000 (16:04 -0700)]
wlan: Extract generic wlan platform data from tiwlan specific header

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoapanic: make APANIC_LABEL depend on APANIC
Iliyan Malchev [Wed, 17 Mar 2010 19:02:26 +0000 (12:02 -0700)]
apanic: make APANIC_LABEL depend on APANIC

Signed-off-by: Iliyan Malchev <malchev@google.com>
13 years agoandroid: logger: Add new system log for framework/system log messages
San Mehat [Wed, 24 Feb 2010 00:09:47 +0000 (16:09 -0800)]
android: logger: Add new system log for framework/system log messages

Signed-off-by: San Mehat <san@google.com>
13 years agopower: wakelock: Print active wakelocks when has_wake_lock() is called
Mike Chan [Tue, 16 Feb 2010 22:18:55 +0000 (14:18 -0800)]
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>
13 years agommc: core: Release delayed mmc work wakelock after deep disable
San Mehat [Tue, 9 Feb 2010 20:08:48 +0000 (12:08 -0800)]
mmc: core: Release delayed mmc work wakelock after deep disable

Signed-off-by: San Mehat <san@google.com>
13 years agoblock: genhd: Add disk/partition specific uevent callbacks for partition info
San Mehat [Sat, 10 Oct 2009 16:35:24 +0000 (09:35 -0700)]
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>
13 years agoStaging: android: timed_gpio: Request gpios.
Arve Hjønnevåg [Thu, 7 Jan 2010 01:17:33 +0000 (17:17 -0800)]
Staging: android: timed_gpio: Request gpios.

Change-Id: I9e98250a04e5505ce2db2edd355e8fdf8391cabd
Signed-off-by: Arve Hjønnevåg <arve@android.com>
13 years agoStaging: android: ram_console: Start ram console earlier
Arve Hjønnevåg [Fri, 18 Dec 2009 07:42:08 +0000 (23:42 -0800)]
Staging: android: ram_console: Start ram console earlier

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