Age | Commit message (Collapse) | Author |
|
https://android.googlesource.com/kernel/common into lsk-v3.10-aosp
|
|
Mostly just to quiet checkpatch warnings, be more verbose
in describing the ION config option.
Change-Id: I194235f1a68623dca15ae6e658fc99d00943a827
Signed-off-by: John Stultz <john.stultz@linaro.org>
|
|
Just some simple cleanups to address whitespace issues and
other issues found w/ checkpatch.
Change-Id: I181444505627894b8f3bbf59192703b0f65736ee
Signed-off-by: John Stultz <john.stultz@linaro.org>
|
|
Change-Id: I5ee4b794dcc00f74f26562e49a406ea292af63ee
(cherry picked from commit 9ebedefd06142c9bc812bfa23401031525002a76)
|
|
Implement ion_cma_unmap_kernel, ion will call it unconditionally.
Use correct gfp flags when calling dma_alloc_coherent so it doesn't
try to use atomic DMA memory.
Check for invalid alignment when allocating.
Reject cached allocations - the cpu address returned by
dma_alloc_coherent is always going to be an uncached mapping, so
map_kernel will not see data written by a cached userspace mapping.
Change-Id: I2ea03f28fae3749f6de0b89700b69da3845926ea
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Change-Id: I4be12b9545a81f9b46339a905f00e1e64896b3ed
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Add ion_heap_pages_zero for ion heaps to use to zero pages
during initialization or allocation, when a struct ion_buffer
may not be available. Use it from the chunk heap and carveout
heaps.
Change-Id: Ic6c921943a8820cf9896da5164f2d9794d0fe91f
Signed-off-by: Colin Cross <ccross@android.com>
|
|
The carveout heap wasn't zeroing its buffers after use.
Create the sg_table during allocate instead of map_dma, to allow
using the sg_table during free, and call ion_heap_buffer_zero
during free. Also fixes a missing kfree when destroying the
table.
Change-Id: I318a8493cce32580250884cae336dd2e2c28e73b
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Fix sparse warnings in ion.
Change-Id: Icbadf2ca53bea20914f608f619568629c178eae3
Signed-off-by: Colin Cross <ccross@android.com>
|
|
There is no reason to use kzalloc, just call alloc_pages directly.
Change the GFP from GFP_KERNEL to include __GFP_HIGH, to allow it
to return contiguous pages from highmem. virt_to_* functions
aren't valid on highmem pages, so store the struct page * in an
sg_table in buffer->priv_virt like most other heaps, and replace
virt_to_* with page_to_*.
Change-Id: Ida78888b101f080883716e1fa5038dfc4dbabd16
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Now that ion_vm_fault uses vm_insert_pfn instead of vm_insert_page
cached buffers can be supported in any heap. Remove the checks
in the chunk and system heaps.
Change-Id: I371a44c400ed8a342c3b0eed90d0fb7060537697
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Now that ion_vm_fault doesn't need a struct page with a nonzero
refcount, there is no need allocate heap memory for cached pages using
split_page. Remove the ion_heap_alloc_pages and ion_heap_free_pages
helpers in favor of direct calls to alloc_pages and __free_pages,
and remove the special handling in the system heap.
Change-Id: I5966a798f48df2d56642e662a69c1495944f6509
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Most ion userspace mappings are created with remap_pfn_range. Use
vm_insert_pfn instead of vm_insert_page to make faulted cached
mappings look more like uncached mappings.
Change-Id: I9ec5cad3fef54f3b80be8b306d7ff2f1fe3f0e66
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Check the return value of remap_pfn_range and return an error if
it fails.
Change-Id: I206cf95a24607ebe1c80274e3ed15cc7c076d007
Signed-off-by: Colin Cross <ccross@android.com>
|
|
When the shrinkers are called with GFP_HIGH free low memory first,
it is more important to have free than high memory.
Change-Id: I7ad8a9c133830f04d429c3d87b781b3e862ccedb
Signed-off-by: Colin Cross <ccross@android.com>
|
|
ion_heap_buffer_zero can spend a long time in unmap_kernel_range
if it has to broadcast a tlb flush to every cpu for every page.
Modify it to batch pages into a larger region to clear using a
single mapping. This may cause the mapping size to change if
the buffer size is not a multiple of the mapping size, so
switch to allocating the address space for each chunk. This
allows us to use vm_map_ram to handle the allocation and mapping
together.
The number of pages to zero using a single mapping is set to 32
to hit the fastpath in vm_map_ram.
Change-Id: I1accfe67b285cbc9e95e387bea4246864197827d
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Change-Id: I25c752b3eacb48cccea5be2df319634b3affd331
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Ion will compile and run on other platforms now, remove the
dependency on ARM.
Change-Id: I9da0ab686708bdab575a021031392b4402cce090
Signed-off-by: Colin Cross <ccross@android.com>
|
|
In testing ion system heap allocations, I ran across two issues:
1) Not k*z*allocing the sg table. This can cause trouble if
we end up trying call sg_alloc_table() with too many entries,
then sg_alloc_table() internally fails and tries to free what it
thinks is internal table structure, which causes bad pointer
traversals.
2) The second list_for_each_entry probably should be _safe,
since I was seeing strange lock warnings and oopses on occasion.
This seems to resolve it, but could use some extra checking.
Change-Id: I59d4c90104a8cf23dc4ae814d0b17348f1b68ac0
Signed-off-by: John Stultz <john.stultz@linaro.org>
|
|
The `buffer' variable is being used after being freed. Fix this.
Change-Id: Iea3471fa7dc7535bbf0620c1639fea2008d7cf19
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
|
|
Convert the ion ioctls to use _IOW instead of _IOWR where
appropriate, and factor out the copy_from_user and copy_to_user
based on the _IOC_DIR bits. For the existing incorrect ioctls,
add a function to wrap _IOC_DIR to return the corrected value.
Change-Id: I3cc34c84b9c52305bdbec27a9224447b102fadcd
Signed-off-by: Colin Cross <ccross@android.com>
|
|
ion_system_contig_heap buffers have an sglist, just call
ion_heap_map_user to map it.
Change-Id: I6dea383955834613fa8833659b31533c957c2b0b
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Use %z for size_t and %pa for dma_addr_t to avoid warnings in printks.
Change-Id: I2c72874acd0b69cb35fca691928783817deb9394
Signed-off-by: Colin Cross <ccross@android.com>
|
|
phys_to_page and __phys_to_pfn don't exist on all platforms.
Use a combination of pfn_to_page, PFN_DOWN, page_to_pfn, and
virt_to_page to get the same results.
Change-Id: I53cef26059800bc8b7fb85ae458741574c97c257
Signed-off-by: Colin Cross <ccross@android.com>
|
|
ion_heap_map_kernel already implements mapping a scatterlist of
pages into the kernel, and all heaps are required to have struct
pages associated with them, so delete the functions that use
__arm_ioremap and use ion_heap_map_kernel instead.
Change-Id: Ia2dfd8d8c6e719d7d2f68dd4c458826fdb938260
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Use idr_alloc instead if idr_pre_get/idr_get_new_above, and
remove idr_remove_all.
Change-Id: I675b789879549bd3767ed3ef2016cf108eb622d2
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Add a /dev/ion-test device that will be created if CONFIG_ION_TEST
is set. The device accepts a dma_buf fd and allows reading and
writing to the backing memory using DMA-like apis or kernel mapping
apis. Can be used to test the dma_buf mapping ops, including
the ion implementations, from userspace.
Change-Id: I30703ba69cd75bdfe7767ac642e5f0cacd8d0478
Signed-off-by: Colin Cross <ccross@android.com>
|
|
ion_system_heap can only satisfy page alignment, and
ion_system_contig_heap can only satisify alignment to the
allocation size. Neither can support faulting user mappings
because they use slab pages.
Change-Id: I895c2d4184c672f647f83a17aeb862985dc92f2c
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Change-Id: I5ff2764e85151ca0a88576542fda07c2d33dd065
Signed-off-by: Arve Hjønnevåg <arve@android.com>
|
|
https://android.googlesource.com/kernel/common into lsk-v3.10-aosp
|
|
Change-Id: I15b21230d52479d008a00d9e2191dda020f00925
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
Change-Id: I96132a1b7275d389a6d0ba8899c6be838b63c422
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
Change-Id: I3a4228d50fc4a2553b3e92e5675a94cbc6e71b8a
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
Userspace-facing ADF_MAX_ATTACHMENTS must be in terms of
userspace-facing struct adf_attachment_config
Change-Id: Iaaddcd6366f13b3e52eb3911efcfff8a61e0b225
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
Systems may define PAGE_SIZE in userspace limits.h but don't have to.
PAGE_SIZE was picked as an arbitrary "reasonable" limit so just use 4096
instead.
Change-Id: I9555e39aba64a3a70f61eb6ded2a4129ab236ce0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
adf/foobar/device -> adf0
adf/foobar/interface1 -> adf-interface0.1
adf/foobar/overlay-engine1 -> adf-overlay-engine0.1
Change-Id: I7af7f84ce3f101ecb02f448070c200ff3e03f2ec
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
ion is always dealing with the allocation and not the mapping,
so it should always be using sg->length and not sg->dma_length.
Change-Id: Id9b07f1196b2bafe04636fa1aa46dfc84d003cf0
Signed-off-by: Colin Cross <ccross@android.com>
|
|
__dma_page_cpu_to_dev is a private ARM api that is not available
on 3.10 and was never available on other architectures. We can
get the same behavior by calling dma_sync_sg_for_device with a
scatterlist containing a single page. It's still not quite a
kosher use of the dma apis, we still conflate physical addresses
with bus addresses, but it should at least compile on all
platforms, and work on any platform that doesn't have a physical
to bus address translation.
Change-Id: I8451c2dae4bf85841015c016640684ac28430a5a
Signed-off-by: Colin Cross <ccross@android.com>
|
|
If userspace passes a length between -4095 and -1 to allocate it
will pass the len != 0 check, but when len is page aligned it will
be 0. Check len after page aligning.
Drop the warning as well, userspace shouldn't be able to trigger
a warning in the kernel.
Change-Id: I96c7142637638991f3a9af9be7cfbb50f79f3803
Signed-off-by: Colin Cross <ccross@android.com>
|
|
commit 1262ab1846cf76f7549c66ef709120dbfbe6d49f (ion: replace
userspace handle cookies with idr) broke the locking in ion.
The ION_IOC_FREE and ION_IOC_MAP ioctls were relying on
ion_handle_validate to detect the case where a call raced
with another ION_IOC_FREE which may have freed the struct
ion_handle.
Rename ion_uhandle_get to ion_handle_get_by_id, and have it
take the client lock and return with an extra reference to
the handle. Make each caller put its reference once it
is done with the handle.
Also modify users of ion_handle_validate to continue to hold
the client lock after calling ion_handle_validate until
they are done with the handle, and warn if ion_handle_validate
is called without the client lock held.
Change-Id: I56da5624fca3bed4ee24806b6ec39de903543341
Signed-off-by: Colin Cross <ccross@android.com>
|
|
The compat support added to ion didn't provide compat ioctl numbers
(who's value depends on the compat structure size). So 32bit
applications would get an error when trying to make ioctl calls.
This patch adds the needed COMPAT_ macros and uses them in the
compat_ion_ioctl, translating them to their non-compat cmd when
calling the normal ioctl call.
Change-Id: I53636d4ec46d8dc5e694697aaf2d62b98bd78cb1
Signed-off-by: John Stultz <john.stultz@linaro.org>
|
|
Signed-off-by: Arve Hjønnevåg <arve@android.com>
|
|
In the 3.10 kernel, dtb-y is not defined in Makefile.boot anymore
but in dts/Makefile, so it needs to be included too.
Change-Id: I6d6fccf933709bcb6220ce8f12b4b9e2a7c40d63
Signed-off-by: Benoit Goby <benoit@android.com>
|
|
Disable PR_SET_VMA when building with !MMU
Change-Id: I896b6979b99aa61df85caf4c3ec22eb8a8204e64
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Fix two bugs caused by merging anon vma_naming, a typo in
mempolicy.c and a bad merge in sys.c.
Change-Id: Ia4ced447d50573e68195e95ea2f2b4d9456b8a90
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Move the userspace interfaces of sync.h and sw_sync.h to
drivers/staging/android/uapi/
Change-Id: I3b2598b37385bb993bd03f5faa98a8e196befe45
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Move the userspace interface of binder.h to
drivers/staging/android/uapi/binder.h.
Change-Id: I2e56ba89ade5e1f33b121e6ecd456392d588a14e
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Move the userspace interface of ashmem.h to
drivers/staging/android/uapi/ashmem.h
Change-Id: I60f5baa4ce8e2425262a406f2733c089ec55aa72
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Move the userspace interface of android_alarm.h to
drivers/staging/android/uapi/android_alarm.h
Change-Id: Ieb96e8e9bf742786efc4e248e6a242dab8199ca3
Signed-off-by: Colin Cross <ccross@android.com>
|
|
Move the entire contents of the linux/if_pppolac.h and
linux/if_pppopns.h headers to uapi, they only contain userspace
interfaces.
Change-Id: I3cfed7f2ae400b53269a1f59144aa3dbc30ae0b5
Signed-off-by: Colin Cross <ccross@android.com>
|