firefly-linux-kernel-4.4.55.git
10 years agoMerge branch 'linaro-android-3.10-lsk' of git://git.linaro.org/people/jstultz/android...
Mark Brown [Wed, 6 Nov 2013 11:51:38 +0000 (11:51 +0000)]
Merge branch 'linaro-android-3.10-lsk' of git://git.linaro.org/people/jstultz/android into lsk-v3.10-jstultz

10 years agoMerge branch 'linaro-fixes/android-3.10' into linaro-android.3.10-lsk
John Stultz [Mon, 4 Nov 2013 22:48:40 +0000 (14:48 -0800)]
Merge branch 'linaro-fixes/android-3.10' into linaro-android.3.10-lsk

Merge "official" android-3.10 branch in w/ older experimental/android-3.10
to update lsk targetted branch to the official branch w/o any rebase trouble.

Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoMerge branch 'upstream/android-3.10' into linaro-fixes/android-3.10
John Stultz [Mon, 4 Nov 2013 22:46:43 +0000 (14:46 -0800)]
Merge branch 'upstream/android-3.10' into linaro-fixes/android-3.10

10 years agodrivers: switch: remove S_IWUSR from dev_attr
Qiao Zhou [Thu, 31 Oct 2013 01:36:50 +0000 (09:36 +0800)]
drivers: switch: remove S_IWUSR from dev_attr

it doesn't need S_IWUSR attribute since xxx_store API is un-needed.
otherwise the WARN check in device_create_file will alert.

Change-Id: I6360bf022dcd659bfb3f41c84624f954d5d15ea5
Signed-off-by: Qiao Zhou <zhouqiao@marvell.com>
10 years agoMerge branch 'android-3.10-adf' into android-3.10
Greg Hackmann [Tue, 29 Oct 2013 19:43:07 +0000 (12:43 -0700)]
Merge branch 'android-3.10-adf' into android-3.10

10 years agoion: add compat_ioctl
Rom Lemarchand [Thu, 24 Oct 2013 12:39:34 +0000 (05:39 -0700)]
ion: add compat_ioctl

Add a compat_ioctl to the ion driver

Change-Id: I43da387e22ff9c4a29f0159dfe9e898efc500553
Signed-off-by: Rom Lemarchand <romlem@google.com>
10 years agoion: change ion_user_handle_t definition to int
Rom Lemarchand [Thu, 24 Oct 2013 02:30:58 +0000 (19:30 -0700)]
ion: change ion_user_handle_t definition to int

Turn ion_user_handle_t to int. This change reflects the underlying type
returned by the ion driver.

Change-Id: I40390dae8138327769510525bf62e55877a4b37d
Signed-off-by: Rom Lemarchand <romlem@google.com>
10 years agousb: gadget: android: Remove device if probe fails
Benoit Goby [Sat, 19 Oct 2013 00:16:38 +0000 (17:16 -0700)]
usb: gadget: android: Remove device if probe fails

Make sure the android0 device is removed before we can destroy
the class.

Change-Id: Id584888c407beb80a1df4990f73fe31ccb9d4767
Signed-off-by: Benoit Goby <benoit@android.com>
10 years agovideo: adf: expose adf_modeinfo_set_{name,vrefresh} to drivers
Greg Hackmann [Thu, 17 Oct 2013 20:18:53 +0000 (13:18 -0700)]
video: adf: expose adf_modeinfo_set_{name,vrefresh} to drivers

Change-Id: Id9f8b2184927a77b244ce0b33d619d6e44a0f17a
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: adf: set default interface dpms_state to OFF
Greg Hackmann [Wed, 16 Oct 2013 21:53:12 +0000 (14:53 -0700)]
video: adf: set default interface dpms_state to OFF

Interfaces default to unplugged, so they should also default to off

Change-Id: I36500a54b11f354a0d7dd2c9924a79e0d9c6f855
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: adf: make dpms_state sysfs attribute writable
Greg Hackmann [Thu, 15 Aug 2013 19:51:22 +0000 (12:51 -0700)]
video: adf: make dpms_state sysfs attribute writable

Change-Id: I04e7785cbddac160003e6c9edaf62d20b367fdc9
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: adf: add helpers for validating custom formats
Greg Hackmann [Tue, 15 Oct 2013 19:51:20 +0000 (12:51 -0700)]
video: adf: add helpers for validating custom formats

Many custom formats look a lot like the standard ones, but with
different subsampling, bpp, etc.  Expose and document
adf_buffer_validate()'s main body, so drivers can reuse its logic when
validating these formats.

Change-Id: I1d06981c9e5aab26f3ab2956c08c679f2c823bcc
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agosync: Fix a race condition between release_obj and print_obj
Alistair Strachan [Wed, 10 Apr 2013 23:35:14 +0000 (16:35 -0700)]
sync: Fix a race condition between release_obj and print_obj

Before this change, a timeline would only be removed from the timeline
list *after* the sync driver had its release_obj() called. However, the
driver's release_obj() may free resources needed by print_obj().

Although the timeline list is locked when print_obj() is called, it is
not locked when release_obj() is called. If one CPU was in print_obj()
when another was in release_obj(), the print_obj() may make unsafe
accesses.

It is not actually necessary to hold the timeline list lock when calling
release_obj() if the call is made after the timeline is unlinked from
the list, since there is no possibility another thread could be in --
or enter -- print_obj() for that timeline.

This change moves the release_obj() call to after the timeline is
unlinked, preventing the above race from occurring.

Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
(cherry picked from commit 3bfc1e9e0c7d0c0e3f52ee1f3803482416afa295)

Change-Id: Ib2b2b23fde5be34016f9d86b8b9c5e561b56cd4c

10 years agoion: add new ion_user_handle_t type for the user-space token
Rom Lemarchand [Wed, 23 Oct 2013 22:09:11 +0000 (15:09 -0700)]
ion: add new ion_user_handle_t type for the user-space token

Declare new ion_user_handle_t type to contain the token returned to user-space.
This allows a 2-step migration of the user-space code to a new kernel header
first, then will allow us to change the definition of the ion_user_handle_type_t
to int without breaking the API.

Change-Id: I4200b6600df8e56fe98cf1580a13a65cb25ec646
Signed-off-by: Rom Lemarchand <romlem@google.com>
(cherry picked from commit ebb8269bbb05b06ecedca3e21b3e65f23d48eadd)

10 years agousb: gadget: android: Remove device if probe fails
Benoit Goby [Sat, 19 Oct 2013 00:16:38 +0000 (17:16 -0700)]
usb: gadget: android: Remove device if probe fails

Make sure the android0 device is removed before we can destroy
the class.

Change-Id: Id584888c407beb80a1df4990f73fe31ccb9d4767
Signed-off-by: Benoit Goby <benoit@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoconfig: Set CPU_FREQ_GOV_INTERACTIVE default n
John Stultz [Tue, 9 Apr 2013 17:45:09 +0000 (10:45 -0700)]
config: Set CPU_FREQ_GOV_INTERACTIVE default n

The CPU_FREQ_GOV_INTERACTIVE text states:
"If in doubt, say N." however the option defaults to Y.

Make this consistent by defaulting to n.

Change-Id: I9625aa6b083c8ca0a99deb81c1e91b720fc76943
Reported-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoconfig: Set PARANOID_NETWORK and NET_ACTIVITY_STATS as default ANDROID
John Stultz [Tue, 9 Apr 2013 17:41:49 +0000 (10:41 -0700)]
config: Set PARANOID_NETWORK and NET_ACTIVITY_STATS as default ANDROID

While ANDROID_PARNOID_NETWORK and NET_ACTIVITY_STATS should default
to yes for Android devices, they aren't completely appropriate as
a default y option in non-android enviornments.

Thus set the default to ANDROID.

Change-Id: Ie8b1f32ef82aaa8ac347f40ea8fff44f0ce79a64
Reported-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoRevert "ARM: Make low-level printk work"
John Stultz [Tue, 21 May 2013 17:00:44 +0000 (10:00 -0700)]
Revert "ARM: Make low-level printk work"

This reverts commit 63d454ab530bb3ab5412aabd6be6ee8cd340888e.

Per Andy's request,

Andy's rational:
    "I don't think that makes any sense any more and should be removed,
    unless there's some case on Android side that really needs it.  Vanilla
    has better DEBUG_LL support now since 2005 when that patch was
    introduced and the Android kernels will inherit it.  I've reverted it in
    my tree since we commonly need DEBUG_LL on (but we don't need printascii
    garbling all our logging as if there was an echo in there).

    ...[It] basically forces all printk output down printascii() which is
    not what we want.

        earlyprintk=1 earlycon=ttyO2,115200n8

    On your commandline will get you going [without this]"

Change-Id: I1da455354b4a8ff3bc9c5f66f5a174b13e179ae6
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoRevert "ARM: convert build of appended dtb zImage to list of dtbs"
John Stultz [Wed, 8 May 2013 20:50:33 +0000 (13:50 -0700)]
Revert "ARM: convert build of appended dtb zImage to list of dtbs"

This reverts commit 5e9468632ea81e7d17fc9bd4457acbaffda7b370.

Tixy was seeing trouble with "make dtbs" and "make my-boards.dtb",
and found reverting this resolves the issue. So for now lets
revert this.

Reported-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agomm: vmscan: Fix up build warning
Andy Green [Tue, 6 Aug 2013 02:48:32 +0000 (19:48 -0700)]
mm: vmscan: Fix up build warning

There's an unused var warning

/projects/linaro/linux-2.6/mm/vmscan.c: In function ‘debug_shrinker_show’:
/projects/linaro/linux-2.6/mm/vmscan.c:170:8: warning: unused variable ‘name’ [-Wunused-variable]

introduced from this patch from androidization
series -->

commit ad42da0cc73761e405128e71c58eda40c25367d4
Author: Rebecca Schultz Zavin <rebecca@android.com>
Date:   Fri Oct 5 13:54:59 2012 -0700

    mm: vmscan: Add a debug file for shrinkers

this patch cleans it out

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoion: Use size_t-specific format
Andy Green [Tue, 6 Aug 2013 02:59:25 +0000 (19:59 -0700)]
ion: Use size_t-specific format

struct ion_platform_heap .size is a size_t, use %zu instead of %lu

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: Fix build warnings
Andy Green [Tue, 6 Aug 2013 02:50:26 +0000 (19:50 -0700)]
staging: android: binder: Fix build warnings

This commit in mainline (now) causes a couple of warnings

commit 975a1ac9a9fe65d66ee1726c0db6dc58e53d232a
Author: Arve Hjønnevåg <arve@android.com>
Date:   Tue Oct 16 15:29:53 2012 -0700

    Staging: android: binder: Add some tracepoints

This patch fixes them

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agodcc_tty: Build fixups
John Stultz [Wed, 8 May 2013 23:06:16 +0000 (16:06 -0700)]
dcc_tty: Build fixups

Fix spinlock declaration and tty_insert/flip arguments.

Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agocpufreq: interactive: delete timers for GOV_START
Shridhar Rasal [Mon, 9 Sep 2013 13:47:14 +0000 (19:17 +0530)]
cpufreq: interactive: delete timers for GOV_START

Make sure that timers cpu_timer and cpu_slack_timer
deactivated before addition of new.

Change-Id: If31c4049606871df6f00efdc24b1d713c86a6f69
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
10 years agocpufreq: Interactive: Implement per policy instances of governor
Viresh Kumar [Thu, 16 May 2013 09:28:54 +0000 (14:58 +0530)]
cpufreq: Interactive: Implement per policy instances of governor

If we have a multi-package system, where we have multiple instances of struct
policy (per package), currently we can't have multiple instances of same
governor. i.e. We can't have multiple instances of Interactive governor for
multiple packages.

This is a bottleneck for multicluster system, where we want different packages
to use Interactive governor, but with different tunables.

This patch uses the infrastructure provided by earlier patches pushed in
Mainline in v3.10-rc1/rc2 and implements per policy instances of Interactive
governor.

Change-Id: I70436d4a5a45c6cb6edf37f3e46d0b9fbc930982
[toddpoynor@google.com: merge with later code, minor changes]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
10 years agocpufreq: interactive: Move definition of cpufreq_gov_interactive downwards
Viresh Kumar [Thu, 16 May 2013 09:28:53 +0000 (14:58 +0530)]
cpufreq: interactive: Move definition of cpufreq_gov_interactive downwards

This moves definition of cpufreq_gov_interactive towards the bottom of file, so
that we don't have to add prototype of cpufreq_governor_interactive() in the
beginning of file.

Change-Id: I04bd1004954eb36502c5cd7e35d3d7274cddaf95
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
10 years agocpufreq: interactive: Remove unnecessary cpu_online() check
Viresh Kumar [Thu, 16 May 2013 09:28:52 +0000 (14:58 +0530)]
cpufreq: interactive: Remove unnecessary cpu_online() check

Cpufreq no longer calls governor callback for offlined cpus. i.e. All
policy->cpus are guaranteed to be online. Hence we don't need explicit check to
see if cpu is online or not.

Change-Id: I9ad85ea4addd5b4a40952e59ed730dd15e328690
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
10 years agosync: signal pt before sync_timeline object gets destroyed
Prakash Kamliya [Fri, 4 Oct 2013 12:20:50 +0000 (17:50 +0530)]
sync: signal pt before sync_timeline object gets destroyed

There is a race condition

Assume we have *one* sync_fence object, with *one* sync_pt
which belongs to *one* sync_timeline, given this condition,
sync_timeline->kref will have two counts, one for sync_timeline
(implicit) and another for sync_pt.

Assume following is the situation on CPU

Theead-1 : (Thread which calls sync_timeline_destroy())
  -> (some function calls)
   -> sync_timeline_destory()
    -> sync_timeline_signal() (CPU is inside this
function after putting reference to sync_timeline)

At this time Thread-2 comes and does following

Thread-2 : (fclose on fence fd)
> sync_fence_release() -> because of fclose() on fence object
 -> sync_fence_free()
  -> sync_pt_free()
   -> kref_put(&pt->parent->kref, sync_timeline_free);
    -> sync_timeline_free() (CPU is inside this because
this time kref will be zero after _put)

Thread-2 will free sync_timeline object before Thread-1
has finished its work inside sync_timeline_signal.

With this change we signals all sync_pt before putting
reference to sync_timeline object.

Change-Id: Ic680e4d0bbef1c46bcb7cfba693395645241d203
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
10 years agovideo: adf: add informational flags to interfaces
Greg Hackmann [Fri, 13 Sep 2013 18:23:05 +0000 (11:23 -0700)]
video: adf: add informational flags to interfaces

Informational flags don't affect ADF directly but may be useful to
clients.  Currently used to indicate primary and external displays.

Change-Id: I343c7f0148da0869244c8e818350e9855525df85
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: adf: add fbdev compatibility helper
Greg Hackmann [Tue, 9 Jul 2013 20:07:26 +0000 (13:07 -0700)]
video: adf: add fbdev compatibility helper

Change-Id: I2b82bb625f805e8edb27799743b290dda5befb97
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: adf: add supported formats to adf_overlay_engine_data
Greg Hackmann [Tue, 11 Jun 2013 19:59:41 +0000 (12:59 -0700)]
video: adf: add supported formats to adf_overlay_engine_data

Change-Id: If2aa783b9ece60160f465bf697508fc58682e1bc
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: adf: support "simple" buffers
Greg Hackmann [Thu, 10 Oct 2013 20:03:26 +0000 (13:03 -0700)]
video: adf: support "simple" buffers

Simple buffers are linear RGB buffers analogous to KMS's dumb buffers.
Simple buffers can be allocated and posted to a display interface
without any driver-private data.

Internally, ADF drivers provide the driver-private data needed (if any)
to post a simple buffer to the display.

Change-Id: Ib0b737622eaf343111310f6623f99d69cf3807d2
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: adf: add memblock helper
Greg Hackmann [Mon, 8 Jul 2013 21:18:18 +0000 (14:18 -0700)]
video: adf: add memblock helper

Provides a dma-buf exporter for memblocks, mainly useful for ADF devices
to wrap their bootloader logos

Change-Id: I936a9b5df099ab6084d433fcaf50f3bc29f93289
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agovideo: add atomic display framework
Greg Hackmann [Wed, 22 May 2013 21:23:10 +0000 (14:23 -0700)]
video: add atomic display framework

Change-Id: I693257e269a99012cd0dbb57576ac222869cf4c7
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agostaging: sw_sync: add stubs for kernels without CONFIG_SW_SYNC
Greg Hackmann [Fri, 11 Oct 2013 20:54:41 +0000 (13:54 -0700)]
staging: sw_sync: add stubs for kernels without CONFIG_SW_SYNC

Change-Id: I7a12679eb3c10b1beaf36c6612cf2e3f6662a034
Signed-off-by: Greg Hackmann <ghackmann@google.com>
10 years agomm: remove compressed copy from zram in-memory
Minchan Kim [Wed, 3 Jul 2013 22:01:24 +0000 (15:01 -0700)]
mm: remove compressed copy from zram in-memory

Swap subsystem does lazy swap slot free with expecting the page would be
swapped out again so we can avoid unnecessary write.

But the problem in in-memory swap(ex, zram) is that it consumes memory
space until vm_swap_full(ie, used half of all of swap device) condition
meet.  It could be bad if we use multiple swap device, small in-memory
swap and big storage swap or in-memory swap alone.

This patch makes swap subsystem free swap slot as soon as swap-read is
completed and make the swapcache page dirty so the page should be
written out the swap device to reclaim it.  It means we never lose it.

I tested this patch with kernel compile workload.

1. before

   compile time : 9882.42
   zram max wasted space by fragmentation: 13471881 byte
   memory space consumed by zram: 174227456 byte
   the number of slot free notify: 206684

2. after

   compile time : 9653.90
   zram max wasted space by fragmentation: 11805932 byte
   memory space consumed by zram: 154001408 byte
   the number of slot free notify: 426972

[akpm@linux-foundation.org: tweak comment text]
[artem.savkov@gmail.com: fix BUG due to non-swapcache pages in end_swap_bio_read()]
[akpm@linux-foundation.org: invert unlikely() test, augment comment, 80-col cleanup]
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
Cc: Shaohua Li <shli@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoAdd compat_ioctl support for VFAT_IOCTL_GET_VOLUME_ID
Bintian Wang [Sun, 30 Jun 2013 12:34:24 +0000 (20:34 +0800)]
Add compat_ioctl support for VFAT_IOCTL_GET_VOLUME_ID

Add VFAT_IOCTL_GET_VOLUME_ID to vfat dir compat_ioctl() interface,
which enable you read vfat volume ID from a 32bit app on a 64bit
kernel

Change-Id: I3e93dfcc1e7a364a6b11bc7e3f5f210e82f306ed
Signed-off-by: Bintian Wang <bintian.wang@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agoMerge branch 'upstream/experimental/android-3.10' into linaro-fixes/experimental...
John Stultz [Mon, 23 Sep 2013 22:23:47 +0000 (15:23 -0700)]
Merge branch 'upstream/experimental/android-3.10' into linaro-fixes/experimental/android-3.10

10 years agoUSB: remove duplicate out endpoint creation in MTP mode
Peter Oh [Thu, 12 Sep 2013 01:42:18 +0000 (01:42 +0000)]
USB: remove duplicate out endpoint creation in MTP mode

Android MTP gadget uses 3 endpoints which are 1 in endpoint,
1 out endpoint, and 1 interrupt endpoint. However when MTP
gadget creates its endpoints, it creates the out endpoint twice
and overwrites the first created out endpoint with the second one,
so that it causes a leak of endpoint resources.

Change-Id: Iba82950095610b26b362f4b10a67cedfb1fee366
Signed-off-by: Peter Oh <poh@broadcom.com>
Reviewed-on: http://mps-gerrit.broadcom.com/37744
Reviewed-by: Graham Williams <gwilli@broadcom.com>
Reviewed-by: John Garry <jgarry@broadcom.com>
Branch-Open: Branch Status <branch_status_noreply@broadcom.com>
Reviewed-by: Checkpatch Status <checkpatch_status_noreply@broadcom.com>
Reviewed-by: Joyjit Nath <joyjit@broadcom.com>
Tested-by: AutoSubmit Status <autosubmit_status_noreply@broadcom.com>
10 years agocpufreq: interactive: fix show_target_loads and show_above_hispeed_delay
Minsung Kim [Sun, 25 Aug 2013 10:23:34 +0000 (19:23 +0900)]
cpufreq: interactive: fix show_target_loads and show_above_hispeed_delay

Remove a trailing whitespace from target_loads and above_hispeed_delay. Problem
happens when user-space program tried to restore parameters that saved before
changing parameters. In this case was returned error(EINVAL).

Change-Id: I5a74e3824602cd6f2b74651adda5ec1b627e61e9
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
10 years agoion: don't use id 0 for handle cookie
Colin Cross [Fri, 23 Aug 2013 02:29:44 +0000 (19:29 -0700)]
ion: don't use id 0 for handle cookie

ion userspace clients think that the cookie is a pointer, so they
use NULL to check if the handle has been initialized.  Set the first
id number to 1.

Change-Id: Ifb9af6029a8b08f57e41bc6160cc11e11001a2a9
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: index client->handles rbtree by buffer
Colin Cross [Wed, 21 Aug 2013 18:23:12 +0000 (11:23 -0700)]
ion: index client->handles rbtree by buffer

The only remaining users of the client->handles rbtree are
iterating through it like a list.  Keep the rbtree, but change
its index to be the buffer address instead of the handle address,
which makes ion_handle_lookup a fast rbtree search.

Change-Id: Ie7d974b3a5d9831c0d664de85ddae8db3c3abdf9
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: replace userspace handle cookies with idr
Colin Cross [Wed, 21 Aug 2013 05:59:41 +0000 (22:59 -0700)]
ion: replace userspace handle cookies with idr

Userspace handles should not leak kernel virtual addresses to
userspace.  They have to be validated by looking them up in an
rbtree anyways, so replace them with an idr and validate them
by using idr_find to convert the id number to the struct
ion_handle pointer.

Change-Id: Iab5667ba6f3a73256fec3949b23a9a6f8e14a283
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: remove IS_ERR_OR_NULL
Colin Cross [Wed, 21 Aug 2013 04:31:34 +0000 (21:31 -0700)]
ion: remove IS_ERR_OR_NULL

IS_ERR_OR_NULL is often part of a bad pattern that can accidentally
return 0 on error:
if (IS_ERR_OR_NULL(ptr))
    return PTR_ERR(ptr);

It also usually means that the errors of a function are not well
defined.  Replace all uses in ion.c by ensure that the return
type of any function in ion is an ERR_PTR.

Specify that the expected return value from map_kernel or map_dma
heap ops is ERR_PTR, and warn if a heap returns NULL.

Change-Id: I6e7ea0d2e62fa08d4e372a7ef6da649f7a62289c
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: convert map_kernel to return ERR_PTR
Colin Cross [Wed, 21 Aug 2013 19:50:37 +0000 (12:50 -0700)]
ion: convert map_kernel to return ERR_PTR

ion is going to stop accepting NULL as an error value, use ERR_PTR.

Change-Id: I030e8b72138904e38a4a5d225beaaa98427651fb
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: add free list size to heap debug files
Colin Cross [Wed, 14 Aug 2013 21:10:19 +0000 (14:10 -0700)]
ion: add free list size to heap debug files

Change-Id: I3c6309afdbd661a2f870fd1ba3fea9543e229882
Signed-off-by: Colin Cross <ccross@android.com>
10 years agoion: chunk_heap: fix leak in allocated counter
Colin Cross [Wed, 14 Aug 2013 21:03:55 +0000 (14:03 -0700)]
ion: chunk_heap: fix leak in allocated counter

buffer->size is controlled by the outer ion layer, don't modify it
inside the heap.  Instead, compute the rounded up allocated size
on demand.

Change-Id: I288ffc1221ce96cfe2591468502ac3279065bde4
Signed-off-by: Colin Cross <ccross@android.com>
10 years agomm: add a field to store names for private anonymous memory
Colin Cross [Thu, 27 Jun 2013 00:26:01 +0000 (17:26 -0700)]
mm: add a field to store names for private anonymous memory

Userspace processes often have multiple allocators that each do
anonymous mmaps to get memory.  When examining memory usage of
individual processes or systems as a whole, it is useful to be
able to break down the various heaps that were allocated by
each layer and examine their size, RSS, and physical memory
usage.

This patch adds a user pointer to the shared union in
vm_area_struct that points to a null terminated string inside
the user process containing a name for the vma.  vmas that
point to the same address will be merged, but vmas that
point to equivalent strings at different addresses will
not be merged.

Userspace can set the name for a region of memory by calling
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, start, len, (unsigned long)name);
Setting the name to NULL clears it.

The names of named anonymous vmas are shown in /proc/pid/maps
as [anon:<name>] and in /proc/pid/smaps in a new "Name" field
that is only present for named vmas.  If the userspace pointer
is no longer valid all or part of the name will be replaced
with "<fault>".

The idea to store a userspace pointer to reduce the complexity
within mm (at the expense of the complexity of reading
/proc/pid/mem) came from Dave Hansen.  This results in no
runtime overhead in the mm subsystem other than comparing
the anon_name pointers when considering vma merging.  The pointer
is stored in a union with fieds that are only used on file-backed
mappings, so it does not increase memory usage.

Change-Id: Ie2ffc0967d4ffe7ee4c70781313c7b00cf7e3092
Signed-off-by: Colin Cross <ccross@android.com>
10 years agopower_supply: kill android-battery driver
Todd Poynor [Tue, 30 Jul 2013 23:45:24 +0000 (16:45 -0700)]
power_supply: kill android-battery driver

Discontinued in favor of future userspace charging helpers.

Change-Id: I840a94ff42e2219cfd8759f919f6188355a63d92
Signed-off-by: Todd Poynor <toddpoynor@google.com>
10 years agoadd extra free kbytes tunable
Rik van Riel [Thu, 1 Sep 2011 19:26:50 +0000 (15:26 -0400)]
add extra free kbytes tunable

Add a userspace visible knob to tell the VM to keep an extra amount
of memory free, by increasing the gap between each zone's min and
low watermarks.

This is useful for realtime applications that call system
calls and have a bound on the number of allocations that happen
in any short time period.  In this application, extra_free_kbytes
would be left at an amount equal to or larger than than the
maximum number of allocations that happen in any burst.

It may also be useful to reduce the memory use of virtual
machines (temporarily?), in a way that does not cause memory
fragmentation like ballooning does.

[ccross]
Revived for use on old kernels where no other solution exists.
The tunable will be removed on kernels that do better at avoiding
direct reclaim.

Change-Id: I765a42be8e964bfd3e2886d1ca85a29d60c3bb3e
Signed-off-by: Rik van Riel<riel@redhat.com>
Signed-off-by: Colin Cross <ccross@android.com>
10 years agogpu: ion: Fix performance issue in faulting code
Rebecca Schultz Zavin [Wed, 12 Jun 2013 22:22:16 +0000 (15:22 -0700)]
gpu: ion: Fix performance issue in faulting code

Previously the code to fault ion buffers in one page at a time had a
performance problem caused by the requirement to traverse the sg list
looking for the right page to load in (a result of the fact that the items in
the list may not be of uniform size).  To fix the problem, for buffers
that will be faulted in, also keep a flat array of all the pages in the buffer
to use from the fault handler.  To recover some of the additional memory
footprint this creates per buffer, dirty bits used to indicate which
pages have been faulted in to the cpu are now stored in the low bit of each
page struct pointer in the page array.

Change-Id: I891b077dc0c88ed6d416b256626d8778fd67be84
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
10 years agogpu: ion: add CMA heap
Benjamin Gaignard [Fri, 22 Mar 2013 17:08:30 +0000 (18:08 +0100)]
gpu: ion: add CMA heap

New heap type ION_HEAP_TYPE_DMA where allocation is done with dma_alloc_coherent API.
device coherent_dma_mask must be set to DMA_BIT_MASK(32).
ion_platform_heap private field is used to retrieve the device linked to CMA,
if NULL the default CMA area is used.
ion_cma_get_sgtable is a copy of dma_common_get_sgtable function which should
be in kernel 3.5

Change-Id: If4b1a3f9c8a6bd72053226208832f4971e44372f
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
10 years agogpu: ion: fix ion_platform_data definition
Benjamin Gaignard [Fri, 22 Mar 2013 17:08:29 +0000 (18:08 +0100)]
gpu: ion: fix ion_platform_data definition

fix ion_platform_heap to make is use an usual way in board configuration file.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
10 years agoARM: kgdb: ignore breakpoint instructions from user mode
Todd Poynor [Wed, 3 Jul 2013 22:48:04 +0000 (15:48 -0700)]
ARM: kgdb: ignore breakpoint instructions from user mode

Avoid conflicts with user mode usage of the same instructions, as with
Clang -ftrapv.

Change-Id: I12d1c6d8f94376bfd2503cb0be843d7e478fb6ea
Signed-off-by: Todd Poynor <toddpoynor@google.com>
10 years agoMerge branch 'linaro-fixes/experimental/android-3.10' of git://git.linaro.org/people...
Mark Brown [Sun, 11 Aug 2013 10:55:56 +0000 (11:55 +0100)]
Merge branch 'linaro-fixes/experimental/android-3.10' of git://git.linaro.org/people/jstultz/android into lsk-v3.10-jstultz

10 years agoion: Use size_t-specific format
Andy Green [Tue, 6 Aug 2013 02:59:25 +0000 (19:59 -0700)]
ion: Use size_t-specific format

struct ion_platform_heap .size is a size_t, use %zu instead of %lu

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agostaging: android: binder: Fix build warnings
Andy Green [Tue, 6 Aug 2013 02:50:26 +0000 (19:50 -0700)]
staging: android: binder: Fix build warnings

This commit in mainline (now) causes a couple of warnings

commit 975a1ac9a9fe65d66ee1726c0db6dc58e53d232a
Author: Arve Hjønnevåg <arve@android.com>
Date:   Tue Oct 16 15:29:53 2012 -0700

    Staging: android: binder: Add some tracepoints

This patch fixes them

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
10 years agomm: vmscan: Fix up build warning
Andy Green [Tue, 6 Aug 2013 02:48:32 +0000 (19:48 -0700)]
mm: vmscan: Fix up build warning

There's an unused var warning

/projects/linaro/linux-2.6/mm/vmscan.c: In function ‘debug_shrinker_show’:
/projects/linaro/linux-2.6/mm/vmscan.c:170:8: warning: unused variable ‘name’ [-Wunused-variable]

introduced from this patch from androidization
series -->

commit ad42da0cc73761e405128e71c58eda40c25367d4
Author: Rebecca Schultz Zavin <rebecca@android.com>
Date:   Fri Oct 5 13:54:59 2012 -0700

    mm: vmscan: Add a debug file for shrinkers

this patch cleans it out

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agovfat: Add compat_ioctl support for VFAT_IOCTL_GET_VOLUME_ID
Bintian Wang [Thu, 27 Jun 2013 04:40:08 +0000 (12:40 +0800)]
vfat: Add compat_ioctl support for VFAT_IOCTL_GET_VOLUME_ID

Add VFAT_IOCTL_GET_VOLUME_ID to vfat dir compat_ioctl() interface,
which enable you read vfat volume ID from a 32bit app on a 64bit
kernel

Change-Id: Ic12ac9d2d46aa50c0597fbedff32de7c8fdeac51
Signed-off-by: Bintian Wang <bintian.wang@linaro.org>
[jstultz: commit message tweaks]
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agodcc_tty: Build fixups
John Stultz [Wed, 8 May 2013 23:06:16 +0000 (16:06 -0700)]
dcc_tty: Build fixups

Fix spinlock declaration and tty_insert/flip arguments.

Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agoRevert "ARM: Make low-level printk work"
John Stultz [Tue, 21 May 2013 17:00:44 +0000 (10:00 -0700)]
Revert "ARM: Make low-level printk work"

This reverts commit 63d454ab530bb3ab5412aabd6be6ee8cd340888e.

Per Andy's request,

Andy's rational:
    "I don't think that makes any sense any more and should be removed,
    unless there's some case on Android side that really needs it.  Vanilla
    has better DEBUG_LL support now since 2005 when that patch was
    introduced and the Android kernels will inherit it.  I've reverted it in
    my tree since we commonly need DEBUG_LL on (but we don't need printascii
    garbling all our logging as if there was an echo in there).

    ...[It] basically forces all printk output down printascii() which is
    not what we want.

        earlyprintk=1 earlycon=ttyO2,115200n8

    On your commandline will get you going [without this]"

Change-Id: I1da455354b4a8ff3bc9c5f66f5a174b13e179ae6
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agoRevert "ARM: convert build of appended dtb zImage to list of dtbs"
John Stultz [Wed, 8 May 2013 20:50:33 +0000 (13:50 -0700)]
Revert "ARM: convert build of appended dtb zImage to list of dtbs"

This reverts commit 5e9468632ea81e7d17fc9bd4457acbaffda7b370.

Tixy was seeing trouble with "make dtbs" and "make my-boards.dtb",
and found reverting this resolves the issue. So for now lets
revert this.

Reported-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agoconfig: Set CPU_FREQ_GOV_INTERACTIVE default n
John Stultz [Tue, 9 Apr 2013 17:45:09 +0000 (10:45 -0700)]
config: Set CPU_FREQ_GOV_INTERACTIVE default n

The CPU_FREQ_GOV_INTERACTIVE text states:
"If in doubt, say N." however the option defaults to Y.

Make this consistent by defaulting to n.

Change-Id: I9625aa6b083c8ca0a99deb81c1e91b720fc76943
Reported-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agoconfig: Set PARANOID_NETWORK and NET_ACTIVITY_STATS as default ANDROID
John Stultz [Tue, 9 Apr 2013 17:41:49 +0000 (10:41 -0700)]
config: Set PARANOID_NETWORK and NET_ACTIVITY_STATS as default ANDROID

While ANDROID_PARNOID_NETWORK and NET_ACTIVITY_STATS should default
to yes for Android devices, they aren't completely appropriate as
a default y option in non-android enviornments.

Thus set the default to ANDROID.

Change-Id: Ie8b1f32ef82aaa8ac347f40ea8fff44f0ce79a64
Reported-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agokconfig: Fix defconfig when one choice menu selects options that another choice menu...
Arve Hjønnevåg [Fri, 7 Jun 2013 03:05:40 +0000 (20:05 -0700)]
kconfig: Fix defconfig when one choice menu selects options that another choice menu depends on

The defconfig and Kconfig combination below, which is based on 3.10-rc4
Kconfigs, resulted in several options getting set to "m" instead of "y".

defconfig:
---
CONFIG_MODULES=y
CONFIG_USB_GADGET=y
CONFIG_USB_ZERO=y
---

Kconfig:
---
menuconfig MODULES
bool "Enable loadable module support"

config CONFIGFS_FS
tristate "Userspace-driven configuration filesystem"

config OCFS2_FS
        tristate "OCFS2 file system support"
        depends on CONFIGFS_FS
        select CRC32

config USB_LIBCOMPOSITE
tristate
select CONFIGFS_FS

choice
tristate "USB Gadget Drivers"
default USB_ETH

config USB_ZERO
tristate "Gadget Zero (DEVELOPMENT)"
select USB_LIBCOMPOSITE

config USB_ETH
tristate "Ethernet Gadget (with CDC Ethernet support)"
select USB_LIBCOMPOSITE

endchoice

config CRC32
        tristate "CRC32/CRC32c functions"
        default y

choice
        prompt "CRC32 implementation"
        depends on CRC32
        default CRC32_SLICEBY8

config CRC32_SLICEBY8
        bool "Slice by 8 bytes"

endchoice

---

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agonetfilter: xt_qtaguid: 3.10 fixes
Arve Hjønnevåg [Tue, 14 May 2013 03:45:02 +0000 (20:45 -0700)]
netfilter: xt_qtaguid: 3.10 fixes

Stop using obsolete procfs api.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agomisc: uidstat: Remove use of obsolete create_proc_read_entry api
Arve Hjønnevåg [Tue, 14 May 2013 03:34:22 +0000 (20:34 -0700)]
misc: uidstat: Remove use of obsolete create_proc_read_entry api

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agonetfilter: xt_quota2: 3.10 fixes.
Arve Hjønnevåg [Tue, 14 May 2013 03:42:46 +0000 (20:42 -0700)]
netfilter: xt_quota2: 3.10 fixes.

- Stop using obsolete create_proc_entry api.
- Use proc_set_user instead of directly accessing the private structure.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agonet: activity_stats: Stop using obsolete create_proc_read_entry api
Arve Hjønnevåg [Tue, 14 May 2013 03:39:30 +0000 (20:39 -0700)]
net: activity_stats: Stop using obsolete create_proc_read_entry api

Convert to use seq_read

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agopstore: Update Documentation/android.txt
John Stultz [Tue, 9 Apr 2013 17:30:26 +0000 (10:30 -0700)]
pstore: Update Documentation/android.txt

Update Documentation/android.txt to reference PSTORE_CONSOLE
and PSTORE_RAM instead of ANDROID_RAM_CONSOLE

Change-Id: I2c56e73f8c65c3ddbe6ddbf1faadfacb42a09575
Reported-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agoARM: mm: Allow an empty PMD in alloc_init_pte()
Jon Medhurst (Tixy) [Wed, 28 Nov 2012 11:17:51 +0000 (11:17 +0000)]
ARM: mm: Allow an empty PMD in alloc_init_pte()

The Android patch titled "ARM: allow the kernel text section to
be made read-only" modifies alloc_init_pte() and adds a BUG_ON
to detect the case where a section mapping is being overwritten.
However the test doesn't allow for the legitimate case where the
PMD is empty, as can happen for kernels built with CONFIG_ARM_LPAE.
So extend the test to allow this.

Change-Id: I28eeaefd856bae63a5532980e41e0fd4d8922e79
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agommc: core: Remove stray CONFIG_EXPERIMENTAL dependencies
John Stultz [Mon, 18 Mar 2013 18:57:28 +0000 (11:57 -0700)]
mmc: core: Remove stray CONFIG_EXPERIMENTAL dependencies

CONFIG_EXPERIMENTAL has been removed from the kernel, so clean
up its use in MMC_EMBEDDED_SDIO and MMC_PARANOID_SD_INIT options.

Change-Id: If414c265134b36740a84564274a631803c8e81b4
Cc: Arve Hjønnevåg <arve@android.com>
Cc: San Mehat <san@google.com>
Cc: Android Kernel Team <kernel-team@android.com>
Reported-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agoion: Add Kconfig dependency to ARM
John Stultz [Fri, 15 Mar 2013 00:50:50 +0000 (17:50 -0700)]
ion: Add Kconfig dependency to ARM

The ion code has some very specific arm-isms which keeps it
from building on other architectures. These should probably be
resolved, but in the mean time, add a dependency on CONFIG_ARM
to avoid build failures.

v2: Fix earlier flub, sending out an early untested version of
the patch.

Change-Id: I5979af1ad59d1eeddd9e08763b1cbc946cf82339
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Rebecca Schultz Zavin <rebecca@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agoselinux: binder: Fix COMMON_AUDIT_DATA_INIT compile issue
John Stultz [Thu, 14 Mar 2013 20:26:14 +0000 (13:26 -0700)]
selinux: binder: Fix COMMON_AUDIT_DATA_INIT compile issue

The COMMON_AUDIT_DATA_INIT macros have been removed, and are
now replaced with open coded ad.type initialization.

Thus, this patch updates the selinux_binder_transfer_file function
so it builds.

Change-Id: Ide41069a87638e294899768d09302f4013794e4c
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
11 years agonetfilter: xt_qtaguid: fix bad tcp_time_wait sock handling
JP Abgrall [Thu, 21 Feb 2013 00:38:34 +0000 (16:38 -0800)]
netfilter: xt_qtaguid: fix bad tcp_time_wait sock handling

Since (41063e9 ipv4: Early TCP socket demux), skb's can have an sk which
is not a struct sock but the smaller struct inet_timewait_sock without an
sk->sk_socket. Now we bypass sk_state == TCP_TIME_WAIT

Signed-off-by: JP Abgrall <jpa@google.com>
11 years agousb: gadget: android: 3.10 fixes
Arve Hjønnevåg [Fri, 17 May 2013 03:27:45 +0000 (20:27 -0700)]
usb: gadget: android: 3.10 fixes

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agousb: gadget: android: move init to late_initcall for now
Arve Hjønnevåg [Tue, 5 Mar 2013 03:14:10 +0000 (19:14 -0800)]
usb: gadget: android: move init to late_initcall for now

gserial_alloc_line crashes when called from module_init

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agousb: gadget: android: Fixes and hacks to make android usb gadget compile on 3.9
Arve Hjønnevåg [Tue, 5 Mar 2013 01:41:34 +0000 (17:41 -0800)]
usb: gadget: android: Fixes and hacks to make android usb gadget compile on 3.9

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agousb: gadget: Fix android gadget driver build
Benoit Goby [Tue, 6 Nov 2012 02:47:08 +0000 (18:47 -0800)]
usb: gadget: Fix android gadget driver build

Removed obsolete f_adb function

Change-Id: Idfb4110429bc0ea63f493c68ad667f49ca471987
Signed-off-by: Benoit Goby <benoit@android.com>
11 years agoHACK: usb: gadget: Fix enumeration on boot
Benoit Goby [Thu, 1 Mar 2012 21:17:07 +0000 (13:17 -0800)]
HACK: usb: gadget: Fix enumeration on boot

The Android gadget driver disconnects the gadget on bind
and expects the gadget to stay disconnected until it calls
usb_gadget_connect when userspace is ready. Removed the call
to usb_gadget_connect in usb_gadget_probe_driver to avoid
enabling the pullup before userspace is ready.

Change-Id: I63707ac6e16a44eca52351a4bf80407d25fbd35e
Signed-off-by: Benoit Goby <benoit@android.com>
11 years agousb: gadget: android: Fixes and hacks to make android usb gadget compile on 3.8
Arve Hjønnevåg [Wed, 28 Nov 2012 03:29:04 +0000 (19:29 -0800)]
usb: gadget: android: Fixes and hacks to make android usb gadget compile on 3.8

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: decompressor: Flush tlb before swiching domain 0 to client mode
Arve Hjønnevåg [Sat, 1 Dec 2012 01:05:40 +0000 (17:05 -0800)]
ARM: decompressor: Flush tlb before swiching domain 0 to client mode

If the bootloader used a page table that is incompatible with domain 0
in client mode, and boots with the mmu on, then swithing domain 0 to
client mode causes a fault if we don't flush the tlb after updating
the page table pointer.

v2: Add ISB before loading dacr.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: mm: Split memory banks that span multiple sections when sparsemem is enabled
Arve Hjønnevåg [Fri, 7 Dec 2012 04:46:49 +0000 (20:46 -0800)]
ARM: mm: Split memory banks that span multiple sections when sparsemem is enabled

This fixes a crash in mem_init which assumes all pages in a memory bank
are part of the same page array.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agommc: block: Remove call to mmc_blk_set_blksize
Arve Hjønnevåg [Tue, 27 Nov 2012 03:30:22 +0000 (19:30 -0800)]
mmc: block: Remove call to mmc_blk_set_blksize

It no longer exists.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agogpu: ion: Remove __GFP_NO_KSWAPD
Arve Hjønnevåg [Tue, 27 Nov 2012 01:20:21 +0000 (17:20 -0800)]
gpu: ion: Remove __GFP_NO_KSWAPD

It no longer exists.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agogpu: ion: __dma_page_cpu_to_dev -> arm_dma_ops.sync_single_for_device hack
Arve Hjønnevåg [Tue, 27 Nov 2012 01:14:58 +0000 (17:14 -0800)]
gpu: ion: __dma_page_cpu_to_dev -> arm_dma_ops.sync_single_for_device hack

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: fiq_debugger: Update tty code for 3.9
Arve Hjønnevåg [Tue, 15 Jan 2013 23:10:31 +0000 (15:10 -0800)]
ARM: fiq_debugger: Update tty code for 3.9

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: fiq_debugger: Use kmsg_dumper to dump kernel logs
Arve Hjønnevåg [Tue, 27 Nov 2012 04:05:37 +0000 (20:05 -0800)]
ARM: fiq_debugger: Use kmsg_dumper to dump kernel logs

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agoARM: fiq_debugger: Fix to compile on 3.7
Arve Hjønnevåg [Tue, 27 Nov 2012 00:23:33 +0000 (16:23 -0800)]
ARM: fiq_debugger: Fix to compile on 3.7

Use for_each_irq_desc in arch/arm/common/fiq_debugger.c

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agousb: otg: otg-wakelock: Fix build for 3.7
Arve Hjønnevåg [Tue, 27 Nov 2012 00:09:13 +0000 (16:09 -0800)]
usb: otg: otg-wakelock: Fix build for 3.7

Signed-off-by: Arve Hjønnevåg <arve@android.com>
11 years agocpufreq: interactive: resched timer if max freq raised
Lianwei Wang [Fri, 26 Apr 2013 05:30:51 +0000 (13:30 +0800)]
cpufreq: interactive: resched timer if max freq raised

When the policy max freq is raised, and before the timer is
rescheduled in idle callback, the cpu freq may stuck at a
lower freq.

The target_freq shall be updated too, else on a high load
situation, the new_freq is always equal to target_freq and
which will cause freq stuck at a lower freq too.

Reschedule the timer on gov limits callback.

Change-Id: I6c187001ab43e859731429b64f75a74eebc37a24
Signed-off-by: Lianwei Wang <a22439@motorola.com>
11 years agocpufreq: interactive: fix race on cpufreq TRANSITION notifier
Lianwei Wang [Thu, 16 May 2013 04:07:23 +0000 (12:07 +0800)]
cpufreq: interactive: fix race on cpufreq TRANSITION notifier

The cpufreq TRANSTION notifier callback does not check the
governor_enabled state on affected CPUS, which will case
kernel panic in update_load because the policy object maybe
NULL or invalid when governor_enabled is false.

Change-Id: Ie0f1718124f61e2f9b5da57abc6981ada5b83908
Signed-off-by: Lianwei Wang <a22439@motorola.com>
11 years agoaf_unix: use freezable blocking calls in read
Colin Cross [Mon, 6 May 2013 23:50:21 +0000 (23:50 +0000)]
af_unix: use freezable blocking calls in read

Avoid waking up every thread sleeping in read call on an AF_UNIX
socket during suspend and resume by calling a freezable blocking
call.  Previous patches modified the freezer to avoid sending
wakeups to threads that are blocked in freezable blocking calls.

This call was selected to be converted to a freezable call because
it doesn't hold any locks or release any resources when interrupted
that might be needed by another freezing task or a kernel driver
during suspend, and is a common site where idle userspace tasks are
blocked.

Change-Id: I788246a76780ea892659526e70be018b18f646c4
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11 years agosigtimedwait: use freezable blocking call
Colin Cross [Mon, 6 May 2013 23:50:20 +0000 (23:50 +0000)]
sigtimedwait: use freezable blocking call

Avoid waking up every thread sleeping in a sigtimedwait call during
suspend and resume by calling a freezable blocking call.  Previous
patches modified the freezer to avoid sending wakeups to threads
that are blocked in freezable blocking calls.

This call was selected to be converted to a freezable call because
it doesn't hold any locks or release any resources when interrupted
that might be needed by another freezing task or a kernel driver
during suspend, and is a common site where idle userspace tasks are
blocked.

Change-Id: Ic27469b60a67d50cdc0d0c78975951a99c25adcd
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11 years agonanosleep: use freezable blocking call
Colin Cross [Mon, 6 May 2013 23:50:19 +0000 (23:50 +0000)]
nanosleep: use freezable blocking call

Avoid waking up every thread sleeping in a nanosleep call during
suspend and resume by calling a freezable blocking call.  Previous
patches modified the freezer to avoid sending wakeups to threads
that are blocked in freezable blocking calls.

This call was selected to be converted to a freezable call because
it doesn't hold any locks or release any resources when interrupted
that might be needed by another freezing task or a kernel driver
during suspend, and is a common site where idle userspace tasks are
blocked.

Change-Id: I93383201d4dd62130cd9a9153842d303fc2e2986
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11 years agofutex: use freezable blocking call
Colin Cross [Mon, 6 May 2013 23:50:18 +0000 (23:50 +0000)]
futex: use freezable blocking call

Avoid waking up every thread sleeping in a futex_wait call during
suspend and resume by calling a freezable blocking call.  Previous
patches modified the freezer to avoid sending wakeups to threads
that are blocked in freezable blocking calls.

This call was selected to be converted to a freezable call because
it doesn't hold any locks or release any resources when interrupted
that might be needed by another freezing task or a kernel driver
during suspend, and is a common site where idle userspace tasks are
blocked.

Change-Id: I9ccab9c2d201adb66c85432801cdcf43fc91e94f
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11 years agoselect: use freezable blocking call
Colin Cross [Mon, 6 May 2013 23:50:17 +0000 (23:50 +0000)]
select: use freezable blocking call

Avoid waking up every thread sleeping in a select call during
suspend and resume by calling a freezable blocking call.  Previous
patches modified the freezer to avoid sending wakeups to threads
that are blocked in freezable blocking calls.

This call was selected to be converted to a freezable call because
it doesn't hold any locks or release any resources when interrupted
that might be needed by another freezing task or a kernel driver
during suspend, and is a common site where idle userspace tasks are
blocked.

Change-Id: I0d7565ec0b6bc5d44cb55f958589c56e6bd16348
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11 years agoepoll: use freezable blocking call
Colin Cross [Mon, 6 May 2013 23:50:16 +0000 (23:50 +0000)]
epoll: use freezable blocking call

Avoid waking up every thread sleeping in an epoll_wait call during
suspend and resume by calling a freezable blocking call.  Previous
patches modified the freezer to avoid sending wakeups to threads
that are blocked in freezable blocking calls.

This call was selected to be converted to a freezable call because
it doesn't hold any locks or release any resources when interrupted
that might be needed by another freezing task or a kernel driver
during suspend, and is a common site where idle userspace tasks are
blocked.

Change-Id: I848d08d28c89302fd42bbbdfa76489a474ab27bf
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11 years agobinder: use freezable blocking calls
Colin Cross [Mon, 6 May 2013 23:50:15 +0000 (23:50 +0000)]
binder: use freezable blocking calls

Avoid waking up every thread sleeping in a binder call during
suspend and resume by calling a freezable blocking call.  Previous
patches modified the freezer to avoid sending wakeups to threads
that are blocked in freezable blocking calls.

This call was selected to be converted to a freezable call because
it doesn't hold any locks or release any resources when interrupted
that might be needed by another freezing task or a kernel driver
during suspend, and is a common site where idle userspace tasks are
blocked.

Change-Id: Ic4458ae90447f6caa895cc62f08e515caa7790ba
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11 years agofreezer: add new freezable helpers using freezer_do_not_count()
Colin Cross [Mon, 6 May 2013 23:50:14 +0000 (23:50 +0000)]
freezer: add new freezable helpers using freezer_do_not_count()

Freezing tasks will wake up almost every userspace task from
where it is blocking and force it to run until it hits a
call to try_to_sleep(), generally on the exit path from the syscall
it is blocking in.  On resume each task will run again, usually
restarting the syscall and running until it hits the same
blocking call as it was originally blocked in.

To allow tasks to avoid running on every suspend/resume cycle,
this patch adds additional freezable wrappers around blocking calls
that call freezer_do_not_count().  Combined with the previous patch,
these tasks will not run during suspend or resume unless they wake
up for another reason, in which case they will run until they hit
the try_to_freeze() in freezer_count(), and then continue processing
the wakeup after tasks are thawed.

Additional patches will convert the most common locations that
userspace blocks in to use freezable helpers.

Change-Id: Id909760ce460f2532801a4b00d344f0816bfefc9
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>