summaryrefslogtreecommitdiff
path: root/drivers/staging/android
AgeCommit message (Collapse)Author
2012-02-08staging: android/ram_console: Don't build on arches w/o ioremapAnton Vorontsov
This patch fixes UML build: CC drivers/staging/android/ram_console.o drivers/staging/android/ram_console.c: In function 'ram_console_driver_probe': drivers/staging/android/ram_console.c:358:2: error: implicit declaration of function 'ioremap' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors make[3]: *** [drivers/staging/android/ram_console.o] Error 1 Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08staging: android: lowmemorykiller: Don't wait more than one second for a ↵Arve Hjønnevåg
process to die If a process forked and the child process was killed by the lowmemorykiller, the lowmemory killer would be disabled until the parent process reaped the child or it died itself. Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: android: binder: Fix crashes when sharing a binder file between ↵Arve Hjønnevåg
processes Opening the binder driver and sharing the file returned with other processes (e.g. by calling fork) can crash the kernel. Prevent these crashes with the following changes: - Add a mutex to protect against two processes mmapping the same binder_proc. - After locking mmap_sem, check that the vma we want to access (still) points to the same mm_struct. - Use proc->tsk instead of current to get the files struct since this is where we get the rlimit from. Signed-off-by: Arve Hjønnevåg <arve@android.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08Staging: android: Remove pmem driverShuah Khan
Addroid pmem driver is no longer used in any of the Android products. This patch removes pmem driver from Android staging area Reference: https://lkml.org/lkml/2012/1/23/183 Signed-off-by: Shuah Khan <shuahkhan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-02-08Staging: android: binder: Don't call dump_stack in binder_vma_openArve Hjønnevåg
If user-space partially unmaps the driver, binder_vma_open would dump the kernel stack. This is not a kernel bug however and will be treated as if the whole area was unmapped once binder_vma_close gets called. Signed-off-by: Arve Hjønnevåg <arve@android.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-22Staging: android: fixed 80 characters warnings in lowmemorykiller.cMarco Navarra
This patch fixes some 80 chatacters limit warnings in the lowmemorykiller.c file Signed-off-by: Marco Navarra <fromenglish@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-22Staging: android: fixed a space warning in binder.hMarco Navarra
This patch fixes a simple tab-space warning in binder.h found by checkpatch tool Signed-off-by: Marco Navarra <fromenglish@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21ashmem: Whitespace cleanupsJohn Stultz
Fixes checkpatch warnings with the ashmem.c file CC: Brian Swetland <swetland@google.com> CC: Colin Cross <ccross@android.com> CC: Arve Hjønnevåg <arve@android.com> CC: Dima Zavin <dima@android.com> CC: Robert Love <rlove@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21ashmem: Fix arguments to ashmem_shrinkColin Cross
The arguments to shrink functions have changed, update ashmem_shrink to match. Signed-off-by: Colin Cross <ccross@android.com> [jstultz: tweaked commit subject] CC: Brian Swetland <swetland@google.com> CC: Colin Cross <ccross@android.com> CC: Arve Hjønnevåg <arve@android.com> CC: Dima Zavin <dima@android.com> CC: Robert Love <rlove@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21ashmem: Support lseek(2) in ashmem driverBjorn Bringert
Signed-off-by: Bjorn Bringert <bringert@android.com> [jstultz: tweaked commit subject] CC: Brian Swetland <swetland@google.com> CC: Colin Cross <ccross@android.com> CC: Arve Hjønnevåg <arve@android.com> CC: Dima Zavin <dima@android.com> CC: Robert Love <rlove@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21ashmem: Update arguments of shrinker for 2.6.35Colin Cross
Signed-off-by: Colin Cross <ccross@google.com> CC: Brian Swetland <swetland@google.com> CC: Colin Cross <ccross@android.com> CC: Arve Hjønnevåg <arve@android.com> CC: Dima Zavin <dima@android.com> CC: Robert Love <rlove@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21ashmem: Fix ASHMEM_SET_PROT_MASK.Arve Hjønnevåg
Signed-off-by: Arve Hjønnevåg <arve@android.com> CC: Brian Swetland <swetland@google.com> CC: Colin Cross <ccross@android.com> CC: Arve Hjønnevåg <arve@android.com> CC: Dima Zavin <dima@android.com> CC: Robert Love <rlove@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21ashmem: Implement read(2) in ashmem driverBjorn Bringert
Signed-off-by: Bjorn Bringert <bringert@android.com> [jstultz: Tweaked commit subject] CC: Brian Swetland <swetland@google.com> CC: Colin Cross <ccross@android.com> CC: Arve Hjønnevåg <arve@android.com> CC: Dima Zavin <dima@android.com> CC: Robert Love <rlove@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21ashmem: Anonymous shared memory subsystemRobert Love
The anonymous shared memory (ashmem) subsystem provides a Unix-y,file-based shared memory interface to user-space. It works like anonymous memory (e.g. mmapping fd=0) except if you share the file descriptor via the usual means, you will share the mapping. The shared memory can be accessed via both mmap or file I/O. The backing store is a simple shmem file. Additionally, ashmem introduces the concept of page pinning. Pinned pages (the default) behave like any anonymous memory. Unpinned pages are available to the kernel for eviction during VM pressure. When repinning the pages, the return value instructs user-space as to any eviction. In this manner, user-space processes may implement caching and similar resource management that efficiently integrates with kernel memory management. Signed-off-by: Robert Love <rlove@google.com> ashmem: Don't install fault handler for private mmaps. Ashmem is used to create named private heaps. If this heap is backed by a tmpfs file it will allocate two pages for every page touched. In 2.6.27, the extra page would later be freed, but 2.6.29 does not scan anonymous pages when running without swap so the memory is not freed while the file is referenced. This change changes the behavior of private ashmem mmaps to match /dev/zero instead tmpfs. Signed-off-by: Arve Hjønnevåg <arve@android.com> ashmem: Add common prefix to name reported in /proc/pid/maps Signed-off-by: Arve Hjønnevåg <arve@android.com> ashmem: don't require a page aligned size This makes ashmem more similar to shmem and mmap, by not requiring the specified size to be page aligned, instead rounding it internally as needed. Signed-off-by: Marco Nelissen <marcone@android.com> [jstultz: Improved commit subject and included patch description from rlove. Also moved ashmem files to staging dir, and reworked code to avoid touching mm/shmem.c while we're in staging.] CC: Brian Swetland <swetland@google.com> CC: Colin Cross <ccross@android.com> CC: Arve Hjønnevåg <arve@android.com> CC: Dima Zavin <dima@android.com> CC: Robert Love <rlove@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-16staging: android: add pmem driverRebecca Schultz
This adds the Android pmem driver to the staging tree. [At this point in time, it is dependent on the ARM platform, due to some build issues that require it. - gregkh] Signed-off-by: Rebecca Schultz <rschultz@google.com> Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com> Signed-off-by: Dima Zavin <dima@android.com> Signed-off-by: Jamie Gennis <jgennis@google.com> Cc: Brian Swetland <swetland@google.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Colin Cross <ccross@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-16staging: android: switch: minor code formatting cleanupsGreg Kroah-Hartman
This fixes a number of minor space issues in the Android switch code. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-16staging: android: switch: switch class and GPIO drivers.Mike Lockwood
This adds the Android switch driver code to the staging tree. [Note, this code was located in drivers/switch/ in the Android kernel releases, but as that api wasn't generally accepted, and the interface is working toward changing to the newly proposed extcon inteface, this driver was placed here until the extcon code is merged into mainline and the Android userspace code is converted over to using it. - gregkh] Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Mike Lockwood <lockwood@android.com> Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Donggeun Kim <dg77.kim@samsung.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: MyungJoo Ham <myungjoo.ham@gmail.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: NeilBrown <neilb@suse.de> Cc: Morten CHRISTIANSEN <morten.christiansen@stericsson.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-16Staging: android: fixed white spaces coding style issue in logger.cMarco Navarra
This patch fixes some space-before-tabs warnings found by checkpatch tool on the staging android driver file logger.c Signed-off-by: Marco Navarra <fromenglish@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging: android: ram_console: pass in a boot info stringColin Cross
Allow the board file to pass a boot info string through the platform data that is appended to the /proc/last_kmsg file. [moved the .h file to drivers/staging/android/ to be self-contained - gregkh] Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30android: logger: bump up the logger buffer sizesJP Abgrall
(port from common android-2.6.39 commit: 11430f16545205c614dd5bd58e4a7ee630fc0f9f) events: (no change, 256) main: 64 -> 256 radio: 64 -> 256 system: 64 -> 256 Signed-off-by: JP Abgrall <jpa@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30android: lowmemorykiller: Fix arguments to lowmem_shrinkColin Cross
The arguments to shrink functions have changed, update lowmem_shrink to match. Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging: android: lowmemorykiller: Ignore shmem pages in page-cacheArve Hjønnevåg
Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging: android: lowmemorykiller: Update arguments of shrinker for 2.6.35Colin Cross
Signed-off-by: Colin Cross <ccross@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging: android: lowmemorykiller: Remove bitrotted codepathSan Mehat
Now that we're murder-synchronous, this code path will never be called (and if it does, it doesn't tell us anything useful other than we killed a task that was already being killed by somebody else but hadn't gotten its' signal yet) Signed-off-by: San Mehat <san@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging: binder: Fix memory corruption via page aliasingChristopher Lais
binder_deferred_release was not unmapping the page from the buffer before freeing it, causing memory corruption. This only happened when page(s) had not been freed by binder_update_page_range, which properly unmaps the pages. This only happens on architectures with VIPT aliasing. To reproduce, create a program which opens, mmaps, munmaps, then closes the binder very quickly. This should leave a page allocated when the binder is released. When binder_deferrred_release is called on the close, the page will remain mapped to the address in the linear proc->buffer. Later, we may map the same physical page to a different virtual address that has different coloring, and this may cause aliasing to occur. PAGE_POISONING will greatly increase your chances of noticing any problems. Signed-off-by: Christopher Lais <chris+android@zenthought.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging: android: lowmemkiller: Substantially reduce overhead during reclaimSan Mehat
This patch optimizes lowmemkiller to not do any work when it has an outstanding kill-request. This greatly reduces the pressure on the task_list lock (improving interactivity), as well as improving the vmscan performance when under heavy memory pressure (by up to 20x in tests). Note: For this enhancement to work, you need CONFIG_PROFILING Signed-off-by: San Mehat <san@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging: android: lowmemorykiller: Don't try to kill the same pid over and overSan Mehat
Under certain circumstances, a process can take awhile to handle a sig-kill (especially if it's in a scheduler group with a very low share ratio). When this occurs, lowmemkiller returns to vmscan indicating the process memory has been freed - even though the process is still waiting to die. Since the memory hasn't actually freed, lowmemkiller is called again shortly after, and picks the same process to die; regardless of the fact that it has already been 'scheduled' to die and the memory has already been reported to vmscan as having been freed. Solution is to check fatal_signal_pending() on the selected task, and if it's already pending destruction return; indicating to vmscan that no resources were freed on this pass. Signed-off-by: San Mehat <san@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30Staging: android: binder: Create dedicated workqueue for binder deferred workArve Hjønnevåg
Some drivers flush the global workqueue when closed. This would deadlock if the last reference to the file was released from the binder. Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30Staging: android: timed_gpio: Properly discard invalid timeout values.Mike Lockwood
The timed output device never previously checked the return value of sscanf, resulting in an uninitialized int being passed to enable() if input value was invalid. Signed-off-by: Mike Lockwood <lockwood@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging: android: binder: Move debugging information from procfs to debugfsArve Hjønnevåg
Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30binder: Use seq_file for debug interface.Arve Hjønnevåg
Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30android: logger: Add new system log for framework/system log messagesSan Mehat
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30Staging: android: timed_gpio: Request gpios.Arve Hjønnevåg
Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30Staging: android: ram_console: Start ram console earlierArve Hjønnevåg
Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging: android: ramconsole: Ensure ramconsole does not get cluttered by ↵San Mehat
apanic threads [Note, this is part of a patch from Sam, just the drivers/staging/ portion, that adds a function that the apanic code calls, but the apanic code isn't here, so just include part of this to make merges and diffs easier and this keeps things self-contained - gregkh] Signed-off-by: San Mehat <san@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30Revert "Staging: android: mark subsystem as broken"Greg Kroah-Hartman
This reverts commit 2cdf99ce2b9418c9d7c5f907195cfac421375520. It now builds, so this can be reverted. Cc: Arve Hjønnevåg <arve@android.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30android-common: Fix slab.h includes for 2.6.34-rc4Colin Cross
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30android-common: include linux/slab.hArve Hjønnevåg
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30staging/android: fix build issuesCorentin Chary
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30Revert "Staging: android: delete android drivers"Greg Kroah-Hartman
This reverts commit b0a0ccfad85b3657fe999805df65f5cfe634ab8a. Turns out I was wrong, we want these in the tree. Note, I've disabled the drivers from the build at the moment, so other patches can be applied to fix some build issues due to internal api changes since the code was removed from the tree. Cc: Arve Hjønnevåg <arve@android.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11Staging: android: delete android driversGreg Kroah-Hartman
These drivers are no longer being developed and the original authors seem to have abandonded them and hence, do not want them in the mainline kernel tree. So sad :( Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-10-30Staging: android: mark subsystem as brokenGreg Kroah-Hartman
It's causing lots of build errors, so just mark it as broken. It is scheduled to be removed in 2.6.33 anyway. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15staging: Make some structures staticJulia Lawall
This was done using a semantic patch (http://coccinelle.lip6.fr/) that checks that the declaration is not inside a function definition, that the defined variable is not exported using EXPORTED_SYMBOL, etc, and that the defined variable does not occur in any other file. If these conditions hold, static is added before the declaration. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: android: lowmemorykiller: fix module param errorsRandy Dunlap
Move module_params to near the end of the source file so that their references are already known/defined. Fixes build errors: drivers/staging/android/lowmemorykiller.c: In function '__check_cost': drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared (first use in this function) drivers/staging/android/lowmemorykiller.c: At top level: drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared here (not in a function) drivers/staging/android/lowmemorykiller.c:60: warning: type defaults to 'int' in declaration of 'type name' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: android: binder: partial checkpatch cleanupDaniel Walker
Clean up 3 or so checkpatch errors from one of my prior patches. Signed-off-by: Daniel Walker <dwalker@fifo99.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: android: lowmemorykiller: delete the decription fileDaniel Walker
Move the lowmemorykiller.txt into the actual source file which is really the correct place for it, and delete lowmemorykiller.txt. Signed-off-by: Daniel Walker <dwalker@fifo99.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: android: lowmemorykiller: remove a predefineDaniel Walker
I moved the struct shrinker down so that the predefine isn't needed. Signed-off-by: Daniel Walker <dwalker@fifo99.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: android: binder: cleanup some long linesDaniel Walker
This file has a lot of long line problems due to the massive indent issues that exist. This just cleans up some of the really really long ones. Signed-off-by: Daniel Walker <dwalker@fifo99.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15staging: android: binder: clean up for all the stat statmentsDaniel Walker
An initial cleanup of all the binder_stat statements. The binder command and return stats still need some assistance tho. Signed-off-by: Daniel Walker <dwalker@fifo99.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15staging: android: binder: global variable cleanup.Daniel Walker
Replaced a manual hlist_head declaration with a macro based one. Also reorganized the globals to be grouped better. Signed-off-by: Daniel Walker <dwalker@fifo99.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>