7 years agoARM: mm: cache-l2x0: use L2X0_CACHE_ID_PART_MASK to get cache-id
Varun Wadekar [Tue, 17 Apr 2012 07:29:57 +0000]
ARM: mm: cache-l2x0: use L2X0_CACHE_ID_PART_MASK to get cache-id

l2x0_unlock does not use L2X0_CACHE_ID_PART_MASK to get the
actual cache-id, thus always iterating over only one I and
one D lockdown register.

Change-Id: I485a0564103a620f4aed80133403eea37ca27fb0
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: mm: cache-l2x0: replace printk with pr_info_once in l2x0_init
Varun Wadekar [Tue, 17 Apr 2012 07:28:38 +0000]
ARM: mm: cache-l2x0: replace printk with pr_info_once in l2x0_init

printk causes device resume to hang in a recursive loop. Hence
switch over to pr_info_once.

Change-Id: I4540c274b86e8d791b509667edefac3b3565973c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoRevert "SUNRPC: create unix gid cache per network namespace"
Varun Wadekar [Mon, 16 Apr 2012 14:21:57 +0000]
Revert "SUNRPC: create unix gid cache per network namespace"

This reverts commit 73393232d6a425b6bb4cee590e3e66fc52532a15 since
it causes a crash in net/sunrpc/cache.c:cache_clean() during bootup.

Conflicts:

net/sunrpc/netns.h
net/sunrpc/sunrpc_syms.c

Change-Id: Ic113234738fd7270e3f66efe524773a183399099
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agonet: bluetooth: smp: fix compilation issues with 3.4
Varun Wadekar [Mon, 16 Apr 2012 13:03:19 +0000]
net: bluetooth: smp: fix compilation issues with 3.4

Change-Id: I43f4c22fbe9077ff25bb5e1d58b526c810f2bd87
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agocgroup: fix compilations issues with 3.4
Varun Wadekar [Mon, 16 Apr 2012 10:11:58 +0000]
cgroup: fix compilations issues with 3.4

Change-Id: I156a2ba21aa973ee6b528f222861742b2af91341
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agonet: wireless: bcmdhd: delete dhd_common_deinit
Varun Wadekar [Mon, 16 Apr 2012 10:11:01 +0000]
net: wireless: bcmdhd: delete dhd_common_deinit

Change-Id: I9a364d9eff931f373ae4547e82274637502958bf
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoinput: evdev: remove duplicate suspend/resume functions
Varun Wadekar [Mon, 16 Apr 2012 10:10:10 +0000]
input: evdev: remove duplicate suspend/resume functions

Change-Id: Ib49b64510bbf974b7d4e92021e4cefa7d8e088e5
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agonet: ppp: replace PPP_MTU with PPP_MRU
Varun Wadekar [Mon, 16 Apr 2012 10:09:30 +0000]
net: ppp: replace PPP_MTU with PPP_MRU

Change-Id: I0372a53147181a165560589f6214b715b8fb4e7b
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agonet: wireless: bcmdhd: Update to version 1.26
Dmitry Shmidt [Sat, 14 Apr 2012 01:36:06 +0000]
net: wireless: bcmdhd: Update to version 1.26

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

7 years agoARM: etm: Add sysfs entry to enable return stack if supported
Arve Hjønnevåg [Wed, 4 Apr 2012 01:01:03 +0000]
ARM: etm: Add sysfs entry to enable return stack if supported

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

7 years agoARM: etm: Add sysfs entry to disable branch_output flag
Arve Hjønnevåg [Tue, 3 Apr 2012 23:15:36 +0000]
ARM: etm: Add sysfs entry to disable branch_output flag

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

7 years agoARM: etm: Add sysfs entry to set context-id-size
Arve Hjønnevåg [Tue, 3 Apr 2012 00:20:32 +0000]
ARM: etm: Add sysfs entry to set context-id-size

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

7 years agoARM: etm: Add sysfs entry to enable timestamps if supported
Arve Hjønnevåg [Tue, 3 Apr 2012 00:20:32 +0000]
ARM: etm: Add sysfs entry to enable timestamps if supported

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

7 years agoARM: etm: Check arch version and disable data tracing for ptm
Arve Hjønnevåg [Tue, 3 Apr 2012 03:18:56 +0000]
ARM: etm: Check arch version and disable data tracing for ptm

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

7 years agoARM: etm: Wait for etm/ptm(s) to stop before requesting PowerDown
Arve Hjønnevåg [Thu, 29 Mar 2012 04:03:13 +0000]
ARM: etm: Wait for etm/ptm(s) to stop before requesting PowerDown

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

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

7 years agoandroid: ram_console: use platform_device_register
Colin Cross [Thu, 12 Apr 2012 21:55:21 +0000]
android: ram_console: use platform_device_register

platform_driver_probe can only be used when the platform device
is already present.  In order to enable debugging crashes during
very early boot, the ram_console driver needs to be registered
as early as possible to allow the device to probe as soon as it
is registered at arch_initcall time.  This requires the driver
to be registered before the device.

Replace platform_driver_probe with platform_driver_register,
and make the ram_console probe function __devinit.

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

7 years agonet: wireless: bcmdhd: Update to Version 6.10.83.0 (1.23)
Dmitry Shmidt [Mon, 16 Apr 2012 09:36:30 +0000]
net: wireless: bcmdhd: Update to Version 6.10.83.0 (1.23)

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

Conflicts:

drivers/net/wireless/bcmdhd/dhd.h
drivers/net/wireless/bcmdhd/dhd_common.c
drivers/net/wireless/bcmdhd/dhd_sdio.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoHACK: bcmdhd: fix compile for 3.4
Colin Cross [Wed, 4 Apr 2012 20:53:41 +0000]
HACK: bcmdhd: fix compile for 3.4

Disable the removed set_beacon/add_beacon interface, and add the
new dBm parameter to cfg80211_rx_mgmt.

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

7 years agogpu: ion: ion_carveout_heap: fix for 3.4
Colin Cross [Wed, 4 Apr 2012 20:50:43 +0000]
gpu: ion: ion_carveout_heap: fix for 3.4

__arch_ioremap is no longer available, use __arm_ioremap instead.

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

7 years agoandroid: persistent_ram: move persistent_ram.h back to include/linux
Colin Cross [Mon, 16 Apr 2012 09:32:38 +0000]
android: persistent_ram: move persistent_ram.h back to include/linux

When persistent_ram went in to staging, persistent_ram.h was moved
from include/linux to driver/staging/android.  To avoid having to
fix all the users, move it back to include/linux.

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

Conflicts:

drivers/staging/android/persistent_ram.c
drivers/staging/android/ram_console.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoandroid: persistent_ram: fix printk size_t warning
Colin Cross [Wed, 4 Apr 2012 20:37:43 +0000]
android: persistent_ram: fix printk size_t warning

Fix warning in printks by using %zu for size_t variables.

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

7 years agousb: gadget: adb: Only enable the gadget when adbd is ready
Benoit Goby [Tue, 20 Mar 2012 01:56:52 +0000]
usb: gadget: adb: Only enable the gadget when adbd is ready

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

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

Change-Id: Id54ff85aec9cf8715c94b4f9bd6137a79ad58bfc
Signed-off-by: Benoit Goby <benoit@android.com>

7 years agoandroid: logger: Allow a UID to read it's own log entries
Nick Kralevich [Thu, 23 Feb 2012 18:09:06 +0000]
android: logger: Allow a UID to read it's own log entries

Modify the kernel logger to record the UID associated with
the log entries. Always allow the same UID which generated a
log message to read the log message.

Allow anyone in the logs group, or anyone with CAP_SYSLOG, to
read all log entries.

In addition, allow the client to upgrade log formats, so they
can get additional information from the kernel.

Change-Id: Ie48fb614b43c9302a07ad2673b78dd8749b492b6
Signed-off-by: Nick Kralevich <nnk@google.com>

7 years agoARM: fiq_debugger: add support for reboot commands
Colin Cross [Wed, 14 Mar 2012 23:29:47 +0000]
ARM: fiq_debugger: add support for reboot commands

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

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

7 years agoARM: fiq_debugger: fix compiling for v3.3
Colin Cross [Mon, 16 Apr 2012 09:29:24 +0000]
ARM: fiq_debugger: fix compiling for v3.3

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

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

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

Conflicts:

arch/arm/common/fiq_debugger.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoandroid: persistent_trace: fix section mismatch warning
Colin Cross [Tue, 13 Mar 2012 20:14:31 +0000]
android: persistent_trace: fix section mismatch warning

persistent_trace_probe can be calls persistent_ram init
functions that are __devinit, mark it __devinit as well.

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

7 years agousb: gadget: adb: do not set error flag when dequeuing req
Colin Cross [Fri, 9 Mar 2012 01:57:51 +0000]
usb: gadget: adb: do not set error flag when dequeuing req

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

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

7 years agousb: gadget: adb: allow freezing in adb_read
Colin Cross [Mon, 5 Mar 2012 21:29:45 +0000]
usb: gadget: adb: allow freezing in adb_read

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

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

7 years agoandroid: persistent_trace: ftrace into persistent_ram
Colin Cross [Mon, 16 Apr 2012 09:28:18 +0000]
android: persistent_trace: ftrace into persistent_ram

persistent_trace uses the ftrace infrastructure, but traces
into a persistent_ram buffer instead of the regular ftrace
ringbuffer.  After a reset or panic, the trace can be
decoded with cat /sys/kernel/debug/persistent_trace.

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

Conflicts:

drivers/staging/android/trace_persistent.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoRevert "HACK: android-alarm: wakelock workaround"
Colin Cross [Mon, 16 Apr 2012 09:27:12 +0000]
Revert "HACK: android-alarm: wakelock workaround"

This reverts commit 1f1a4544e5196a8e30cec7a21724e190bb51a2df.

Conflicts:

drivers/staging/android/alarm-dev.c
drivers/staging/android/alarm.c

Change-Id: I5717b7736b10de3a288613c8a7e4e5281c78fcaf

Conflicts:

drivers/staging/android/alarm-dev.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoandroid-alarm: Remove unused android alarm in-kernel interfaces
John Stultz [Fri, 27 Jan 2012 08:16:31 +0000]
android-alarm: Remove unused android alarm in-kernel interfaces

Now that alarm-dev.c uses the upstreamed alarmtimer interfaces,
we can remove the otherwise unused in-kernel android alarm api.

Signed-off-by: John Stultz <john.stultz@linaro.org>

7 years agoandroid-alarm: Rework alarm-dev.c to use upstreamed alarmtimers
John Stultz [Mon, 16 Apr 2012 09:26:00 +0000]
android-alarm: Rework alarm-dev.c to use upstreamed alarmtimers

This reworks the alarm-dev.c to use the upstreamed alarmtimers
interface.

Signed-off-by: John Stultz <john.stultz@linaro.org>

Conflicts:

drivers/staging/android/alarm-dev.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoandroid-alarm: Convert ALARM_ELAPSED_REALTIME to use CLOCK_BOOTTIME
John Stultz [Wed, 22 Jun 2011 00:01:27 +0000]
android-alarm: Convert ALARM_ELAPSED_REALTIME to use CLOCK_BOOTTIME

The ALARM_ELAPSED_REALTIME clock domain in Android pointed
to the need for something similar in linux system-wide
(instead of limited to just the alarm interface).

Thus CLOCK_BOOTTIME was introduced into the upstream kernel
in 2.6.39.

This patch attempts to convert the android alarm timer to utilize
the kernel's CLOCK_BOOTTIME clockid for ALARM_ELAPSED_REALTIME,
instead of managing it itself.

Change-Id: I4867ed2823ebb29d27c53f236c6a3dbb47f3ac78
Signed-off-by: John Stultz <john.stultz@linaro.org>

7 years agousb: gadget: accessory: Add Android Accessory function
Benoit Goby [Mon, 16 Apr 2012 09:25:05 +0000]
usb: gadget: accessory: Add Android Accessory function

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

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

Conflicts:

drivers/usb/gadget/android.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agousb: gadget: adb: Add ADB function
Benoit Goby [Mon, 16 Apr 2012 09:24:32 +0000]
usb: gadget: adb: Add ADB function

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

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

Conflicts:

drivers/usb/gadget/f_adb.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agousb: gadget: mtp: Add MTP/PTP function
Benoit Goby [Mon, 16 Apr 2012 09:23:11 +0000]
usb: gadget: mtp: Add MTP/PTP function

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

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

Conflicts:

drivers/usb/gadget/android.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agousb: gadget: Add Android Composite Gadget driver
Benoit Goby [Mon, 16 Apr 2012 09:22:36 +0000]
usb: gadget: Add Android Composite Gadget driver

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

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

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

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

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

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

Conflicts:

drivers/usb/gadget/android.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agonetfilter: add xt_qtaguid matching module
JP Abgrall [Mon, 20 Jun 2011 19:41:46 +0000]
netfilter: add xt_qtaguid matching module

This module allows tracking stats at the socket level for given UIDs.
It replaces xt_owner.
If the --uid-owner is not specified, it will just count stats based on
who the skb belongs to. This will even happen on incoming skbs as it
looks into the skb via xt_socket magic to see who owns it.
If an skb is lost, it will be assigned to uid=0.

To control what sockets of what UIDs are tagged by what, one uses:
  echo t $sock_fd $accounting_tag $the_billed_uid \
     > /proc/net/xt_qtaguid/ctrl
 So whenever an skb belongs to a sock_fd, it will be accounted against
   $the_billed_uid
  and matching stats will show up under the uid with the given
   $accounting_tag.

Because the number of allocations for the stats structs is not that big:
  ~500 apps * 32 per app
we'll just do it atomic. This avoids walking lists many times, and
the fancy worker thread handling. Slabs will grow when needed later.

It use netdevice and inetaddr notifications instead of hooks in the core dev
code to track when a device comes and goes. This removes the need for
exposed iface_stat.h.

Put procfs dirs in /proc/net/xt_qtaguid/
  ctrl
  stats
  iface_stat/<iface>/...
The uid stats are obtainable in ./stats.

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

7 years agonet: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
Dmitry Shmidt [Fri, 28 Oct 2011 17:35:37 +0000]
net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT

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

7 years agonet: wireless: Add CFG80211_ALLOW_RECONNECT option
Dmitry Shmidt [Thu, 15 Sep 2011 16:22:35 +0000]
net: wireless: Add CFG80211_ALLOW_RECONNECT option

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

7 years agonet: wireless: Add get_country_code functionality to platform
Dmitry Shmidt [Tue, 15 Feb 2011 00:58:48 +0000]
net: wireless: Add get_country_code functionality to platform

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 agoARM: etm: Power down etm(s) when tracing is not enabled
Arve Hjønnevåg [Thu, 24 Feb 2011 00:51:58 +0000]
ARM: etm: Power down etm(s) when tracing is not enabled

Without this change a saw an 18% increase in idle power consumption
on one deivce when trace support is compiled into the kernel. Now
I see the same increase only when tracing.

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

7 years agoARM: etm: Support multiple ETMs/PTMs.
Arve Hjønnevåg [Mon, 16 Apr 2012 07:57:02 +0000]
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>

Conflicts:

arch/arm/kernel/etm.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: etm: Return the entire trace buffer if it is empty after reset
Arve Hjønnevåg [Mon, 16 Apr 2012 07:56:13 +0000]
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>

Conflicts:

arch/arm/kernel/etm.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: etm: Add some missing locks and error checks
Arve Hjønnevåg [Mon, 16 Apr 2012 07:55:42 +0000]
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>

Conflicts:

arch/arm/kernel/etm.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: etm: Configure data tracing
Arve Hjønnevåg [Mon, 16 Apr 2012 07:55:09 +0000]
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>

Conflicts:

arch/arm/kernel/etm.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: etm: Allow range selection
Arve Hjønnevåg [Mon, 16 Apr 2012 07:54:24 +0000]
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>

Conflicts:

arch/arm/kernel/etm.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: etm: Don't try to clear the buffer full status after reading the buffer
Arve Hjønnevåg [Mon, 16 Apr 2012 07:53:27 +0000]
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>

Conflicts:

arch/arm/kernel/etm.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agonet: Reorder incoming packets in PPPoLAC and PPPoPNS.
Chia-chi Yeh [Fri, 15 Apr 2011 22:22:09 +0000]
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>

7 years agoMove x86_64 idle notifiers to generic
Todd Poynor [Thu, 16 Jun 2011 00:21:57 +0000]
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>

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 agoARM: Add fiq_glue
Arve Hjønnevåg [Mon, 16 Apr 2012 07:47:46 +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>

Conflicts:

arch/arm/common/Kconfig
arch/arm/common/Makefile
arch/arm/common/fiq_glue_setup.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.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: 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 agowlan: Extract generic wlan platform data from tiwlan specific header
Dmitry Shmidt [Mon, 16 Apr 2012 07:41:49 +0000]
wlan: Extract generic wlan platform data from tiwlan specific header

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

Conflicts:

include/linux/wifi_tiwlan.h
include/linux/wlan_plat.h

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoBluetooth: Use the stored LTK for restabilishing security
Vinicius Costa Gomes [Thu, 7 Jul 2011 21:59:41 +0000]
Bluetooth: Use the stored LTK for restabilishing security

Now that it's possible that the exchanged key is present in
the link key list, we may be able to estabilish security with
an already existing key, without need to perform any SMP
procedure.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>

7 years agoBluetooth: Allow SCO/eSCO packet type selection for outgoing SCO connections.
Nick Pelly [Mon, 16 Apr 2012 07:40:41 +0000]
Bluetooth: Allow SCO/eSCO packet type selection for outgoing SCO connections.

__u16 sco_pkt_type is introduced to struct sockaddr_sco. It allows bitwise
selection of SCO/eSCO packet types. Currently those bits are:

0x0001 HV1 may be used.
0x0002 HV2 may be used.
0x0004 HV3 may be used.
0x0008 EV3 may be used.
0x0010 EV4 may be used.
0x0020 EV5 may be used.
0x0040 2-EV3 may be used.
0x0080 3-EV3 may be used.
0x0100 2-EV5 may be used.
0x0200 3-EV5 may be used.

This is similar to the Packet Type parameter in the HCI Setup Synchronous
Connection Command, except that we are not reversing the logic on the EDR bits.
This makes the use of sco_pkt_tpye forward portable for the use case of
white-listing packet types, which we expect will be the primary use case.

If sco_pkt_type is zero, or userspace uses the old struct sockaddr_sco,
then the default behavior is to allow all packet types.

Packet type selection is just a request made to the Bluetooth chipset, and
it is up to the link manager on the chipset to negiotiate and decide on the
actual packet types used. Furthermore, when a SCO/eSCO connection is eventually
made there is no way for the host stack to determine which packet type was used
(however it is possible to get the link type of SCO or eSCO).

sco_pkt_type is ignored for incoming SCO connections. It is possible
to add this in the future as a parameter to the Accept Synchronous Connection
Command, however its a little trickier because the kernel does not
currently preserve sockaddr_sco data between userspace calls to accept().

The most common use for sco_pkt_type will be to white-list only SCO packets,
which can be done with the hci.h constant SCO_ESCO_MASK.

This patch is motivated by broken Bluetooth carkits such as the Motorolo
HF850 (it claims to support eSCO, but will actually reject eSCO connections
after 5 seconds) and the 2007/2008 Infiniti G35/37 (fails to route audio
if a 2-EV5 packet type is negiotiated). With this patch userspace can maintain
a list of compatible packet types to workaround remote devices such as these.

Based on a patch by Marcel Holtmann.

Rebased to 2.6.39.

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

Conflicts:

net/bluetooth/mgmt.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agowl127x-rfkill: Add power control driver for TI WL127X Bluetooth chips
Nick Pelly [Mon, 16 Apr 2012 07:39:22 +0000]
wl127x-rfkill: Add power control driver for TI WL127X Bluetooth chips

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

Conflicts:

drivers/misc/Kconfig
drivers/misc/Makefile

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoprintk: update log_buf_copy for 3.3
Colin Cross [Thu, 2 Feb 2012 00:02:23 +0000]
printk: update log_buf_copy for 3.3

logbuf_lock is a raw spinlock in 3.3, replace spin_(un)lock_irq
with raw_spin_(un)lock_irq.

Change-Id: I4b13c6a34bcbcbe95ef28ac3aec0528deef7fa9d
Signed-off-by: Colin Cross <ccross@android.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 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 [Mon, 16 Apr 2012 07:38:06 +0000]
Revert "printk: remove unused code from kernel/printk.c"

This reverts commit acff181d3574244e651913df77332e897b88bff4.

Conflicts:

kernel/printk.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

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 [Mon, 16 Apr 2012 07:36:29 +0000]
security: Add AID_NET_RAW and AID_NET_ADMIN capability check in cap_capable().

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

Conflicts:

security/commoncap.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.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 [Mon, 16 Apr 2012 07:35:43 +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>

Conflicts:

drivers/net/ppp/Makefile
drivers/net/ppp/pppopns.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agonet: add PPP on L2TP Access Concentrator (PPPoLAC) driver.
Chia-chi Yeh [Mon, 16 Apr 2012 07:33:18 +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>

Conflicts:

drivers/net/ppp/Kconfig
drivers/net/ppp/Makefile
drivers/net/ppp/pppolac.c
include/linux/if_pppox.h

Signed-off-by: Varun Wadekar <vwadekar@nvidia.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 [Mon, 16 Apr 2012 07:29:14 +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>

Conflicts:

fs/yaffs2/yaffs_vfs.c
fs/yaffs2/yportenv.h

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agotiwlan: Add abstract wifi control functions support
Dmitry Shmidt [Mon, 16 Apr 2012 07:27:29 +0000]
tiwlan: Add abstract wifi control functions support

Conflicts:

include/linux/wifi_tiwlan.h

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agommc: core: host: only use wakelock for detect work
Colin Cross [Mon, 16 Apr 2012 07:25:58 +0000]
mmc: core: host: only use wakelock for detect work

There is no need to take a wakelock for delayed lazy disable
work, it will be cancelled in the suspend handler and force
disabled.  Only take the wakelock when the detect work is
queued, and make sure to drop the wakelock if the work is
cancelled.

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

Conflicts:

drivers/mmc/core/core.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.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 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 agommc: sdio: Add high speed support to sdio_reset_comm()
Daniel Chen [Wed, 9 Dec 2009 17:45:36 +0000]
mmc: sdio: Add high speed support to sdio_reset_comm()

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

7 years agommc: sdio: Claim host in sdio_reset_comm()
San Mehat [Mon, 16 Apr 2012 07:23:57 +0000]
mmc: sdio: Claim host in sdio_reset_comm()

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

Conflicts:

drivers/mmc/core/sdio.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agommc: core: Add deferred bus resume policy.
San Mehat [Mon, 16 Apr 2012 07:23:24 +0000]
mmc: core: Add deferred bus resume policy.

A card driver can now specify that the underlying bus should *not*
auto-resume with the rest of the system. This is useful for reducing resume
latency as well as saving power when the card driver is not using the
bus. In the future, we'll add support for manual suspend

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

Conflicts:

drivers/mmc/core/core.c
include/linux/mmc/host.h

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agommc: core: Hold a wake lock accross delayed work + mmc rescan
San Mehat [Mon, 16 Apr 2012 07:21:26 +0000]
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>

Conflicts:

drivers/mmc/core/core.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agommc: Add new API call 'sdio_reset_comm' for resetting communication with an SDIO...
San Mehat [Mon, 16 Apr 2012 07:20:39 +0000]
mmc: Add new API call 'sdio_reset_comm' for resetting communication with an SDIO device

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

Conflicts:

drivers/mmc/core/sdio.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agotrout: Add functions for WiFi
Dmitry Shmidt [Tue, 11 Nov 2008 19:22:38 +0000]
trout: Add functions for WiFi

7 years agommc: Add concept of an 'embedded' SDIO device.
San Mehat [Mon, 14 Apr 2008 22:22:49 +0000]
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>

7 years agommc: Add status IRQ and status callback function to mmc platform data
San Mehat [Mon, 16 Apr 2012 07:18:38 +0000]
mmc: Add status IRQ and status callback function to mmc platform data

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

Conflicts:

include/linux/amba/mmci.h

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoInput: synaptics_i2c_rmi: Driver for Synaptics Touchscreens using RMI over I2C.
Arve Hjønnevåg [Mon, 16 Apr 2012 07:17:49 +0000]
Input: synaptics_i2c_rmi: Driver for Synaptics Touchscreens using RMI over I2C.

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

Input: synaptics_i2c_rmi: disable_irq -> disable_irq_nosync

Also remove duplicate swap macro

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

Conflicts:

drivers/input/touchscreen/synaptics_i2c_rmi.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoinput: Add keyreset driver.
Arve Hjønnevåg [Sat, 22 Nov 2008 05:47:23 +0000]
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>

7 years agoinput: misc: gpio_event: remove early suspend
Colin Cross [Thu, 2 Feb 2012 04:26:28 +0000]
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>

7 years agoInput: Generic GPIO Input device.
Arve Hjønnevåg [Mon, 16 Apr 2012 07:12:49 +0000]
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>

Conflicts:

drivers/input/misc/gpio_event.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agomisc: uidstat: Adding uid stat driver to collect network statistics.
Mike Chan [Mon, 16 Apr 2012 07:11:04 +0000]
misc: uidstat: Adding uid stat driver to collect network statistics.

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

Conflicts:

drivers/misc/uid_stat.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoParanoid network.
Robert Love [Mon, 16 Apr 2012 07:10:03 +0000]
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>

Conflicts:

net/Kconfig
net/ipv4/af_inet.c
net/ipv6/af_inet6.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoAdd android_aid.h
Robert Love [Mon, 16 Apr 2012 07:08:28 +0000]
Add android_aid.h

Add <linux/android_aid.h>, our mapping of AID defines to gid numbers.

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

Conflicts:

include/linux/android_aid.h

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoswitch: switch class and GPIO drivers.
Mike Lockwood [Mon, 16 Apr 2012 07:07:29 +0000]
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>

Conflicts:

drivers/switch/switch_class.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agopower_supply: Hold a wake_lock while power supply change notifications are pending
Arve Hjønnevåg [Mon, 16 Apr 2012 07:05:25 +0000]
power_supply: Hold a wake_lock while power supply change notifications are pending

When connecting usb or the charger the device would often go back to sleep
before the charge led and screen turned on.

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

Conflicts:

include/linux/power_supply.h

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoInput: evdev - Add ioctl to block suspend while event queue is not empty.
Arve Hjønnevåg [Fri, 17 Oct 2008 22:20:55 +0000]
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>

7 years agoPM: Add user-space wake lock api.
Arve Hjønnevåg [Fri, 10 Oct 2008 04:01:46 +0000]
PM: Add user-space wake lock api.

This adds /sys/power/wake_lock and /sys/power/wake_unlock.
Writing a string to wake_lock creates a wake lock the
first time is sees a string and locks it. Optionally, the
string can be followed by a timeout.
To unlock the wake lock, write the same string to wake_unlock.

Change-Id: I66c6e3fe6487d17f9c2fafde1174042e57d15cd7

7 years agoPM / Sleep: Add wake lock api wrapper on top of wakeup sources
Arve Hjønnevåg [Mon, 16 Apr 2012 07:03:12 +0000]
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>

Conflicts:

kernel/power/Kconfig

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agocgroup: Remove call to synchronize_rcu in cgroup_attach_task
Colin Cross [Mon, 16 Apr 2012 07:01:13 +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>

Conflicts:

kernel/cgroup.c

Change-Id: I3b3f245c8f5e2e5d33f1e54178b2bb6ef10a0817

Conflicts:

kernel/cgroup.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agocgroup: Add generic cgroup subsystem permission checks
Colin Cross [Mon, 16 Apr 2012 06:59:12 +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
'allow_attach' handler, then we fall back to doing our checks
the old way.

Use the 'allow_attach' handler for the 'cpu' cgroup to allow
non-root processes to add arbitrary processes to a 'cpu' cgroup
if it has the CAP_SYS_NICE capability set.

This version of the patch adds a 'allow_attach' handler instead
of reusing the 'can_attach' handler.  If the 'can_attach' handler
is reused, a new cgroup that implements 'can_attach' but not
the permission checks could end up with no permission checks
at all.

Change-Id: Icfa950aa9321d1ceba362061d32dc7dfa2c64f0c
Original-Author: San Mehat <san@google.com>
Signed-off-by: Colin Cross <ccross@android.com>

Conflicts:

kernel/cgroup.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agocgroup: Set CGRP_RELEASABLE when adding to a cgroup
Colin Cross [Mon, 16 Apr 2012 06:57:38 +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>

Conflicts:

kernel/cgroup.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: cache-l2x0: update workaround for PL310 errata 727915
Colin Cross [Mon, 16 Apr 2012 06:51:43 +0000]
ARM: cache-l2x0: update workaround for PL310 errata 727915

ARM errata 727915 for PL310 has been updated to include a new
workaround required for PL310 r2p0 for l2x0_flush_all, which also
affects l2x0_clean_all in my testing.  For r2p0, clean or flush
each set/way individually.  For r3p0 or greater, use the debug
register for cleaning and flushing.

Requires exporting the cache_id, sets and ways detected in the
init function for later use.

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

Conflicts:

arch/arm/mm/cache-l2x0.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: add option to flush console before reboot
Dima Zavin [Tue, 23 Aug 2011 22:56:50 +0000]
ARM: add option to flush console before reboot

If the console_lock was held while the system was rebooted, the messages
in the temporary logbuffer would not have propogated to all the console
drivers.

This force releases the console lock if it failed to be acquired.

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

7 years agopower: Add option to log time spent in suspend
Colin Cross [Mon, 16 Apr 2012 06:49:37 +0000]
power: Add option to log time spent in suspend

Prints the time spent in suspend in the kernel log, and
keeps statistics on the time spent in suspend in
/sys/kernel/debug/suspend_time

Change-Id: Ia6b9ebe4baa0f7f5cd211c6a4f7e813aefd3fa1d
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>

Conflicts:

kernel/power/Makefile

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>