summaryrefslogtreecommitdiff
path: root/drivers/staging/android
AgeCommit message (Collapse)Author
2012-05-02Merge 3.4-rc5 into staging-nextGreg Kroah-Hartman
This resolves the conflict in: drivers/staging/vt6656/ioctl.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-30staging: android: timed_output : disable the timed output device when the ↵Kim, Milo
device is unregistered (Life cycle of timed output device driver) 1) register the device as the timed output 2) enable() ops is called via the sysfs timeout > 0 : timer is activated and device is turned on timeout = 0 : timer is cancelled and device is off 3) unregister the timed output device if not used any more So the registered device should be disabled explicitly when the module is removed. ('disabled' means the timer is stopped and the device is turned off) Rather than implementing that code in each driver, just call enable() with timeout = 0 to clean up the driver. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Cc: Mike Lockwood <lockwood@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24staging: android: binder: fix sparse warningsEmil Goode
Fix sparse warnings by adding __user annotation to stucts. This patch fixes the the following sparse warnings: drivers/staging/android/binder.c:1343:76: warning: incorrect type in argument 2 (different address spaces) drivers/staging/android/binder.c:1343:76: expected void [noderef] <asn:1>*ptr drivers/staging/android/binder.c:1343:76: got void *binder drivers/staging/android/binder.c:1567:57: warning: incorrect type in argument 2 (different address spaces) drivers/staging/android/binder.c:1567:57: expected void const [noderef] <asn:1>*from drivers/staging/android/binder.c:1567:57: got void const *buffer drivers/staging/android/binder.c:1573:46: warning: incorrect type in argument 2 (different address spaces) drivers/staging/android/binder.c:1573:46: expected void const [noderef] <asn:1>*from drivers/staging/android/binder.c:1573:46: got void const *offsets drivers/staging/android/binder.c:1603:76: warning: incorrect type in argument 2 (different address spaces) drivers/staging/android/binder.c:1603:76: expected void [noderef] <asn:1>*ptr drivers/staging/android/binder.c:1603:76: got void *binder drivers/staging/android/binder.c:1605:64: warning: incorrect type in argument 2 (different address spaces) drivers/staging/android/binder.c:1605:64: expected void [noderef] <asn:1>*ptr drivers/staging/android/binder.c:1605:64: got void *binder drivers/staging/android/binder.c:1605:76: warning: incorrect type in argument 3 (different address spaces) drivers/staging/android/binder.c:1605:76: expected void [noderef] <asn:1>*cookie drivers/staging/android/binder.c:1605:76: got void *cookie drivers/staging/android/binder.c:1613:40: error: incompatible types in comparison Signed-off-by: Emil Goode <emilgoode@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24staging: android-alarm: Switch from wakelocks to wakeup sourcesJohn Stultz
In their current AOSP tree, the Android in-kernel wakelock infrastructure has been reimplemented in terms of wakeup sources: http://git.linaro.org/gitweb?p=people/jstultz/android.git;a=commitdiff;h=e9911f4efdc55af703b8b3bb8c839e6f5dd173bb The Android alarm driver currently has stubbed out calls to wakelock functionality. So this patch simply converts the stubbed out wakelock calls to wakeup source calls, and removes the empty wakelock macros Greg, would you mind queuing this in staging-next? CC: Colin Cross <ccross@android.com> CC: Arve Hjønnevåg <arve@android.com> CC: Greg KH <gregkh@linuxfoundation.org> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20android-alarm: Remove unused android alarm in-kernel interfacesJohn Stultz
Now that alarm-dev.c uses the upstreamed alarmtimer interfaces, we can remove the otherwise unused in-kernel android alarm api. CC: Colin Cross <ccross@android.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20staging: android-alarm: Rework alarm-dev.c to use upstreamed alarmtimersJohn Stultz
This reworks the alarm-dev.c to use the upstreamed alarmtimers interface. CC: Colin Cross <ccross@android.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20staging: android-alarm: Convert ALARM_ELAPSED_REALTIME to use CLOCK_BOOTTIMEJohn Stultz
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. CC: Colin Cross <ccross@android.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18staging: fix android alarm.c printk format warningsRandy Dunlap
Fix printk format warnings by using 't' modifier for ptrdiff_t. drivers/staging/android/alarm.c:344:2: warning: format '%ld' expects type 'long int', but argument 2 has type 'int' drivers/staging/android/alarm.c:367:3: warning: format '%ld' expects type 'long int', but argument 2 has type 'int' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18staging: Fix typo within android drivers.Masanari Iida
Fix spelling typo in comments within android drivers. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-12Merge tag 'staging-3.4-rc2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging tree fixes from Greg KH: "Here are a number of bugfixes for the drivers/staging/ portion of the kernel that have been reported recently. Nothing major here, with maybe the exception of the ramster code can now be built so it is enabled in the build again, and lots of memory leaks that people like to have fixed on their systems. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'staging-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: android: fix mem leaks in __persistent_ram_init() staging: vt6656: Don't leak memory in drivers/staging/vt6656/ioctl.c::private_ioctl() staging: iio: hmc5843: Fix crash in probe function. staging/xgifb: fix display on XGI Volari Z11m cards Staging: android: timed_gpio: Fix resource leak in timed_gpio_probe error paths android: make persistent_ram based drivers depend on HAVE_MEMBLOCK staging: iio: ak8975: Remove i2c client data corruption staging: drm/omap: move where DMM driver is registered staging: zsmalloc: fix memory leak Staging: rts_pstor: off by one in for loop staging: ozwpan: Added new maintainer for ozwpan staging:rts_pstor:Avoid "Bad target number" message when probing driver staging:rts_pstor:Fix possible panic by NULL pointer dereference Staging: vt6655-6: check keysize before memcpy() staging/media/as102: Don't call release_firmware() on uninitialized variable staging:iio:core add missing increment of loop index in iio_map_array_unregister() staging: ramster: unbreak my heart staging/vme: Fix module parameters staging: sep: Fix sign of error
2012-04-12staging: android: fix mem leaks in __persistent_ram_init()Jesper Juhl
If, in __persistent_ram_init(), the call to persistent_ram_buffer_init() fails or the call to persistent_ram_init_ecc() fails then we fail to free the memory we allocated to 'prz' with kzalloc() - thus leaking it. To prevent the leaks I consolidated all error exits from the function at a 'err:' label at the end and made all error cases jump to that label where we can then make sure we always free 'prz'. This is safe since all the situations where the code bails out happen before 'prz' has been stored anywhere and although we'll do a redundant kfree(NULL) call in the case of kzalloc() itself failing that's OK since kfree() deals gracefully with NULL pointers and I felt it was more important to keep all error exits at a single location than to avoid that one harmless/redundant kfree() on a error path. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Colin Cross <ccross@android.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging: fix android persistent_ram printk formatsRandy Dunlap
Fix printk format warnings in android/persistent_ram.c: drivers/staging/android/persistent_ram.c:426:4: warning: format '%ld' expects type 'long int', but argument 2 has type 'size_t' drivers/staging/android/persistent_ram.c:426:4: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' drivers/staging/android/persistent_ram.c:430:4: warning: format '%ld' expects type 'long int', but argument 2 has type 'size_t' drivers/staging/android/persistent_ram.c:430:4: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10Staging: android: timed_gpio: Fix resource leak in timed_gpio_probe error pathsAxel Lin
If gpio_request fails, we need to free all allocated resources. Current code uses wrong array index to access gpio_data array. So current code actually frees gpio_data[i].gpio by j times. This patch moves the error handling code to err_out and thus improves readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10android: make persistent_ram based drivers depend on HAVE_MEMBLOCKColin Cross
m68k doesn't have memblock_reserve, which causes a build failure with allmodconfig. Make PERSISTENT_RAM and RAM_CONSOLE depend on HAVE_MEMBLOCK. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10android, lowmemorykiller: remove task handoff notifierDavid Rientjes
The task handoff notifier leaks task_struct since it never gets freed after the callback returns NOTIFY_OK, which means it is responsible for doing so. It turns out the lowmemorykiller actually doesn't need this notifier at all. It's used to prevent unnecessary killing by waiting for a thread to exit as a result of lowmem_shrink(), however, it's possible to do this in the same way the kernel oom killer works by setting TIF_MEMDIE and avoid killing if we're still waiting for it to exit. The kernel oom killer will already automatically set TIF_MEMDIE for threads that are attempting to allocate memory that have a fatal signal. The thread selected by lowmem_shrink() will have such a signal after the lowmemorykiller sends it a SIGKILL, so this won't result in an unnecessary use of memory reserves for the thread to exit. This has the added benefit that we don't have to rely on CONFIG_PROFILING to prevent needlessly killing tasks. Reported-by: Werner Landgraf <w.landgraf@ru.ru> Cc: stable@vger.kernel.org Signed-off-by: David Rientjes <rientjes@google.com> Acked-by: Colin Cross <ccross@android.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-30Merge branch 'x86-x32-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x32 support for x86-64 from Ingo Molnar: "This tree introduces the X32 binary format and execution mode for x86: 32-bit data space binaries using 64-bit instructions and 64-bit kernel syscalls. This allows applications whose working set fits into a 32 bits address space to make use of 64-bit instructions while using a 32-bit address space with shorter pointers, more compressed data structures, etc." Fix up trivial context conflicts in arch/x86/{Kconfig,vdso/vma.c} * 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits) x32: Fix alignment fail in struct compat_siginfo x32: Fix stupid ia32/x32 inversion in the siginfo format x32: Add ptrace for x32 x32: Switch to a 64-bit clock_t x32: Provide separate is_ia32_task() and is_x32_task() predicates x86, mtrr: Use explicit sizing and padding for the 64-bit ioctls x86/x32: Fix the binutils auto-detect x32: Warn and disable rather than error if binutils too old x32: Only clear TIF_X32 flag once x32: Make sure TS_COMPAT is cleared for x32 tasks fs: Remove missed ->fds_bits from cessation use of fd_set structs internally fs: Fix close_on_exec pointer in alloc_fdtable x32: Drop non-__vdso weak symbols from the x32 VDSO x32: Fix coding style violations in the x32 VDSO code x32: Add x32 VDSO support x32: Allow x32 to be configured x32: If configured, add x32 system calls to system call tables x32: Handle process creation x32: Signal-related system calls x86: Add #ifdef CONFIG_COMPAT to <asm/sys_ia32.h> ...
2012-03-15Staging: android: ram_console.c:Greg Kroah-Hartman
Fix build error when CONFIG_PRINTK is not selected. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-09Staging: android: binder: Fix use-after-free bugArve Hjønnevåg
binder_update_page_range could read freed memory if the vma of the selected process was freed right before the check that the vma belongs to the mm struct it just locked. If the vm_mm pointer in that freed vma struct had also been rewritten with a value that matched the locked mm struct, then the code would proceed and possibly modify the freed vma. Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-09staging: ram_console: Fix section mismatchesStephen Boyd
WARNING: vmlinux.o(.text+0xfcf6e): Section mismatch in reference from the function ram_console_driver_probe() to the function .init.text:persistent_ram_init_ringbuffer() The function ram_console_driver_probe() references the function __init persistent_ram_init_ringbuffer(). This is often because ram_console_driver_probe lacks a __init annotation or the annotation of persistent_ram_init_ringbuffer is wrong. Move this driver to platform_driver_probe() because ram console devices aren't going to be added and removed at runtime. Also shorten the probe function name since driver is redundant and makes the function name long. Cc: Android Kernel Team <kernel-team@android.com> Cc: John Stultz <john.stultz@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: ram_console: honor dmesg_restrictNick Kralevich
The Linux kernel has a setting called dmesg_restrict. When true, only processes with CAP_SYSLOG can view the kernel dmesg logs. This helps prevent leaking of kernel information into user space. On Android, it's possible to bypass these restrictions by viewing /proc/last_kmsg. This change makes /proc/last_kmsg require the same permissions as dmesg. CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Nick Kralevich <nnk@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: ram_console: fix crash in ram_console_late_initColin Cross
If the persistent ram buffer is not available, ram_console_late_init would crash when dereferencing ram_console_zone. Return early if ram console was not initialized. CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: persistent_ram: add notrace to persistent_ram_writeColin Cross
Add the notrace attribute to persistent_ram_write and the non-ecc functions that it calls to allow persistent_ram to be used for ftracing (only when ecc is disabled). CC: Greg KH <gregkh@linuxfoundation.org> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: persistent_ram: make persistent_ram_write atomicColin Cross
Allow persistent_ram_write to be called on multiple cpus at the same time, as long as ecc is not in use. Uses atomics for the buffer->start and buffer->size counters. [jstultz: Fix up some pr_info casting issues on 64bit] CC: Greg KH <gregkh@linuxfoundation.org> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: persistent_ram: handle reserving and mapping memoryColin Cross
Replace the ioremapped memory passed in from the drivers with a memblock_reserve and vmap. Adds a new function, persistent_ram_early_init, designed to be called from the machine init_early callback, that calls memblock_remove and saves the provided persistent ram area layout. Drivers only pass in their struct device * and ecc settings. Locating and mapping the memory is now handled entirely within persistent_ram. Also, convert ram_console to the new persistent_ram_init parameters that only take a struct device * and ecc settings. [jstultz: Fix pr_info casting issues on 64bit, folded two patches as the build breaks if they are apart. Also replaced phys_to_page() w/ pfn_to_page(addr>>PAGE_SHIFT), as phys_to_page is only on a few arches.] CC: Greg KH <gregkh@linuxfoundation.org> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: persistent_ram: refactor ecc supportColin Cross
Remove CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION and related #ifdefs. Also allow persistent ram zones without ecc enabled. For some use cases, like the data portion of the upcoming persistent_vars patches, or a persistent ftrace ringbuffer, ecc on every update is too expensive. CC: Greg KH <gregkh@linuxfoundation.org> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: ram_console: split out persistent ramColin Cross
Split ram_console into two halves. persistent_ram is a set of apis that handle a block of memory that does not get erased across a reboot. It provides functions to fill it as a single buffer or a ring buffer, and to extract the old data after a reboot. It handles ecc on the data to correct bit errors introduced during reboot. ram_console is now a small wrapper around persistent_ram that feeds console data into the ringbuffer, and exports the old data to /proc/last_kmsg after a reboot. [jstultz: Moved persistent_ram.h to staging dir] CC: Greg KH <gregkh@linuxfoundation.org> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: ram_console: drop verbose ram_console supportColin Cross
Equivalent functionality can be obtained with loglevel=15 CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: ram_console: drop early buffer supportColin Cross
Early ramconsole is not very useful, an early crash will prevent getting the logged data out on the next boot, and CONFIG_DEBUG_LL=y will get the same information. Drop it to simplify a future refactoring. CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: ram_console: move footer stringsColin Cross
Don't store the bootinfo string and the ecc status string with the recovered old log data. This will simplify refactoring the persistent ram code out of the ram console code later. CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08staging: android: ram_console: set CON_ANYTIME console flagDima Zavin
We want to ensure that we get all the console messages, even ones that occur while the printing CPU is not yet online. [jstultz: tweaked commit subject line] CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Dima Zavin <dima@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-07Staging: android: lowmemorykiller.cGreg Kroah-Hartman
Fix compiler warning about the type of the module parameter. Cc: San Mehat <san@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-07staging: android/lowmemorykiller: Don't unregister notifier from atomic contextPaul E. McKenney
The lowmemorykiller registers an atomic notifier for notfication of when the task is freed. From this atomic notifier callback, it removes the atomic notifier via task_free_unregister(). This is incorrect because atomic_notifier_chain_unregister() calls syncronize_rcu(), which can sleep, which shouldn't be done from an atomic notifier. Fix this by registering the notifier during init, and only unregister it if the lowmemorykiller is unloaded. Rebased to -next by Paul E. McKenney. Rebased to -next again by Anton Vorontsov. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Christian Bejram <christian.bejram@stericsson.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-07Staging:android: Change type for binder_debug_no_lock switch to boolZhengwang Ruan
GCC warns that module_param_named() indirectly returns a bool type value which is different from 'int' type binder_debug_no_lock declared. Change it to bool because it is a internal switch for debugging. Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-29Staging: android: timed_gpio: Removed spaces before tabsJohannes Thumshirn
Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24staging: logger: hold mutex while removing readerRabin Vincent
The readers list is traversed under the log->mutex lock (for example from fix_up_readers()), but the deletion of elements from this list is not being done under this lock. Cc: Brian Swetland <swetland@google.com> Cc: Dima Zavin <dima@android.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24fs: Remove missed ->fds_bits from cessation use of fd_set structs internallyDavid Howells
Stephen Rothwell reported that the following commit broke the linux-next build: 1fd36adcd98c: Replace the fd_sets in struct fdtable with an array of unsigned longs Fix places where ->fds_bits needed to be removed as the core kernel no longer uses fd_set internally for file descriptor table management. There are two places: (1) drivers/staging/android/binder.c (2) arch/mips/kernel/kspd.c Question: Should sp_cleanup() in the MIPS arch be using find_next_bit() or fls()? Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David Howells <dhowells@redhat.com> cc: Ralf Bächle <ralf@linux-mips.org> cc: Arve Hjønnevåg <arve@android.com> Link: http://lkml.kernel.org/r/20120224105707.32170.11550.stgit@warthog.procyon.org.uk Signed-off-by: Ingo Molnar <mingo@elte.hu>
2012-02-19Wrap accesses to the fd_sets in struct fdtableDavid Howells
Wrap accesses to the fd_sets in struct fdtable (for recording open files and close-on-exec flags) so that we can move away from using fd_sets since we abuse the fd_set structs by not allocating the full-sized structure under normal circumstances and by non-core code looking at the internals of the fd_sets. The first abuse means that use of FD_ZERO() on these fd_sets is not permitted, since that cannot be told about their abnormal lengths. This introduces six wrapper functions for setting, clearing and testing close-on-exec flags and fd-is-open flags: void __set_close_on_exec(int fd, struct fdtable *fdt); void __clear_close_on_exec(int fd, struct fdtable *fdt); bool close_on_exec(int fd, const struct fdtable *fdt); void __set_open_fd(int fd, struct fdtable *fdt); void __clear_open_fd(int fd, struct fdtable *fdt); bool fd_is_open(int fd, const struct fdtable *fdt); Note that I've prepended '__' to the names of the set/clear functions because they require the caller to hold a lock to use them. Note also that I haven't added wrappers for looking behind the scenes at the the array. Possibly that should exist too. Signed-off-by: David Howells <dhowells@redhat.com> Link: http://lkml.kernel.org/r/20120216174942.23314.1364.stgit@warthog.procyon.org.uk Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Al Viro <viro@zeniv.linux.org.uk>
2012-02-14staging: android, lowmemorykiller: convert to use oom_score_adjDavid Rientjes
/proc/pid/oom_adj is deprecated and will be removed in August 2012 according to Documentation/feature-removal-schedule.txt. Convert its usage in the lowmemorykiller to use the new interface, oom_score_adj, instead. Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10Merge tag 'staging-3.3-rc3' into staging-nextGreg Kroah-Hartman
This was done to resolve some merge issues with the following files that had changed in both branches: drivers/staging/rtl8712/rtl871x_sta_mgt.c drivers/staging/tidspbridge/rmgr/drv_interface.c drivers/staging/zcache/zcache-main.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Support old drivers via preprocessor aliasingJohn Stultz
Older out of tree drivers that were desgined to the Android Alarm in-kernel API may not build due to the namespace collision fixed in an earlier patch. Per Arve's suggestion, this patch provides preprocessor macros that allow older drivers to build. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Fixup minor pr_alarm warningsJohn Stultz
This patch fixes the following warnings: drivers/staging/android/alarm.c: In function ‘alarm_timer_triggered’: drivers/staging/android/alarm.c:344: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long int’ drivers/staging/android/alarm.c:367: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long int’ 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Fix bad index when canceling alarms[]JP Abgrall
It was using ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK as an index. CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> CC: JP Abgrall <jpa@google.com> Change-Id: I919860cc71254453e382616bce9fd5455802cb3d Signed-off-by: JP Abgrall <jpa@google.com> [jstultz: Tweaked commit subject] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Update hrtimer if alarm at the head of the queue is ↵Arve Hjønnevåg
reprogrammed If an alarm was restarted with a value that moved it away from the head of a queue, the hrtimer would not be updated. This would cause unnecessary wakeups. CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> Change-Id: If379f8dd92b0bdb3173bd8d057adfe0dc1d15259 Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Disable Android alarm driver by defaultPraneeth Kumar Bajjuri
Do not enable Android alarm driver by default CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> CC: Praneeth Bajjuri <praneeth@ti.com> Change-Id: Iff8f7a65c4eceecfd084074937c72824697b5e7f Signed-off-by: Praneeth Bajjuri <praneeth@ti.com> [jstultz: tweaked commit subject & msg] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Reenable android alarm driverJohn Stultz
Now that it builds, re-enable android alarm driver in the makefile and kconfig 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: HACK: wakelock workaroundJohn Stultz
Allow Android alarmtimer device to build while wakelocks are still out of tree. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Fix namespace collision with upstreamed alarmtimersJohn Stultz
The upstreamed alarmtimers are similar but not quite 100% API compatibile with the android in-kernel alarm api. To aid the transition, prefix the the android in-kernel api with android_ 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Fix include compile issuesJohn Stultz
The file asm/mach/time.h doesn't exist on all arches, so include <linux/time.h>. Also linux/sysdev.h is gone so kill it. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Add needed module.h includesAndy Green
Add module.h includes required to build CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> CC: Andy Green <andy.green@linaro.org> Signed-off-by: Andy Green <andy.green@linaro.org> [jstultz: Tweaked commit subject, folded two patches into one] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Don't use save_time_delta.Arve Hjønnevåg
Remove references to non-existant save_time_delta. Change-Id: Iaefeca497de02fe36b7f5d79075912f6e349ec53 CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Arve Hjønnevåg <arve@android.com> [Added commit message -jstultz] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>