diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-27 01:46:08 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-27 01:46:08 +0300 |
commit | 23908db413eccd77084b09c9b0a4451dfb0524c0 (patch) | |
tree | 646f21a92496bdc04175e95642b0ecb2dc3dd09e /drivers/staging/android | |
parent | 8d7804a2f03dbd34940fcb426450c730adf29dae (diff) | |
parent | 53a20e9e378ecd52f0afa4b60f8f8c81b6f97c27 (diff) | |
download | linux-23908db413eccd77084b09c9b0a4451dfb0524c0.tar.xz |
Merge tag 'staging-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
"Here's the big, really big, staging tree patches for 4.2-rc1.
Loads of stuff in here, almost all just coding style fixes / churn,
and a few new drivers as well, one of which I just disabled from the
build a few minutes ago due to way too many build warnings.
Other than the one "disable this driver" patch, all of these have been
in linux-next for quite a while with no reported issues"
* tag 'staging-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1163 commits)
staging: wilc1000: disable driver due to build warnings
Staging: rts5208: fix CHANGE_LINK_STATE value
Staging: sm750fb: ddk750_swi2c.c: Insert spaces before parenthesis
Staging: sm750fb: ddk750_swi2c.c: Place braces on correct lines
Staging: sm750fb: ddk750_swi2c.c: Insert spaces around operators
Staging: sm750fb: ddk750_swi2c.c: Replace spaces with tabs
Staging: sm750fb: ddk750_swi2c.h: Shorten lines to under 80 characters
Staging: sm750fb: ddk750_swi2c.h: Replace spaces with tabs
Staging: sm750fb: modedb.h: Shorten lines to under 80 characters
Staging: sm750fb: modedb.h: Replace spaces with tabs
staging: comedi: addi_apci_3120: rename 'this_board' variables
staging: comedi: addi_apci_1516: rename 'this_board' variables
staging: comedi: ni_atmio: cleanup ni_getboardtype()
staging: comedi: vmk80xx: sanity check context used to get the boardinfo
staging: comedi: vmk80xx: rename 'boardinfo' variables
staging: comedi: dt3000: rename 'this_board' variables
staging: comedi: adv_pci_dio: rename 'this_board' variables
staging: comedi: cb_pcidas64: rename 'thisboard' variables
staging: comedi: cb_pcidas: rename 'thisboard' variables
staging: comedi: me4000: rename 'thisboard' variables
...
Diffstat (limited to 'drivers/staging/android')
-rw-r--r-- | drivers/staging/android/Kconfig | 11 | ||||
-rw-r--r-- | drivers/staging/android/ion/ion.c | 1 | ||||
-rw-r--r-- | drivers/staging/android/ion/ion_chunk_heap.c | 2 | ||||
-rw-r--r-- | drivers/staging/android/ion/ion_priv.h | 6 | ||||
-rw-r--r-- | drivers/staging/android/ion/ion_test.c | 20 | ||||
-rw-r--r-- | drivers/staging/android/ion/tegra/tegra_ion.c | 1 | ||||
-rw-r--r-- | drivers/staging/android/lowmemorykiller.c | 17 | ||||
-rw-r--r-- | drivers/staging/android/uapi/ion.h | 2 |
8 files changed, 48 insertions, 12 deletions
diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig index 8feb9048e62f..24d657b3ab99 100644 --- a/drivers/staging/android/Kconfig +++ b/drivers/staging/android/Kconfig @@ -22,11 +22,20 @@ config ANDROID_TIMED_GPIO tristate "Android timed gpio driver" depends on GPIOLIB && ANDROID_TIMED_OUTPUT default n + ---help--- + Unlike generic gpio is to allow programs to access and manipulate gpio + registers from user space, timed output/gpio is a system to allow changing + a gpio pin and restore it automatically after a specified timeout. config ANDROID_LOW_MEMORY_KILLER bool "Android Low Memory Killer" ---help--- - Registers processes to be killed when memory is low + Registers processes to be killed when low memory conditions, this is useful + as there is no particular swap space on android. + + The registered process will kills according to the priorities in android init + scripts (/init.rc), and it defines priority values with minimum free memory size + for each priority. config SYNC bool "Synchronization framework" diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index b0b96ab31954..6f4811263557 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -1579,6 +1579,7 @@ struct ion_device *ion_device_create(long (*custom_ioctl) ret = misc_register(&idev->dev); if (ret) { pr_err("ion: failed to register misc device.\n"); + kfree(idev); return ERR_PTR(ret); } diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index 3e6ec2ee6802..54746157d799 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/ion/ion_chunk_heap.c @@ -173,7 +173,7 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data) chunk_heap->heap.ops = &chunk_heap_ops; chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK; chunk_heap->heap.flags = ION_HEAP_FLAG_DEFER_FREE; - pr_info("%s: base %lu size %zu align %ld\n", __func__, chunk_heap->base, + pr_debug("%s: base %lu size %zu align %ld\n", __func__, chunk_heap->base, heap_data->size, heap_data->align); return &chunk_heap->heap; diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h index 18a5f93e13b7..52f1cd1a67ed 100644 --- a/drivers/staging/android/ion/ion_priv.h +++ b/drivers/staging/android/ion/ion_priv.h @@ -33,7 +33,7 @@ struct ion_buffer *ion_handle_buffer(struct ion_handle *handle); /** * struct ion_buffer - metadata for a particular buffer - * @ref: refernce count + * @ref: reference count * @node: node in the ion_device buffers tree * @dev: back pointer to the ion_device * @heap: back pointer to the heap the buffer came from @@ -46,7 +46,7 @@ struct ion_buffer *ion_handle_buffer(struct ion_handle *handle); * an ion_phys_addr_t (and someday a phys_addr_t) * @lock: protects the buffers cnt fields * @kmap_cnt: number of times the buffer is mapped to the kernel - * @vaddr: the kenrel mapping if kmap_cnt is not zero + * @vaddr: the kernel mapping if kmap_cnt is not zero * @dmap_cnt: number of times the buffer is mapped for dma * @sg_table: the sg table for the buffer if dmap_cnt is not zero * @pages: flat array of pages in the buffer -- used by fault @@ -266,7 +266,7 @@ void ion_heap_freelist_add(struct ion_heap *heap, struct ion_buffer *buffer); /** * ion_heap_freelist_drain - drain the deferred free list * @heap: the heap - * @size: ammount of memory to drain in bytes + * @size: amount of memory to drain in bytes * * Drains the indicated amount of memory from the deferred freelist immediately. * Returns the total amount freed. The total freed may be higher depending diff --git a/drivers/staging/android/ion/ion_test.c b/drivers/staging/android/ion/ion_test.c index 3bc461cbbfa3..7d6e6b6bc894 100644 --- a/drivers/staging/android/ion/ion_test.c +++ b/drivers/staging/android/ion/ion_test.c @@ -261,7 +261,20 @@ static int __init ion_test_probe(struct platform_device *pdev) return 0; } +static int ion_test_remove(struct platform_device *pdev) +{ + struct ion_test_device *testdev; + + testdev = platform_get_drvdata(pdev); + if (!testdev) + return -ENODATA; + + return misc_deregister(&testdev->misc); +} + +static struct platform_device *ion_test_pdev; static struct platform_driver ion_test_platform_driver = { + .remove = ion_test_remove, .driver = { .name = "ion-test", }, @@ -269,13 +282,18 @@ static struct platform_driver ion_test_platform_driver = { static int __init ion_test_init(void) { - platform_device_register_simple("ion-test", -1, NULL, 0); + ion_test_pdev = platform_device_register_simple("ion-test", + -1, NULL, 0); + if (!ion_test_pdev) + return -ENODEV; + return platform_driver_probe(&ion_test_platform_driver, ion_test_probe); } static void __exit ion_test_exit(void) { platform_driver_unregister(&ion_test_platform_driver); + platform_device_unregister(ion_test_pdev); } module_init(ion_test_init); diff --git a/drivers/staging/android/ion/tegra/tegra_ion.c b/drivers/staging/android/ion/tegra/tegra_ion.c index 5b8ef0e66010..4d3c516cc15e 100644 --- a/drivers/staging/android/ion/tegra/tegra_ion.c +++ b/drivers/staging/android/ion/tegra/tegra_ion.c @@ -15,6 +15,7 @@ */ #include <linux/err.h> +#include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> #include "../ion.h" diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index 2345ee7342d9..872bd603fd0d 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -156,20 +156,27 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc) p->pid, p->comm, oom_score_adj, tasksize); } if (selected) { - lowmem_print(1, "send sigkill to %d (%s), adj %hd, size %d\n", - selected->pid, selected->comm, - selected_oom_score_adj, selected_tasksize); - lowmem_deathpending_timeout = jiffies + HZ; + task_lock(selected); + if (!selected->mm) { + /* Already exited, cannot do mark_tsk_oom_victim() */ + task_unlock(selected); + goto out; + } /* * FIXME: lowmemorykiller shouldn't abuse global OOM killer * infrastructure. There is no real reason why the selected * task should have access to the memory reserves. */ mark_oom_victim(selected); + task_unlock(selected); + lowmem_print(1, "send sigkill to %d (%s), adj %hd, size %d\n", + selected->pid, selected->comm, + selected_oom_score_adj, selected_tasksize); + lowmem_deathpending_timeout = jiffies + HZ; send_sig(SIGKILL, selected, 0); rem += selected_tasksize; } - +out: lowmem_print(4, "lowmem_scan %lu, %x, return %lu\n", sc->nr_to_scan, sc->gfp_mask, rem); rcu_read_unlock(); diff --git a/drivers/staging/android/uapi/ion.h b/drivers/staging/android/uapi/ion.h index 6aa495673370..68a14b4e21cb 100644 --- a/drivers/staging/android/uapi/ion.h +++ b/drivers/staging/android/uapi/ion.h @@ -179,7 +179,7 @@ struct ion_custom_data { * DOC: ION_IOC_SYNC - syncs a shared file descriptors to memory * * Deprecated in favor of using the dma_buf api's correctly (syncing - * will happend automatically when the buffer is mapped to a device). + * will happen automatically when the buffer is mapped to a device). * If necessary should be used after touching a cached buffer from the cpu, * this will make the buffer in memory coherent. */ |