Commit Graph

427832 Commits

Author SHA1 Message Date
Arve Hjønnevåg
1c2178bb25 ARM: etm: Support multiple ETMs/PTMs.
If more than one ETM or PTM are present, configure all of them
and enable the formatter in the ETB. This allows tracing on dual
core systems (e.g. omap4).

Change-Id: I028657d5cf2bee1b23f193d4387b607953b35888
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:08:04 -07:00
Arve Hjønnevåg
c191e33220 ARM: etm: Return the entire trace buffer if it is empty after reset
On some SOCs the read and write pointer are reset when the chip
resets, but the trace buffer content is preserved. If the status
bits indicates that the buffer is empty and we have never started
tracing, assume the buffer is full instead. This can be useful
if the system rebooted from a watchdog reset.

Change-Id: Iaf21c2c329c6059004ee1d38e3dfff66d7d28029
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:08:04 -07:00
Arve Hjønnevåg
d03740e2c5 ARM: etm: Add some missing locks and error checks
It is not safe to call etm_lock or etb_lock without holding the
mutex since another thread may also have unlocked the registers.

Also add some missing checks for valid etb_regs in the etm sysfs
entries.

Change-Id: I939f76a6ea7546a8fc0d4ddafa2fd2b6f38103bb
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:08:03 -07:00
Arve Hjønnevåg
4edf87412c ARM: etm: Configure data tracing
The old code enabled data tracing, but did not configure the
range. We now configure it to trace all data addresses by default,
and add a trace_data_range attribute to change the range or disable
data tracing.

Change-Id: I9d04e3e1ea0d0b4d4d5bcb93b1b042938ad738b2
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:08:03 -07:00
Arve Hjønnevåg
9d87d4816d ARM: etm: Allow range selection
Trace kernel text segment by default as before, allow tracing of other
ranges by writing a range to /sys/devices/etm/trace_range, or to trace
everything by writing 0 0.

Change-Id: Ibb734ca820fedf79560b20536247f1e1700cdc71
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:08:02 -07:00
Arve Hjønnevåg
18f1af0ee9 ARM: etm: Don't try to clear the buffer full status after reading the buffer
If the write address was at the end of the buffer, toggling the trace
capture bit would set the RAM-full status instead of clearing it, and
if any of the stop bits in the formatter is set toggling the trace
capture bit may not do anything.

Instead use the read position to find out if the data has already
been returned.

This also fixes the read function so it works when the trace buffer is
larger than the buffer passed in from user space. The old version
would reset the trace buffer pointers after every read, so the second
call to read would always return 0.

Change-Id: I75256abe2556adfd66fd5963e46f9e84ae4645e1
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:08:01 -07:00
Arve Hjønnevåg
a6ab901ca2 ARM: etm: Don't limit tracing to only non-secure code.
On some systems kernel code is considered secure, and this code
already limits tracing to the kernel text segment which results
in no trace data.

Change-Id: I098a0753e874859446d098e1ee209f67fc13cd5d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:08:01 -07:00
Arve Hjønnevåg
5925411429 ARM: etm: Don't require clock control
If clk_get fail, assume the etb does not need a separate clock.

Change-Id: Ia0bf3f5391e94a60ea45876aa7afc8a88a7ec3bf
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2014-03-19 13:08:00 -07:00
Chia-chi Yeh
e789079a1c net: Reorder incoming packets in PPPoLAC and PPPoPNS.
PPP handles packet loss but does not work with out of order packets.
This change performs reordering of incoming data packets within a
sliding window of one second. Since sequence number is optional,
receiving a packet without it will drop all queued packets.

Currently the logic is triggered by incoming packets, so queued
packets have to wait till another packet is arrived. It is done for
simplicity since no additional locks or threads are required. For
reliable protocols, a retransmission will kick it. For unreliable
protocols, queued packets just seem like packet loss. Time-critical
protocols might be broken, but they never work with queueing anyway.

Signed-off-by: Chia-chi Yeh <chiachi@android.com>
2014-03-19 13:08:00 -07:00
Mike Chan
4686353ef9 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
2014-03-19 13:07:59 -07:00
Todd Poynor
2fe6a44b9a ARM: Call idle notifiers
Change-Id: Id833e61c13baa1783705ac9e9046d1f0cc90c95e
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2014-03-19 13:07:58 -07:00
Todd Poynor
9edb824ebe Move x86_64 idle notifiers to generic
Move the x86_64 idle notifiers originally by Andi Kleen and Venkatesh
Pallipadi to generic.

Change-Id: Idf29cda15be151f494ff245933c12462643388d5
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2014-03-19 13:07:58 -07:00
Brian Swetland
b17599de9c staging: remove Greg's TODO, now obsolete.
Signed-off-by: Brian Swetland <swetland@google.com>
2014-03-19 13:07:57 -07:00
Iliyan Malchev
ed3116e0b9 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>
2014-03-19 13:07:56 -07:00
Arve Hjønnevåg
c4a48130f3 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>
2014-03-19 13:07:56 -07:00
Arve Hjønnevåg
ebb2ed762d 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>
2014-03-19 13:07:55 -07:00
Dmitry Shmidt
b866f6cb0e net: Fix CONFIG_RPS option to be turned off
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2014-03-19 13:07:55 -07:00
Mike Chan
c4edd8f916 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>
2014-03-19 13:07:54 -07:00
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