Commit Graph

380137 Commits

Author SHA1 Message Date
黄涛
4d426f612e Merge remote-tracking branch 'origin/upstream/linux-linaro-lsk-v3.10-android' into linux-linaro-lsk-v3.10-android+android-common-3.10
Conflicts:
	kernel/printk.c
2013-12-17 14:41:09 +08:00
Mark Brown
425f051d39 Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-12-16 16:28:09 +00:00
Mark Brown
d1eda188a3 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-fvp' into linux-linaro-lsk 2013-12-16 16:27:59 +00:00
Mark Brown
9c5050cb97 arm64: dts: Add properties required for CLCD enumeration
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-16 16:26:36 +00:00
Mark Brown
e992529818 Merge remote-tracking branch 'lsk/v3.10/topic/aosp-warnings' into linux-linaro-lsk-android 2013-12-13 18:53:19 +00:00
Mark Brown
358194677f Merge remote-tracking branch 'lsk/v3.10/topic/aosp' into linux-linaro-lsk-android
Conflicts:
	drivers/staging/android/ion/ion_chunk_heap.c
	kernel/printk.c
2013-12-13 18:52:59 +00:00
Mark Brown
679160a872 Merge branch 'android-3.10' of https://android.googlesource.com/kernel/common into lsk-v3.10-aosp 2013-12-13 18:50:12 +00:00
Mark Hambleton
7138440c58 netfilter: fix function return types for 64bit
Fix functions to return ssize_t instead of int to match
prototypes.

Signed-off-by: Mark Hambleton <mahamble@broadcom.com>
Reviewed-by: Edwin Chan <echan@broadcom.com>
Reviewed-by: James King <jamesk@broadcom.com>
Reviewed-by: John Garry <jgarry@broadcom.com>
Reviewed-by: Mark Hambleton <mark.hambleton@broadcom.com>
Reviewed-by: Joyjit Nath <joyjit@broadcom.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-13 18:48:02 +00:00
Mark Brown
5a4b318f12 Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-12-13 17:25:16 +00:00
Mark Brown
e6b9c92939 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-hmp' into linux-linaro-lsk 2013-12-13 17:24:35 +00:00
Mark Hambleton
8ecd48091c arm64: Enable HMP for ARMv8
Signed-off-by: Mark Hambleton <mahamble@broadcom.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-13 13:23:36 +00:00
Mark Brown
492df0b134 Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-12-13 12:31:39 +00:00
Mark Brown
32af9f3d6c Merge remote-tracking branch 'lsk/v3.10/topic/arm64-cpu' into linux-linaro-lsk 2013-12-13 12:28:13 +00:00
Sudeep KarkadaNagesha
5066e800ba ARM64: DT: define ARM64 specific arch_match_cpu_phys_id
OF/DT core library provides architecture specific hook to match the
logical cpu index with the corresponding physical identifier.

On ARM64, the MPIDR_EL1 contains specific bitfields(MPIDR_EL1.Aff{3..0})
which uniquely identify a CPU, in addition to some non-identifying
information and reserved bits. The ARM cpu binding defines the 'reg'
property to only contain the affinity bits, and any cpu nodes with other
bits set in their 'reg' entry are skipped.

This patch overrides the weak definition of arch_match_cpu_phys_id
with ARM64 specific version using MPIDR_EL1.Aff{3..0} as cpu physical
identifiers.

Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 6e15d0e04b)
2013-12-13 12:27:35 +00:00
Mark Brown
2de8a21235 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-topology' into linux-linaro-lsk 2013-12-13 10:56:15 +00:00
Mark Brown
d474d10a1a arm64: Add scheduler multicore and SMT Kconfig options
Enable additional use of additional scheduler features with the topology
information.

Reported-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-13 10:52:57 +00:00
John Stultz
8f1c422841 ion: Improve ION config description
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>
2013-12-12 18:27:15 -08:00
John Stultz
0f9ae3f7fc ion: Cleanup whitespace issues and other checkpatch problems
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>
2013-12-12 18:27:15 -08:00
JP Abgrall
191b477931 android: configs: Reorder config fragments, update README
Change-Id: I5ee4b794dcc00f74f26562e49a406ea292af63ee
(cherry picked from commit 9ebedefd06142c9bc812bfa23401031525002a76)
2013-12-13 00:47:46 +00:00
Colin Cross
8069739d23 ion: fix bugs in cma heap
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>
2013-12-12 15:27:15 -08:00
Colin Cross
1b1cbed2f4 ion: add alignment check to chunk heap
Change-Id: I4be12b9545a81f9b46339a905f00e1e64896b3ed
Signed-off-by: Colin Cross <ccross@android.com>
2013-12-12 15:27:14 -08:00
Colin Cross
049ca90450 ion: add helper to zero contiguous region of pages
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>
2013-12-12 15:27:14 -08:00
Colin Cross
1ebba641fb ion: carveout heap: zero buffers on free, fix memory leak
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>
2013-12-12 15:27:13 -08:00
Colin Cross
6db8a1c0c9 ion: fix sparse warnings
Fix sparse warnings in ion.

Change-Id: Icbadf2ca53bea20914f608f619568629c178eae3
Signed-off-by: Colin Cross <ccross@android.com>
2013-12-12 15:27:13 -08:00
Colin Cross
5d68d97272 ion: use alloc_pages in system contig heap
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>
2013-12-12 15:27:12 -08:00
Colin Cross
1f67f75203 ion: allow cached mappings of chunk and system heap buffers
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>
2013-12-12 15:27:11 -08:00
Colin Cross
d671290eae ion: remove ion_heap_alloc_pages
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>
2013-12-12 15:27:11 -08:00
Colin Cross
ed6cfafce5 ion: use vm_insert_pfn for faulted pages
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>
2013-12-12 15:27:10 -08:00
Colin Cross
3b8da00c6c ion: check return value from remap_pfn_range
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>
2013-12-12 15:27:10 -08:00
Colin Cross
b928ad649c ion: free low memory from page pools first
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>
2013-12-12 15:27:09 -08:00
Colin Cross
fc04e484c3 ion: optimize ion_heap_buffer_zero
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>
2013-12-12 15:27:09 -08:00
Colin Cross
63ddadde39 ion: add alignment check to carveout heap
Change-Id: I25c752b3eacb48cccea5be2df319634b3affd331
Signed-off-by: Colin Cross <ccross@android.com>
2013-12-12 15:27:08 -08:00
Colin Cross
8af13473b7 ion: drop dependency on ARM
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>
2013-12-12 15:27:07 -08:00
John Stultz
818017a0ca ion: Fix two small issues in system_heap allocation
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>
2013-12-12 15:27:07 -08:00
Mitchel Humpherys
9273153e86 gpu: ion: fix use-after-free in ion_heap_freelist_drain
The `buffer' variable is being used after being freed. Fix this.

Change-Id: Iea3471fa7dc7535bbf0620c1639fea2008d7cf19
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-12-12 15:27:06 -08:00
Colin Cross
b2ee33eb98 ion: clean up ioctls
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>
2013-12-12 15:27:06 -08:00
Colin Cross
30b7bee7c5 gpu: ion: remove unnecessary function from system heap
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>
2013-12-12 15:27:05 -08:00
Colin Cross
21e08b49ac ion: fix printk warnings
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>
2013-12-12 15:27:05 -08:00
Colin Cross
f26a6f2aa0 ion: don't use phys_to_page or __phys_to_pfn
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>
2013-12-12 15:27:04 -08:00
Colin Cross
c7442a7605 ion: don't use __arm_ioremap to map pages
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>
2013-12-12 15:27:03 -08:00
Colin Cross
acd77fc7d0 ion: update idr to avoid deprecated apis
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>
2013-12-12 15:27:03 -08:00
Colin Cross
5c31b87cef ion: add test device for unit tests to interact with dma_bufs
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>
2013-12-12 15:26:36 -08:00
Mark Brown
df6930e66a Merge remote-tracking branch 'lsk/v3.10/topic/arm64-fvp' into linux-linaro-lsk 2013-12-12 17:16:17 +00:00
Mark Brown
daba0d21c3 video: amba-clcd: Make CLCD driver available on more platforms
The CLCD driver is used on ARM reference models for ARMv8 so add ARM64
to the list of dependencies. The driver also has no build time dependencies
on ARM (stubs are provided for ARM-specific DMA functions in the code) so
make it available with COMPILE_TEST in order to maximise build coverage.

Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-12 17:13:32 +00:00
Mark Brown
78157f5f8c Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2013-12-12 10:22:32 +00:00
Mark Brown
16c29dd8dd Merge tag 'v3.10.24' into linux-linaro-lsk
This is the 3.10.24 stable release
2013-12-12 10:22:21 +00:00
Greg Kroah-Hartman
05bcf8f867 Linux 3.10.24 v3.10.24 2013-12-11 22:36:44 -08:00
Tom Lendacky
9096e7d488 crypto: scatterwalk - Use sg_chain_ptr on chain entries
commit 389a539058 upstream.

Now that scatterwalk_sg_chain sets the chain pointer bit the sg_page
call in scatterwalk_sg_next hits a BUG_ON when CONFIG_DEBUG_SG is
enabled. Use sg_chain_ptr instead of sg_page on a chain entry.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-11 22:36:29 -08:00
Arnaud Ebalard
a983e1d309 ARM: mvebu: second PCIe unit of Armada XP mv78230 is only x1 capable
commit 12b69a5997 upstream.

Various Marvell datasheets advertise second PCIe unit of mv78230
flavour of Armada XP as x4/quad x1 capable. This second unit is in
fact only x1 capable. This patch fixes current mv78230 .dtsi to
reflect that, i.e. makes 1.0 the second interface (instead of 2.0
at the moment). This was successfully tested on a mv78230-based
ReadyNAS 2120 platform with a x1 device (FL1009 XHCI controller)
connected to this second interface.

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-11 22:36:29 -08:00
Arnaud Ebalard
a5f196ca90 ARM: mvebu: fix second and third PCIe unit of Armada XP mv78260
commit 2163e61c92 upstream.

mv78260 flavour of Marvell Armada XP SoC has 3 PCIe units. The
two first units are both x4 and quad x1 capable. The third unit
is only x4 capable. This patch fixes mv78260 .dtsi to reflect
those capabilities.

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-11 22:36:29 -08:00