Commit Graph

427814 Commits

Author SHA1 Message Date
San Mehat
30afe7cff1 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>
2014-03-19 13:07:53 -07:00
San Mehat
764dec42a0 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>
2014-03-19 13:07:53 -07:00
Dmitry Shmidt
4f977a3d81 wlan: Extract generic wlan platform data from tiwlan specific header
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2014-03-19 13:07:52 -07:00
San Mehat
8ae3e16bac 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, and 'PARTNAME', which
specifies PARTNAME specifices the partition name of a partition device

Signed-off-by: Dima Zavin <dima@android.com>
2014-03-19 13:07:51 -07:00
San Mehat
4b152645ba proc: smaps: Allow smaps access for CAP_SYS_RESOURCE
Signed-off-by: San Mehat <san@google.com>
2014-03-19 13:07:51 -07:00
San Mehat
4eac1df4fe serial_core: Add wake_peer uart operation
Add wake_peer which is called before starting UART TX. The idea here
is to provide a mechanism where we can wakeup our peer before sending
data.

Change-Id: I42e0779b635f64ca99184b45d5b028de80197491
Signed-off-by: San Mehat <san@google.com>
2014-03-19 13:07:50 -07:00
Nick Pelly
eb503b3242 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>
2014-03-19 13:07:49 -07:00
Chia-chi Yeh
4a7cd990b3 net: Replace AID_NET_RAW checks with capable(CAP_NET_RAW).
Signed-off-by: Chia-chi Yeh <chiachi@android.com>
2014-03-19 13:07:49 -07:00
Chia-chi Yeh
d1f1fc1cfd security: Add AID_NET_RAW and AID_NET_ADMIN capability check in cap_capable().
Signed-off-by: Chia-chi Yeh <chiachi@android.com>
2014-03-19 13:07:43 -07:00
Chia-chi Yeh
d01b16094c 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>
2014-03-19 13:07:27 -07:00
Chia-chi Yeh
c80c1b3740 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>
2014-03-19 13:07:26 -07:00
Chia-chi Yeh
52c46e9afa 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>
2014-03-19 13:07:26 -07:00
San Mehat
16586560b6 fs: block_dump: Don't display inode changes if block_dump < 2
Signed-off-by: San Mehat <san@android.com>
2014-03-19 13:07:25 -07:00
Dmitry Shmidt
4a8ed9351b tiwlan: Add abstract wifi control functions support 2014-03-19 13:07:24 -07:00
Ken Sumrall
42c5a022d9 mmc: block: Improve logging of handling emmc timeouts
Add some logging to make it clear just how the emmc timeout
was handled.

Change-Id: Id33fd28d8b9778dc4e85db829e2637a328eddab4
Signed-off-by: Ken Sumrall <ksumrall@android.com>
2014-03-19 13:07:24 -07:00
Dmitry Shmidt
7e46e35c3e ARM: Add 'card_present' state to mmc_platfrom_data
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2014-03-19 13:07:23 -07:00
Colin Cross
33dddf786c Recreate asm/mach/mmc.h include file
Change-Id: I9f10244b0603f7842b8504a16124d40dc4a71ed2
Signed-off-by: Colin Cross <ccross@android.com>
2014-03-19 13:07:23 -07:00
Dmitry Shmidt
95fa148bfb mmc: Add "ignore mmc pm notify" functionality
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2014-03-19 13:07:22 -07:00
Dmitry Shmidt
fbfb4ccff0 mmc: sdio: Fix enable_hs and enable_wide in sdio_reset_comm()
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2014-03-19 13:07:22 -07:00
Daniel Chen
eab0831744 mmc: sdio: Add high speed support to sdio_reset_comm()
Signed-off-by: San Mehat <san@google.com>
2014-03-19 13:07:21 -07:00
Dmitry Shmidt
92b61cdbcb mmc: sdio: Claim host in sdio_reset_comm()
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2014-03-19 13:07:21 -07:00
San Mehat
4f46706784 mmc: mmcblk: Add support for deferred SD bus resume
Signed-off-by: San Mehat <san@google.com>

mmc: card: Add MMC_BLOCK_DEFERRED_RESUME option to Kconfig

Signed-off-by: San Mehat <san@google.com>
2014-03-19 13:07:20 -07:00
San Mehat
08054072af mmc: core: Hold a wake lock accross delayed work + mmc rescan
Signed-off-by: San Mehat <san@android.com>

mmc: core: Rework mmc_delayed_work wakelock so that the wakelock is only extended if a card is added or removed.

Signed-off-by: San Mehat <san@google.com>
2014-03-19 13:07:19 -07:00
San Mehat
0ee3492a10 mmc: sd: Add retries in re-detection
Signed-off-by: San Mehat <san@android.com>

mmc: sd: Remove debugging printk

Signed-off-by: Dima Zavin <dima@android.com>
2014-03-19 13:07:19 -07:00
San Mehat
b0c5c06400 mmc: sd: When resuming, try a little harder to init the card
Signed-off-by: San Mehat <san@android.com>
2014-03-19 13:07:18 -07:00
San Mehat
ec3730bc56 mmc: Add new API call 'sdio_reset_comm' for resetting communication with an SDIO device
Signed-off-by: San Mehat <san@android.com>
2014-03-19 13:07:18 -07:00
Dmitry Shmidt
06c11cba79 trout: Add functions for WiFi 2014-03-19 13:07:17 -07:00
San Mehat
545e0a7df9 mmc: Add concept of an 'embedded' SDIO device.
This is required to support chips which use SDIO for signaling/
communication but do not implement the various card enumeration registers
as required for full SD / SDIO cards.

mmc: sdio: Fix bug where we're freeing the CIS tables we never allocated when using EMBEDDED_SDIO
mmc: Add max_blksize to embedded SDIO data

Signed-off-by: San Mehat <san@google.com>
2014-03-19 13:07:16 -07:00
San Mehat
ab4cdccd72 mmc: sd: Add new CONFIG_MMC_PARANOID_SD_INIT for enabling retries during SD detection
Signed-off-by: San Mehat <san@google.com>
2014-03-19 13:07:16 -07:00
San Mehat
3638fe267b mmc: Add status IRQ and status callback function to mmc platform data
Signed-off-by: San Mehat <san@google.com>
2014-03-19 13:07:15 -07:00
Mike Lockwood
af4058dce0 input: keychord: Add keychord driver
This driver allows userspace to receive notification when client
specified key combinations are pressed.
The client opens /dev/keychord and writes a list of keychords
for the driver to monitor.
The client then reads or polls /dev/keychord for notifications.
A client specified ID for the keychord is returned from read()
when a keychord press is detected.

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

keychord: fix to build without CONFIG_PREEMPT

Change-Id: I911f13aeda4224b6fa57863bc7e8972fec8837fb
2014-03-19 13:07:15 -07:00
Arve Hjønnevåg
19e929a1da input: Add keyreset driver.
Add a platform device in the board file to specify a reset key-combo.
The first time the key-combo is detected a work function that syncs
the filesystems is scheduled. If all the keys are released and then
pressed again, it calls panic. Reboot on panic should be set for
this to work.

Change-Id: I9d54283ca1fba45e4b1ae1a407524cdda8171143
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:07:14 -07:00
Colin Cross
391f7b69c8 input: misc: gpio_event: remove early suspend
Remove the early suspend handler.  Leave the suspend functions
for now, they should eventually get called through a userspace
interface.x

Change-Id: I67f9dafe32fe32577bab93c42b95824db96c215c
Signed-off-by: Colin Cross <ccross@android.com>
2014-03-19 13:07:13 -07:00
Arve Hjønnevåg
4bed7c9c3c Input: Generic GPIO Input device.
Supports keyboard matrixces, direct inputs, direct outputs and axes connected to gpios.

Change-Id: I5e921e6e3a1cc169316ee3b665f4cc21b5735114
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Nick Pelly <npelly@google.com>
2014-03-19 13:07:13 -07:00
Mike Chan
38c987824e Grants system server access to /proc/<pid>/oom_adj for Android applications.
Signed-off-by: Brian Swetland <swetland@google.com>
2014-03-19 13:07:12 -07:00
Mike Chan
33642d4e8f misc: uidstat: Adding uid stat driver to collect network statistics.
Signed-off-by: Mike Chan <mike@android.com>
2014-03-19 13:07:12 -07:00
Robert Love
e75bc32498 sysfs_net_ipv4: Add sysfs-based knobs for controlling TCP window size
Add a family of knobs to /sys/kernel/ipv4 for controlling the TCP window size:

	tcp_wmem_min
	tcp_wmem_def
	tcp_wmem_max
	tcp_rmem_min
	tcp_rmem_def
	tcp_rmem_max

This six values mirror the sysctl knobs in /proc/sys/net/ipv4/tcp_wmem and
/proc/sys/net/ipv4/tcp_rmem.

Sysfs, unlike sysctl, allows us to set and manage the files' permissions and
owners.

Signed-off-by: Robert Love <rlove@google.com>
2014-03-19 13:07:11 -07:00
Robert Love
d741a9dcd3 net: socket ioctl to reset connections matching local address
Introduce a new socket ioctl, SIOCKILLADDR, that nukes all sockets
bound to the same local address. This is useful in situations with
dynamic IPs, to kill stuck connections.

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

net: fix tcp_v4_nuke_addr

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

net: ipv4: Fix a spinlock recursion bug in tcp_v4_nuke.

We can't hold the lock while calling to tcp_done(), so we drop
it before calling. We then have to start at the top of the chain again.

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

net: ipv4: Fix race in tcp_v4_nuke_addr().

To fix a recursive deadlock in 2.6.29, we stopped holding the hash table lock
across tcp_done() calls. This fixed the deadlock, but introduced a race where
the socket could die or change state.

Fix: Before unlocking the hash table, we grab a reference to the socket. We
can then unlock the hash table without risk of the socket going away. We then
lock the socket, which is safe because it is pinned. We can then call
tcp_done() without recursive deadlock and without race. Upon return, we unlock
the socket and then unpin it, killing it.

Change-Id: Idcdae072b48238b01bdbc8823b60310f1976e045
Signed-off-by: Robert Love <rlove@google.com>
Acked-by: Dima Zavin <dima@android.com>

ipv4: disable bottom halves around call to tcp_done().

Signed-off-by: Robert Love <rlove@google.com>
Signed-off-by: Colin Cross <ccross@android.com>

ipv4: Move sk_error_report inside bh_lock_sock in tcp_v4_nuke_addr

When sk_error_report is called, it wakes up the user-space thread, which then
calls tcp_close.  When the tcp_close is interrupted by the tcp_v4_nuke_addr
ioctl thread running tcp_done, it leaks 392 bytes and triggers a WARN_ON.

This patch moves the call to sk_error_report inside the bh_lock_sock, which
matches the locking used in tcp_v4_err.

Signed-off-by: Colin Cross <ccross@android.com>
2014-03-19 13:07:10 -07:00
Robert Love
819819e11d Paranoid network.
With CONFIG_ANDROID_PARANOID_NETWORK, require specific uids/gids to instantiate
network sockets.

Signed-off-by: Robert Love <rlove@google.com>

paranoid networking: Use in_egroup_p() to check group membership

The previous group_search() caused trouble for partners with module builds.
in_egroup_p() is also cleaner.

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

Fix 2.6.29 build.

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

net: Fix compilation of the IPv6 module

Fix compilation of the IPv6 module -- current->euid does not exist anymore,
current_euid() is what needs to be used.

Signed-off-by: Steinar H. Gunderson <sesse@google.com>

net: bluetooth: Remove the AID_NET_BT* gid numbers

Removed bluetooth checks for AID_NET_BT and AID_NET_BT_ADMIN
which are not useful anymore.
This is in preparation for getting rid of all the AID_* gids.

Signed-off-by: JP Abgrall <jpa@google.com>
2014-03-19 13:07:10 -07:00
John Stultz
b86a4974e5 ashmem: Add shmem_set_file to mm/shmem.c
NOT FOR STAGING
This patch re-adds the original shmem_set_file to mm/shmem.c
and converts ashmem.c back to using it.

CC: Brian Swetland <swetland@google.com>
CC: Colin Cross <ccross@android.com>
CC: Arve Hjønnevåg <arve@android.com>
CC: Dima Zavin <dima@android.com>
CC: Robert Love <rlove@google.com>
CC: Greg KH <greg@kroah.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2014-03-19 13:07:09 -07:00
Robert Love
c248d94723 Add android_aid.h
Add <linux/android_aid.h>, our mapping of AID defines to gid numbers.

Change-Id: I3a02eb2b5c7e336e3de0cb45d8e04ec82f7281b4
Signed-off-by: Robert Love <rlove@google.com>
2014-03-19 13:07:04 -07:00
Arve Hjønnevåg
6e71fda4b3 Input: evdev - Add ioctl to block suspend while event queue is not empty.
Add an ioctl, EVIOCSSUSPENDBLOCK, to enable a wakelock that will block
suspend while the event queue is not empty. This allows userspace code to
process input events while the device appears to be asleep.

The current code holds the wakelock for up 5 seconds for every input
device and client. This can prevent suspend if sensor with a high data
rate is active, even when that sensor is not capable of waking the
device once it is suspended.

Change-Id: I624d66ef30a0b3abb543685c343382b8419b42b9
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:02:05 -07:00
Colin Cross
32a771aaf0 HACK: input: evdev: disable EVIOCREVOKE
Android used the same ioctl signature as EVOICREVOKE for
EVIOCSSUSPENDBLOCK.  Disable EVIOCREVOKE until Android userspace
is available that uses EPOLLWAKEUP instead.

Change-Id: I51aa63fd19b20a3966bef1c46d1bb845c2589a5a
Signed-off-by: Colin Cross <ccross@android.com>
2014-03-19 13:02:04 -07:00
Mike Lockwood
625c814c7d switch: switch class and GPIO drivers.
switch: Export symbol switch_set_state.

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

switch: gpio: Don't call request_irq with interrupts disabled

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

switch: Use device_create instead of device_create_drvdata.

device_create_drvdata is obsolete.

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

switch_gpio: Add missing #include <linux/interrupt.h>

Change-Id: I6c397e41bbe1457162cc69e31a29db5d9f76fccb
Signed-off-by: Mike Lockwood <lockwood@android.com>
2014-03-19 13:02:04 -07:00
Arve Hjønnevåg
81e2149523 PM / Sleep: Add wake lock api wrapper on top of wakeup sources
Change-Id: Icaad02fe1e8856fdc2e4215f380594a5dde8e002
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:02:03 -07:00
Mike Chan
c09eab911f [docs] android: Add android config documentation to boot framework.
Signed-off-by: Mike Chan <mike@android.com>
2014-03-19 13:02:02 -07:00
Arve Hjønnevåg
ab70336ac3 [ARM] Optionally flush entire dcache from v6_dma_flush_range
If CACHE_FLUSH_RANGE_LIMIT is defined, then the entire dcache will
be flushed if the requested range is larger than this limit.

Change-Id: I29277d645a9d6716b1952cf3b870c78496261dd0
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:02:02 -07:00
Arve Hjønnevåg
46123744a1 mm: Add min_free_order_shift tunable.
By default the kernel tries to keep half as much memory free at each
order as it does for one order below. This can be too agressive when
running without swap.

Change-Id: I5efc1a0b50f41ff3ac71e92d2efd175dedd54ead
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:02:01 -07:00
Arve Hjønnevåg
65d58dbb17 [ARM] armv6 dcc tty driver
Signed-off-by: Brian Swetland <swetland@google.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:02:01 -07:00
Tony Lindgren
eada7ab14e ARM: Make low-level printk work
Makes low-level printk work.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2014-03-19 13:02:00 -07:00