7 years agoARM: dma-mapping: fix incorrect freeing of atomic allocations
Aaro Koskinen [Tue, 7 Aug 2012 12:44:05 +0000]
ARM: dma-mapping: fix incorrect freeing of atomic allocations

Commit e9da6e9905e639b0f842a244bc770b48ad0523e9 (ARM: dma-mapping:
remove custom consistent dma region) changed the way atomic allocations
are handled. However, arm_dma_free() was not modified accordingly, and
as a result freeing of atomic allocations does not work correctly when
CMA is disabled. Memory is leaked and following WARNINGs are seen:

[   57.698911] ------------[ cut here ]------------
[   57.753518] WARNING: at arch/arm/mm/dma-mapping.c:263 arm_dma_free+0x88/0xe4()
[   57.811473] trying to free invalid coherent area: e0848000
[   57.867398] Modules linked in: sata_mv(-)
[   57.921373] [<c000d270>] (unwind_backtrace+0x0/0xf0) from [<c0015430>] (warn_slowpath_common+0x50/0x68)
[   58.033924] [<c0015430>] (warn_slowpath_common+0x50/0x68) from [<c00154dc>] (warn_slowpath_fmt+0x30/0x40)
[   58.152024] [<c00154dc>] (warn_slowpath_fmt+0x30/0x40) from [<c000dc18>] (arm_dma_free+0x88/0xe4)
[   58.219592] [<c000dc18>] (arm_dma_free+0x88/0xe4) from [<c008fa30>] (dma_pool_destroy+0x100/0x148)
[   58.345526] [<c008fa30>] (dma_pool_destroy+0x100/0x148) from [<c019a64c>] (release_nodes+0x144/0x218)
[   58.475782] [<c019a64c>] (release_nodes+0x144/0x218) from [<c0197e10>] (__device_release_driver+0x60/0xb8)
[   58.614260] [<c0197e10>] (__device_release_driver+0x60/0xb8) from [<c0198608>] (driver_detach+0xd8/0xec)
[   58.756527] [<c0198608>] (driver_detach+0xd8/0xec) from [<c0197c54>] (bus_remove_driver+0x7c/0xc4)
[   58.901648] [<c0197c54>] (bus_remove_driver+0x7c/0xc4) from [<c004bfac>] (sys_delete_module+0x19c/0x220)
[   59.051447] [<c004bfac>] (sys_delete_module+0x19c/0x220) from [<c0009140>] (ret_fast_syscall+0x0/0x2c)
[   59.207996] ---[ end trace 0745420412c0325a ]---
[   59.287110] ------------[ cut here ]------------
[   59.366324] WARNING: at arch/arm/mm/dma-mapping.c:263 arm_dma_free+0x88/0xe4()
[   59.450511] trying to free invalid coherent area: e0847000
[   59.534357] Modules linked in: sata_mv(-)
[   59.616785] [<c000d270>] (unwind_backtrace+0x0/0xf0) from [<c0015430>] (warn_slowpath_common+0x50/0x68)
[   59.790030] [<c0015430>] (warn_slowpath_common+0x50/0x68) from [<c00154dc>] (warn_slowpath_fmt+0x30/0x40)
[   59.972322] [<c00154dc>] (warn_slowpath_fmt+0x30/0x40) from [<c000dc18>] (arm_dma_free+0x88/0xe4)
[   60.070701] [<c000dc18>] (arm_dma_free+0x88/0xe4) from [<c008fa30>] (dma_pool_destroy+0x100/0x148)
[   60.256817] [<c008fa30>] (dma_pool_destroy+0x100/0x148) from [<c019a64c>] (release_nodes+0x144/0x218)
[   60.445201] [<c019a64c>] (release_nodes+0x144/0x218) from [<c0197e10>] (__device_release_driver+0x60/0xb8)
[   60.634148] [<c0197e10>] (__device_release_driver+0x60/0xb8) from [<c0198608>] (driver_detach+0xd8/0xec)
[   60.823623] [<c0198608>] (driver_detach+0xd8/0xec) from [<c0197c54>] (bus_remove_driver+0x7c/0xc4)
[   61.013268] [<c0197c54>] (bus_remove_driver+0x7c/0xc4) from [<c004bfac>] (sys_delete_module+0x19c/0x220)
[   61.203472] [<c004bfac>] (sys_delete_module+0x19c/0x220) from [<c0009140>] (ret_fast_syscall+0x0/0x2c)
[   61.393390] ---[ end trace 0745420412c0325b ]---

The patch fixes this.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: dma-mapping: fix atomic allocation alignment
Aaro Koskinen [Tue, 7 Aug 2012 12:39:25 +0000]
ARM: dma-mapping: fix atomic allocation alignment

The alignment mask is calculated incorrectly. Fixing the calculation
makes strange hangs/lockups disappear during the boot with Amstrad E3
and 3.6-rc1 kernel.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: mm: fix MMU mapping of CMA regions
Chris Brand [Tue, 7 Aug 2012 12:01:14 +0000]
ARM: mm: fix MMU mapping of CMA regions

Fix dma_contiguous_remap() so that it continues through all the
regions, even after encountering one that is outside lowmem.
Without this change, if you have two CMA regions, the first outside
lowmem and the seocnd inside lowmem, only the second one will get
set up in the MMU. Data written to that region then doesn't get
automatically flushed from the cache into memory.

Signed-off-by: Chris Brand <cbrand@broadcom.com>
[extended patch subject with 'fix' word]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: dma-mapping: add support for DMA_ATTR_SKIP_CPU_SYNC attribute
Marek Szyprowski [Wed, 6 Jun 2012 12:50:56 +0000]
ARM: dma-mapping: add support for DMA_ATTR_SKIP_CPU_SYNC attribute

This patch adds support for DMA_ATTR_SKIP_CPU_SYNC attribute for
dma_(un)map_(single,page,sg) functions family. It lets dma mapping clients
to create a mapping for the buffer for the given device without performing
a CPU cache synchronization. CPU cache synchronization can be skipped for
the buffers which it is known that they are already in 'device' domain (CPU
caches have been already synchronized or there are only coherent mappings
for the buffer). For advanced users only, please use it with care.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>

7 years agocommon: DMA-mapping: add DMA_ATTR_SKIP_CPU_SYNC attribute
Marek Szyprowski [Wed, 6 Jun 2012 12:46:44 +0000]
common: DMA-mapping: add DMA_ATTR_SKIP_CPU_SYNC attribute

This patch adds DMA_ATTR_SKIP_CPU_SYNC attribute to the DMA-mapping
subsystem.

By default dma_map_{single,page,sg} functions family transfer a given
buffer from CPU domain to device domain. Some advanced use cases might
require sharing a buffer between more than one device. This requires
having a mapping created separately for each device and is usually
performed by calling dma_map_{single,page,sg} function more than once
for the given buffer with device pointer to each device taking part in
the buffer sharing. The first call transfers a buffer from 'CPU' domain
to 'device' domain, what synchronizes CPU caches for the given region
(usually it means that the cache has been flushed or invalidated
depending on the dma direction). However, next calls to
dma_map_{single,page,sg}() for other devices will perform exactly the
same sychronization operation on the CPU cache. CPU cache sychronization
might be a time consuming operation, especially if the buffers are
large, so it is highly recommended to avoid it if possible.
DMA_ATTR_SKIP_CPU_SYNC allows platform code to skip synchronization of
the CPU cache for the given buffer assuming that it has been already
transferred to 'device' domain. This attribute can be also used for
dma_unmap_{single,page,sg} functions family to force buffer to stay in
device domain after releasing a mapping for it. Use this attribute with
care!

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>

7 years agoARM: dma-mapping: add support for dma_get_sgtable()
Marek Szyprowski [Wed, 13 Jun 2012 08:01:15 +0000]
ARM: dma-mapping: add support for dma_get_sgtable()

This patch adds support for dma_get_sgtable() function which is required
to let drivers to share the buffers allocated by DMA-mapping subsystem.

Generic implementation based on virt_to_page() is not suitable for ARM
dma-mapping subsystem.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>

7 years agocommon: dma-mapping: introduce dma_get_sgtable() function
Marek Szyprowski [Wed, 13 Jun 2012 08:05:52 +0000]
common: dma-mapping: introduce dma_get_sgtable() function

This patch adds dma_get_sgtable() function which is required to let
drivers to share the buffers allocated by DMA-mapping subsystem. Right
now the driver gets a dma address of the allocated buffer and the kernel
virtual mapping for it. If it wants to share it with other device (= map
into its dma address space) it usually hacks around kernel virtual
addresses to get pointers to pages or assumes that both devices share
the DMA address space. Both solutions are just hacks for the special
cases, which should be avoided in the final version of buffer sharing.

To solve this issue in a generic way, a new call to DMA mapping has been
introduced - dma_get_sgtable(). It allocates a scatter-list which
describes the allocated buffer and lets the driver(s) to use it with
other device(s) by calling dma_map_sg() on it.

This patch provides a generic implementation based on virt_to_page()
call. Architectures which require more sophisticated translation might
provide their own get_sgtable() methods.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agoARM: dma-mapping: add support for DMA_ATTR_NO_KERNEL_MAPPING attribute
Marek Szyprowski [Wed, 16 May 2012 18:38:58 +0000]
ARM: dma-mapping: add support for DMA_ATTR_NO_KERNEL_MAPPING attribute

This patch adds support for DMA_ATTR_NO_KERNEL_MAPPING attribute for
IOMMU allocations, what let drivers to save precious kernel virtual
address space for large buffers that are intended to be accessed only
from userspace.

This patch is heavily based on initial work kindly provided by Abhinav
Kochhar <abhinav.k@samsung.com>.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>

7 years agocommon: DMA-mapping: add DMA_ATTR_NO_KERNEL_MAPPING attribute
Marek Szyprowski [Wed, 16 May 2012 13:20:37 +0000]
common: DMA-mapping: add DMA_ATTR_NO_KERNEL_MAPPING attribute

This patch adds DMA_ATTR_NO_KERNEL_MAPPING attribute which lets the
platform to avoid creating a kernel virtual mapping for the allocated
buffer. On some architectures creating such mapping is non-trivial task
and consumes very limited resources (like kernel virtual address space
or dma consistent address space). Buffers allocated with this attribute
can be only passed to user space by calling dma_mmap_attrs().

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

7 years agocommon: dma-mapping: add support for generic dma_mmap_* calls
Marek Szyprowski [Thu, 14 Jun 2012 11:03:04 +0000]
common: dma-mapping: add support for generic dma_mmap_* calls

Commit 9adc5374 ('common: dma-mapping: introduce mmap method') added a
generic method for implementing mmap user call to dma_map_ops structure.

This patch converts ARM and PowerPC architectures (the only providers of
dma_mmap_coherent/dma_mmap_writecombine calls) to use this generic
dma_map_ops based call and adds a generic cross architecture
definition for dma_mmap_attrs, dma_mmap_coherent, dma_mmap_writecombine
functions.

The generic mmap virt_to_page-based fallback implementation is provided for
architectures which don't provide their own implementation for mmap method.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>

7 years agoARM: dma-mapping: fix error path for memory allocation failure
Marek Szyprowski [Fri, 27 Jul 2012 15:12:50 +0000]
ARM: dma-mapping: fix error path for memory allocation failure

This patch fixes incorrect check in error path. When the allocation of
first page fails, the kernel ops appears due to accessing -1 element of
the pages array.

Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: dma-mapping: add more sanity checks in arm_dma_mmap()
Marek Szyprowski [Mon, 30 Jul 2012 07:35:26 +0000]
ARM: dma-mapping: add more sanity checks in arm_dma_mmap()

Add some sanity checks and forbid mmaping of buffers into vma areas larger
than allocated dma buffer.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: dma-mapping: remove custom consistent dma region
Marek Szyprowski [Mon, 30 Jul 2012 07:11:33 +0000]
ARM: dma-mapping: remove custom consistent dma region

This patch changes dma-mapping subsystem to use generic vmalloc areas
for all consistent dma allocations. This increases the total size limit
of the consistent allocations and removes platform hacks and a lot of
duplicated code.

Atomic allocations are served from special pool preallocated on boot,
because vmalloc areas cannot be reliably created in atomic context.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Minchan Kim <minchan@kernel.org>

Conflicts:

arch/arm/mm/dma-mapping.c

Change-Id: I376c99671f8dc3d078d1951022bacec4e46d5865
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>

7 years agomm: vmalloc: use const void * for caller argument
Marek Szyprowski [Fri, 13 Apr 2012 10:32:09 +0000]
mm: vmalloc: use const void * for caller argument

'const void *' is a safer type for caller function type. This patch
updates all references to caller function type.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Minchan Kim <minchan@kernel.org>

7 years agolib/scatterlist: do not re-write gfp_flags in __sg_alloc_table()
Mandeep Singh Baines [Mon, 30 Jul 2012 21:43:22 +0000]
lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table()

We are seeing a lot of sg_alloc_table allocation failures using the new
drm prime infrastructure.  We isolated the cause to code in
__sg_alloc_table that was re-writing the gfp_flags.

There is a comment in the code that suggest that there is an assumption
about the allocation coming from a memory pool.  This was likely true
when sg lists were primarily used for disk I/O.

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Cong Wang <amwang@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rob Clark <rob.clark@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Sonny Rao <sonnyrao@chromium.org>
Cc: Olof Johansson <olofj@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agoscatterlist: add sg_alloc_table_from_pages function
Tomasz Stanislawski [Mon, 18 Jun 2012 07:25:01 +0000]
scatterlist: add sg_alloc_table_from_pages function

This patch adds a new constructor for an sg table. The table is constructed
from an array of struct pages. All contiguous chunks of the pages are merged
into a single sg nodes. A user may provide an offset and a size of a buffer if
the buffer is not page-aligned.

The function is dedicated for DMABUF exporters which often perform conversion
from an page array to a scatterlist. Moreover the scatterlist should be
squashed in order to save memory and to speed-up the process of DMA mapping
using dma_map_sg.

The code is based on the patch 'v4l: vb2-dma-contig: add support for
scatterlist in userptr mode' and hints from Laurent Pinchart.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Andrew Morton <akpm@linux-foundation.org>

7 years agomm: cma: fix condition check when setting global cma area
Marek Szyprowski [Fri, 6 Jul 2012 10:02:04 +0000]
mm: cma: fix condition check when setting global cma area

dev_set_cma_area incorrectly assigned cma to global area on first call
due to incorrect check. This patch fixes this issue.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: dma-mapping: modify condition check while freeing pages
Prathyush K [Mon, 16 Jul 2012 06:59:55 +0000]
ARM: dma-mapping: modify condition check while freeing pages

WARNING: at mm/vmalloc.c:1471 __iommu_free_buffer+0xcc/0xd0()
Trying to vfree() nonexistent vm area (ef095000)
Modules linked in:
[<c0015a18>] (unwind_backtrace+0x0/0xfc) from [<c0025a94>] (warn_slowpath_common+0x54/0x64)
[<c0025a94>] (warn_slowpath_common+0x54/0x64) from [<c0025b38>] (warn_slowpath_fmt+0x30/0x40)
[<c0025b38>] (warn_slowpath_fmt+0x30/0x40) from [<c0016de0>] (__iommu_free_buffer+0xcc/0xd0)
[<c0016de0>] (__iommu_free_buffer+0xcc/0xd0) from [<c0229a5c>] (exynos_drm_free_buf+0xe4/0x138)
[<c0229a5c>] (exynos_drm_free_buf+0xe4/0x138) from [<c022b358>] (exynos_drm_gem_destroy+0x80/0xfc)
[<c022b358>] (exynos_drm_gem_destroy+0x80/0xfc) from [<c0211230>] (drm_gem_object_free+0x28/0x34)
[<c0211230>] (drm_gem_object_free+0x28/0x34) from [<c0211bd0>] (drm_gem_object_release_handle+0xcc/0xd8)
[<c0211bd0>] (drm_gem_object_release_handle+0xcc/0xd8) from [<c01abe10>] (idr_for_each+0x74/0xb8)
[<c01abe10>] (idr_for_each+0x74/0xb8) from [<c02114e4>] (drm_gem_release+0x1c/0x30)
[<c02114e4>] (drm_gem_release+0x1c/0x30) from [<c0210ae8>] (drm_release+0x608/0x694)
[<c0210ae8>] (drm_release+0x608/0x694) from [<c00b75a0>] (fput+0xb8/0x228)
[<c00b75a0>] (fput+0xb8/0x228) from [<c00b40c4>] (filp_close+0x64/0x84)
[<c00b40c4>] (filp_close+0x64/0x84) from [<c0029d54>] (put_files_struct+0xe8/0x104)
[<c0029d54>] (put_files_struct+0xe8/0x104) from [<c002b930>] (do_exit+0x608/0x774)
[<c002b930>] (do_exit+0x608/0x774) from [<c002bae4>] (do_group_exit+0x48/0xb4)
[<c002bae4>] (do_group_exit+0x48/0xb4) from [<c002bb60>] (sys_exit_group+0x10/0x18)
[<c002bb60>] (sys_exit_group+0x10/0x18) from [<c000ee80>] (ret_fast_syscall+0x0/0x30)

This patch modifies the condition while freeing to match the condition
used while allocation. This fixes the above warning which arises when
array size is equal to PAGE_SIZE where allocation is done using kzalloc
but free is done using vfree.

Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: dma-mapping: fix buffer chunk allocation order
Marek Szyprowski [Thu, 21 Jun 2012 09:48:11 +0000]
ARM: dma-mapping: fix buffer chunk allocation order

IOMMU-aware dma_alloc_attrs() implementation allocates buffers in
power-of-two chunks to improve performance and take advantage of large
page mappings provided by some IOMMU hardware. However current code, due
to a subtle bug, allocated those chunks in the smallest-to-largest
order, what completely killed all the advantages of using larger than
page chunks. If a 4KiB chunk has been mapped as a first chunk, the
consecutive chunks are not aligned correctly to the power-of-two which
match their size and IOMMU drivers were not able to use internal
mappings of size other than the 4KiB (largest common denominator of
alignment and chunk size).

This patch fixes this issue by changing to the correct largest-to-smallest
chunk size allocation sequence.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agox86: dma-mapping: fix broken allocation when dma_mask has been provided
Marek Szyprowski [Thu, 14 Jun 2012 12:01:30 +0000]
x86: dma-mapping: fix broken allocation when dma_mask has been provided

Commit 0a2b9a6ea93 ("X86: integrate CMA with DMA-mapping subsystem")
broke memory allocation with dma_mask. This patch fixes possible kernel
ops caused by lack of resetting page variable when jumping to 'again' label.

Reported-by: Konrad Rzeszutek Wilk <konrad@darnok.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>

7 years agoARM: dma-mapping: fix debug messages in dmabounce code
Marek Szyprowski [Wed, 13 Jun 2012 12:04:58 +0000]
ARM: dma-mapping: fix debug messages in dmabounce code

This patch fixes the usage of uninitialized variables in dmabounce code
intoduced by commit a227fb92 ('ARM: dma-mapping: remove offset parameter
to prepare for generic dma_ops'):
arch/arm/common/dmabounce.c: In function ‘dmabounce_sync_for_device’:
arch/arm/common/dmabounce.c:409: warning: ‘off’ may be used uninitialized in this function
arch/arm/common/dmabounce.c:407: note: ‘off’ was declared here
arch/arm/common/dmabounce.c: In function ‘dmabounce_sync_for_cpu’:
arch/arm/common/dmabounce.c:369: warning: ‘off’ may be used uninitialized in this function
arch/arm/common/dmabounce.c:367: note: ‘off’ was declared here

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: mm: fix type of the arm_dma_limit global variable
Marek Szyprowski [Wed, 6 Jun 2012 10:05:01 +0000]
ARM: mm: fix type of the arm_dma_limit global variable

arm_dma_limit stores physical address of maximal address accessible by DMA,
so the phys_addr_t type makes much more sense for it instead of u32. This
patch fixes the following build warning:

arch/arm/mm/init.c:380: warning: comparison of distinct pointer types lacks a cast

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: dma-mapping: remove unconditional dependency on CMA
Marek Szyprowski [Wed, 30 May 2012 08:48:29 +0000]
ARM: dma-mapping: remove unconditional dependency on CMA

CMA has been enabled unconditionally on all ARMv6+ systems to solve the
long standing issue of double kernel mappings for all dma coherent
buffers. This however created a dependency on CONFIG_EXPERIMENTAL for
the whole ARM architecture what should be really avoided. This patch
removes this dependency and lets one use old, well-tested dma-mapping
implementation also on ARMv6+ systems without the need to use
EXPERIMENTAL stuff.

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Conflicts:

arch/arm/Kconfig

Change-Id: Iba374c831b5837187bae04f34132825621a72d07
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>

7 years agoARM: dma-mapping: add support for IOMMU mapper
Marek Szyprowski [Wed, 16 May 2012 13:48:21 +0000]
ARM: dma-mapping: add support for IOMMU mapper

This patch add a complete implementation of DMA-mapping API for
devices which have IOMMU support.

This implementation tries to optimize dma address space usage by remapping
all possible physical memory chunks into a single dma address space chunk.

DMA address space is managed on top of the bitmap stored in the
dma_iommu_mapping structure stored in device->archdata. Platform setup
code has to initialize parameters of the dma address space (base address,
size, allocation precision order) with arm_iommu_create_mapping() function.
To reduce the size of the bitmap, all allocations are aligned to the
specified order of base 4 KiB pages.

dma_alloc_* functions allocate physical memory in chunks, each with
alloc_pages() function to avoid failing if the physical memory gets
fragmented. In worst case the allocated buffer is composed of 4 KiB page
chunks.

dma_map_sg() function minimizes the total number of dma address space
chunks by merging of physical memory chunks into one larger dma address
space chunk. If requested chunk (scatter list entry) boundaries
match physical page boundaries, most calls to dma_map_sg() requests will
result in creating only one chunk in dma address space.

dma_map_page() simply creates a mapping for the given page(s) in the dma
address space.

All dma functions also perform required cache operation like their
counterparts from the arm linear physical memory mapping version.

This patch contains code and fixes kindly provided by:
- Krishna Reddy <vdumpa@nvidia.com>,
- Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
- Hiroshi DOYU <hdoyu@nvidia.com>

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

Conflicts:

arch/arm/mm/dma-mapping.c

Change-Id: Ia619cefe93ea1dba46806d214bf5c147a2818e4e
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>

7 years agoARM: dma-mapping: use alloc, mmap, free from dma_ops
Marek Szyprowski [Wed, 16 May 2012 16:31:23 +0000]
ARM: dma-mapping: use alloc, mmap, free from dma_ops

This patch converts dma_alloc/free/mmap_{coherent,writecombine}
functions to use generic alloc/free/mmap methods from dma_map_ops
structure. A new DMA_ATTR_WRITE_COMBINE DMA attribute have been
introduced to implement writecombine methods.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

Conflicts:

arch/arm/mm/dma-mapping.c

Change-Id: Ic80188bfa7c2167a520d846d6231ffd52d1e14fe
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>

7 years agoARM: dma-mapping: remove redundant code and do the cleanup
Marek Szyprowski [Fri, 10 Feb 2012 18:55:20 +0000]
ARM: dma-mapping: remove redundant code and do the cleanup

This patch just performs a global cleanup in DMA mapping implementation
for ARM architecture. Some of the tiny helper functions have been moved
to the caller code, some have been merged together.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

7 years agoARM: dma-mapping: move all dma bounce code to separate dma ops structure
Marek Szyprowski [Fri, 10 Feb 2012 18:55:20 +0000]
ARM: dma-mapping: move all dma bounce code to separate dma ops structure

This patch removes dma bounce hooks from the common dma mapping
implementation on ARM architecture and creates a separate set of
dma_map_ops for dma bounce devices.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

7 years agoARM: dma-mapping: implement dma sg methods on top of any generic dma ops
Marek Szyprowski [Fri, 10 Feb 2012 18:55:20 +0000]
ARM: dma-mapping: implement dma sg methods on top of any generic dma ops

This patch converts all dma_sg methods to be generic (independent of the
current DMA mapping implementation for ARM architecture). All dma sg
operations are now implemented on top of respective
dma_map_page/dma_sync_single_for* operations from dma_map_ops structure.

Before this patch there were custom methods for all scatter/gather
related operations. They iterated over the whole scatter list and called
cache related operations directly (which in turn checked if we use dma
bounce code or not and called respective version). This patch changes
them not to use such shortcut. Instead it provides similar loop over
scatter list and calls methods from the device's dma_map_ops structure.
This enables us to use device dependent implementations of cache related
operations (direct linear or dma bounce) depending on the provided
dma_map_ops structure.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

7 years agoARM: dma-mapping: use asm-generic/dma-mapping-common.h
Marek Szyprowski [Fri, 10 Feb 2012 18:55:20 +0000]
ARM: dma-mapping: use asm-generic/dma-mapping-common.h

This patch modifies dma-mapping implementation on ARM architecture to
use common dma_map_ops structure and asm-generic/dma-mapping-common.h
helpers.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

Conflicts:

arch/arm/Kconfig

Change-Id: I88140ba3c428e2cd2e1e13dd788f2cc07ce37ebf
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>

7 years agoARM: dma-mapping: remove offset parameter to prepare for generic dma_ops
Marek Szyprowski [Fri, 10 Feb 2012 18:55:20 +0000]
ARM: dma-mapping: remove offset parameter to prepare for generic dma_ops

This patch removes the need for the offset parameter in dma bounce
functions. This is required to let dma-mapping framework on ARM
architecture to use common, generic dma_map_ops based dma-mapping
helpers.

Background and more detailed explaination:

dma_*_range_* functions are available from the early days of the dma
mapping api. They are the correct way of doing a partial syncs on the
buffer (usually used by the network device drivers). This patch changes
only the internal implementation of the dma bounce functions to let
them tunnel through dma_map_ops structure. The driver api stays
unchanged, so driver are obliged to call dma_*_range_* functions to
keep code clean and easy to understand.

The only drawback from this patch is reduced detection of the dma api
abuse. Let us consider the following code:

dma_addr = dma_map_single(dev, ptr, 64, DMA_TO_DEVICE);
dma_sync_single_range_for_cpu(dev, dma_addr+16, 0, 32, DMA_TO_DEVICE);

Without the patch such code fails, because dma bounce code is unable
to find the bounce buffer for the given dma_address. After the patch
the above sync call will be equivalent to:

dma_sync_single_range_for_cpu(dev, dma_addr, 16, 32, DMA_TO_DEVICE);

which succeeds.

I don't consider this as a real problem, because DMA API abuse should be
caught by debug_dma_* function family. This patch lets us to simplify
the internal low-level implementation without chaning the driver visible
API.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

7 years agoARM: dma-mapping: introduce DMA_ERROR_CODE constant
Marek Szyprowski [Wed, 29 Feb 2012 13:45:28 +0000]
ARM: dma-mapping: introduce DMA_ERROR_CODE constant

Replace all uses of ~0 with DMA_ERROR_CODE, what should make the code
easier to read.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

7 years agoARM: dma-mapping: use pr_* instread of printk
Marek Szyprowski [Tue, 28 Feb 2012 09:19:14 +0000]
ARM: dma-mapping: use pr_* instread of printk

Replace all calls to printk with pr_* functions family.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

7 years agoARM: dma-mapping: use dma_mmap_from_coherent()
Marek Szyprowski [Tue, 15 May 2012 17:04:13 +0000]
ARM: dma-mapping: use dma_mmap_from_coherent()

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Conflicts:

arch/arm/mm/dma-mapping.c

Change-Id: I69eae1abd7baa42a2c93e13c3efdba05ba26cdab
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>

7 years agocommon: add dma_mmap_from_coherent() function
Marek Szyprowski [Fri, 23 Mar 2012 12:05:14 +0000]
common: add dma_mmap_from_coherent() function

Add a common helper for dma-mapping core for mapping a coherent buffer
to userspace.

Reported-by: Subash Patel <subashrp@gmail.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>

7 years agoARM: dma-mapping: use PMD size for section unmap
Vitaly Andrianov [Mon, 14 May 2012 17:49:56 +0000]
ARM: dma-mapping: use PMD size for section unmap

The dma_contiguous_remap() function clears existing section maps using
the wrong size (PGDIR_SIZE instead of PMD_SIZE).  This is a bug which
does not affect non-LPAE systems, where PGDIR_SIZE and PMD_SIZE are the same.
On LPAE systems, however, this bug causes the kernel to hang at this point.

This fix has been tested on both LPAE and non-LPAE kernel builds.

Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agocma: fix migration mode
Minchan Kim [Fri, 11 May 2012 07:37:13 +0000]
cma: fix migration mode

__alloc_contig_migrate_range calls migrate_pages with wrong argument
for migrate_mode. Fix it.

Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

7 years agoARM: integrate CMA with DMA-mapping subsystem
Marek Szyprowski [Thu, 29 Dec 2011 12:09:51 +0000]
ARM: integrate CMA with DMA-mapping subsystem

This patch adds support for CMA to dma-mapping subsystem for ARM
architecture. By default a global CMA area is used, but specific devices
are allowed to have their private memory areas if required (they can be
created with dma_declare_contiguous() function during board
initialisation).

Contiguous memory areas reserved for DMA are remapped with 2-level page
tables on boot. Once a buffer is requested, a low memory kernel mapping
is updated to to match requested memory access type.

GFP_ATOMIC allocations are performed from special pool which is created
early during boot. This way remapping page attributes is not needed on
allocation time.

CMA has been enabled unconditionally for ARMv6+ systems.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

Conflicts:

arch/arm/mm/mmu.c

Change-Id: I6d2b534e6ea7b1e1eb6824fa6ce554c9656963f2
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>

7 years agoX86: integrate CMA with DMA-mapping subsystem
Marek Szyprowski [Thu, 29 Dec 2011 12:09:51 +0000]
X86: integrate CMA with DMA-mapping subsystem

This patch adds support for CMA to dma-mapping subsystem for x86
architecture that uses common pci-dma/pci-nommu implementation. This
allows to test CMA on KVM/QEMU and a lot of common x86 boxes.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>

7 years agodrivers: add Contiguous Memory Allocator
Marek Szyprowski [Thu, 29 Dec 2011 12:09:51 +0000]
drivers: add Contiguous Memory Allocator

The Contiguous Memory Allocator is a set of helper functions for DMA
mapping framework that improves allocations of contiguous memory chunks.

CMA grabs memory on system boot, marks it with MIGRATE_CMA migrate type
and gives back to the system. Kernel is allowed to allocate only movable
pages within CMA's managed memory so that it can be used for example for
page cache when DMA mapping do not use it. On
dma_alloc_from_contiguous() request such pages are migrated out of CMA
area to free required contiguous block and fulfill the request. This
allows to allocate large contiguous chunks of memory at any time
assuming that there is enough free memory available in the system.

This code is heavily based on earlier works by Michal Nazarewicz.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: trigger page reclaim in alloc_contig_range() to stabilise watermarks
Marek Szyprowski [Wed, 25 Jan 2012 11:49:24 +0000]
mm: trigger page reclaim in alloc_contig_range() to stabilise watermarks

alloc_contig_range() performs memory allocation so it also should keep
track on keeping the correct level of memory watermarks. This commit adds
a call to *_slowpath style reclaim to grab enough pages to make sure that
the final collection of contiguous pages from freelists will not starve
the system.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Michal Nazarewicz <mina86@mina86.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: extract reclaim code from __alloc_pages_direct_reclaim()
Marek Szyprowski [Wed, 25 Jan 2012 11:09:52 +0000]
mm: extract reclaim code from __alloc_pages_direct_reclaim()

This patch extracts common reclaim code from __alloc_pages_direct_reclaim()
function to separate function: __perform_reclaim() which can be later used
by alloc_contig_range().

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: Serialize access to min_free_kbytes
Mel Gorman [Mon, 25 Apr 2011 21:36:42 +0000]
mm: Serialize access to min_free_kbytes

There is a race between the min_free_kbytes sysctl, memory hotplug
and transparent hugepage support enablement.  Memory hotplug uses a
zonelists_mutex to avoid a race when building zonelists. Reuse it to
serialise watermark updates.

[a.p.zijlstra@chello.nl: Older patch fixed the race with spinlock]
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: page_isolation: MIGRATE_CMA isolation functions added
Michal Nazarewicz [Tue, 3 Apr 2012 13:06:15 +0000]
mm: page_isolation: MIGRATE_CMA isolation functions added

This commit changes various functions that change pages and
pageblocks migrate type between MIGRATE_ISOLATE and
MIGRATE_MOVABLE in such a way as to allow to work with
MIGRATE_CMA migrate type.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: mmzone: MIGRATE_CMA migration type added
Michal Nazarewicz [Thu, 29 Dec 2011 12:09:50 +0000]
mm: mmzone: MIGRATE_CMA migration type added

The MIGRATE_CMA migration type has two main characteristics:
(i) only movable pages can be allocated from MIGRATE_CMA
pageblocks and (ii) page allocator will never change migration
type of MIGRATE_CMA pageblocks.

This guarantees (to some degree) that page in a MIGRATE_CMA page
block can always be migrated somewhere else (unless there's no
memory left in the system).

It is designed to be used for allocating big chunks (eg. 10MiB)
of physically contiguous memory.  Once driver requests
contiguous memory, pages from MIGRATE_CMA pageblocks may be
migrated away to create a contiguous block.

To minimise number of migrations, MIGRATE_CMA migration type
is the last type tried when page allocator falls back to other
migration types when requested.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: page_alloc: change fallbacks array handling
Michal Nazarewicz [Wed, 11 Jan 2012 14:31:33 +0000]
mm: page_alloc: change fallbacks array handling

This commit adds a row for MIGRATE_ISOLATE type to the fallbacks array
which was missing from it.  It also, changes the array traversal logic
a little making MIGRATE_RESERVE an end marker.  The letter change,
removes the implicit MIGRATE_UNMOVABLE from the end of each row which
was read by __rmqueue_fallback() function.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: page_alloc: introduce alloc_contig_range()
Michal Nazarewicz [Thu, 29 Dec 2011 12:09:50 +0000]
mm: page_alloc: introduce alloc_contig_range()

This commit adds the alloc_contig_range() function which tries
to allocate given range of pages.  It tries to migrate all
already allocated pages that fall in the range thus freeing them.
Once all pages in the range are freed they are removed from the
buddy system thus allocated for the caller to use.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: compaction: export some of the functions
Michal Nazarewicz [Thu, 29 Dec 2011 12:09:50 +0000]
mm: compaction: export some of the functions

This commit exports some of the functions from compaction.c file
outside of it adding their declaration into internal.h header
file so that other mm related code can use them.

This forced compaction.c to always be compiled (as opposed to being
compiled only if CONFIG_COMPACTION is defined) but as to avoid
introducing code that user did not ask for, part of the compaction.c
is now wrapped in on #ifdef.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: compaction: introduce isolate_freepages_range()
Michal Nazarewicz [Mon, 30 Jan 2012 12:24:03 +0000]
mm: compaction: introduce isolate_freepages_range()

This commit introduces isolate_freepages_range() function which
generalises isolate_freepages_block() so that it can be used on
arbitrary PFN ranges.

isolate_freepages_block() is left with only minor changes.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: compaction: introduce map_pages()
Michal Nazarewicz [Mon, 30 Jan 2012 12:23:47 +0000]
mm: compaction: introduce map_pages()

This commit creates a map_pages() function which map pages freed
using split_free_pages().  This merely moves some code from
isolate_freepages() so that it can be reused in other places.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: compaction: introduce isolate_migratepages_range()
Michal Nazarewicz [Mon, 30 Jan 2012 12:16:26 +0000]
mm: compaction: introduce isolate_migratepages_range()

This commit introduces isolate_migratepages_range() function which
extracts functionality from isolate_migratepages() so that it can be
used on arbitrary PFN ranges.

isolate_migratepages() function is implemented as a simple wrapper
around isolate_migratepages_range().

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>

7 years agomm: page_alloc: remove trailing whitespace
Michal Nazarewicz [Wed, 11 Jan 2012 14:16:11 +0000]
mm: page_alloc: remove trailing whitespace

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>

7 years agoRevert "Avoid aliasing mappings in DMA coherent allocator"
Hiroshi DOYU [Fri, 13 Jul 2012 09:46:14 +0000]
Revert "Avoid aliasing mappings in DMA coherent allocator"

This reverts commit 386c5b21da6dc7b403084e0cb503f0876badd9d1.

7 years agoARM: tegra: dalmore: fix power tree entry
Laxman Dewangan [Thu, 6 Sep 2012 17:36:18 +0000]
ARM: tegra: dalmore: fix power tree entry

Following are multiple changes in dalmore power:
- Add missing entres.
- Add the device name for some of the controller rails.

Change-Id: I0e91d31fae6efa7c4f0a7933444c7ee713dc1831
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/130212

7 years agoi2c: tegra: rename fast clock and div clock
Chaitanya Bandi [Thu, 6 Sep 2012 15:35:28 +0000]
i2c: tegra: rename fast clock and div clock

Rename fast clock to "fast-clk" and div clock to
"div-clk" in driver and clock table to have aligned
with mainline.

This is based on change:
---------
commit f16e6e77a105ec53496f0d8343895da342917873
Author: Laxman Dewangan <ldewangan@nvidia.com>
i2c: tegra: pass proper name for getting clock
---------

Change-Id: Ib3a70b7b47c38db6eba32e526137325f0b134e6b
Signed-off-by: Chaitanya Bandi <bandik@nvidia.com>
Reviewed-on: http://git-master/r/130198
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>

7 years agoARM: tegra: introduce board-id header
Laxman Dewangan [Thu, 30 Aug 2012 12:31:51 +0000]
ARM: tegra: introduce board-id header

In place of defining the board-id on different boardfile,
introducing the header file for all board-id.
This file will contains all Tegra board definition and
will be used across platform.

Change-Id: Ifd48c7668093c17e037d736b14f5d47bf17db6db
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/130180
Reviewed-by: Automatic_Commit_Validation_User

7 years agoARM: tegra: pluto: fix power rail entry
Laxman Dewangan [Thu, 6 Sep 2012 13:40:02 +0000]
ARM: tegra: pluto: fix power rail entry

Following are multiple changes in pluto power:
- Add missing entres.
- Add the device name for some of the controller rails.
- Clear interrupt polarity bit in PMC register.
- Fix multiple checkpatch error.

Change-Id: Ie2e7e9696aa59449c077d7b05af2c51d299446bf
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/130176
Reviewed-by: Automatic_Commit_Validation_User

7 years agoarm: tegra: dalmore: Add AUO panel timing
Animesh Kishore [Tue, 4 Sep 2012 10:19:01 +0000]
arm: tegra: dalmore: Add AUO panel timing

Add panel timing info.

Bug 1028789

Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Change-Id: I5f17e36ef7cb22734303d69371c6bf167f5b62a9
Reviewed-on: http://git-master/r/130157
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoarm: tegra: pluto: Add fb dimensions for LG panel
Animesh Kishore [Tue, 4 Sep 2012 11:20:35 +0000]
arm: tegra: pluto: Add fb dimensions for LG panel

Add fb width and height.

Bug 1028791

Change-Id: I2e40b08b9719a87ebae4fa84725b3cb619c66372
Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Reviewed-on: http://git-master/r/130149
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoARM: tegra: fuse: rename regulator name as per chip pin name
Laxman Dewangan [Sun, 2 Sep 2012 08:55:37 +0000]
ARM: tegra: fuse: rename regulator name as per chip pin name

The pin name for fuse supply for different chip have different
name as follows:
- Tegra20 has the name as vdd_fuse.
- Tegra30 and later have the name as vpp_fuse.

Correcting name of the regulator supply and implementing same
in odm driver.

Change-Id: Ic7a49f365fa30aa71b198ba588dcc4bfc36dcc98
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/130144
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoarm: tegra: dalmore/pluto: Fix backlight and pwm
Animesh Kishore [Sun, 2 Sep 2012 11:09:08 +0000]
arm: tegra: dalmore/pluto: Fix backlight and pwm

Assign correct gpio to backlight enable and
internal pwm.

Bug 1017692

Change-Id: I93864612c2694c8a9fe06e01836e95c9a61cbe76
Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Reviewed-on: http://git-master/r/130139
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoarm: tegra: config: Add tegra11 defconfig
Ramalingam C [Thu, 6 Sep 2012 11:18:45 +0000]
arm: tegra: config: Add tegra11 defconfig

Adding the L4T defconfig for the tegra11 based boards.

Change-Id: Ib71c9b01fe8f70f644483dbc7947e133a9032136
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: http://git-master/r/130128
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

7 years agoarm: tegra: config: Add Pluto and Dalmore
Ramalingam C [Thu, 6 Sep 2012 10:36:46 +0000]
arm: tegra: config: Add Pluto and Dalmore

Adding the config variables for the dalmore_t30 and pluto_t30
boards in tegra3_defconfig

Change-Id: Iaaaa949e06424a32116821952256e51b43e18737
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: http://git-master/r/130104
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoarm: tegra : Add IMX091 camera sensor support.
Sunil Gangele [Thu, 6 Sep 2012 08:37:34 +0000]
arm: tegra : Add IMX091 camera sensor support.

Support for IMX091 Camera sensor driver.

Bug 961418
Signed-off-by: Sunil Gangele <sgangele@nvidia.com>
Change-Id: I5b79e89f8b1733e954e418f91011c30b28f4a512
Reviewed-on: http://git-master/r/130010
Reviewed-by: Prayas Mohanty <pmohanty@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

7 years agodriver: Add IMX091 Camera sensor support in kernel.
Sunil Gangele [Thu, 6 Sep 2012 08:24:09 +0000]
driver: Add IMX091 Camera sensor support in kernel.

Support for IMX091 Camera sensor driver.

Bug 961418
Signed-off-by: Sunil Gangele <sgangele@nvidia.com>
Change-Id: I323f189b8c2dda6002e8639dd705b1bfde2cfdea
Reviewed-on: http://git-master/r/130003
Reviewed-by: Prayas Mohanty <pmohanty@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

7 years agodrivers:video:tegra: Fix CDMA timeout recovery
Arto Merilainen [Mon, 3 Sep 2012 12:48:49 +0000]
drivers:video:tegra: Fix CDMA timeout recovery

This patch fixes wait base handling in CDMA timeouts.

Bug 1025617

Change-Id: Ia93e55631c1159da161d5c4f257d3beebf0d3149
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/129973
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>

7 years agovideo: tegra: host: Implement Tegra11 3D reg read
Terje Bergstrom [Mon, 3 Sep 2012 11:59:39 +0000]
video: tegra: host: Implement Tegra11 3D reg read

Implement 3D register read using Tegra11 gr3d direct to memory
write.

Bug 1038891

Change-Id: I5dc3a6cc3ce2363af4b90ba2be291da74e4541d5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/129953
Reviewed-by: Automatic_Commit_Validation_User

7 years agovideo: tegra: host: Implement Tegra3 3D reg read
Terje Bergstrom [Mon, 3 Sep 2012 11:51:04 +0000]
video: tegra: host: Implement Tegra3 3D reg read

Implement 3D register read using Tegra3 gr3d direct to memory
write.

Bug 1038891

Change-Id: I70481608f7e06280c7c1378ae5e2454fca5342ed
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/129952
Reviewed-by: Automatic_Commit_Validation_User

7 years agovideo: tegra: host: Make 3D reg read device op
Terje Bergstrom [Mon, 3 Sep 2012 09:55:35 +0000]
video: tegra: host: Make 3D reg read device op

Make 3D register read an operation of the 3D device. For now,
implement it for Tegra20 and use the same implementation on other
chips.

Bug 1038891

Change-Id: Ic483d3554c5a3bad38d54043997a2a416cf37ea9
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/129951
Reviewed-by: Automatic_Commit_Validation_User

7 years agovideo: tegra: host: Sync Tegra11 gr3d with Tegra3
Terje Bergstrom [Tue, 28 Aug 2012 12:19:11 +0000]
video: tegra: host: Sync Tegra11 gr3d with Tegra3

Tegra3 gr3d context switching has some fixes and changes that do not
exist yet in Tegra11:

 * FDC flush
 * Dynamic syncpt id
 * Usage of constant instead of magic numbers in reg names
 * Removal of __init on non-init functions
 * ISP channel has sync points listed
 * 2D submits are serialized
 * Some clock rates were misaligned
 * Some #include rearrangement and white space alignment

Change-Id: Id7c917a137ebf510206a94abbb7ceb1aa563a643
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/129950
Reviewed-by: Automatic_Commit_Validation_User

7 years agoRevert "video: tegra: update nvmap_alloc_handle interface"
Michal Pecio [Tue, 4 Sep 2012 22:25:40 +0000]
Revert "video: tegra: update nvmap_alloc_handle interface"

This reverts commit dc64dc2fad1856e649781298e43b5ee92357976a
and related commit cd23fcb0d3c68545ff16b24ca9df9de0531e6f68.

Reason: userspace ABI breakage.

Bug 1035482

Change-Id: I6b9aa12af782bf9b5bf172da0e9599e39ac968b7
Signed-off-by: Michal Pecio <mpecio@nvidia.com>
Reviewed-on: http://git-master/r/129881
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
GVS: Gerrit_Virtual_Submit

7 years agoARM: Tegra3: defconfig: fix bcmdhd fw and nvram path
Syed Rafiuddin [Wed, 6 Jun 2012 04:44:09 +0000]
ARM: Tegra3: defconfig: fix bcmdhd fw and nvram path

change CONFIG_BCMDHD_FW_PATH to bcm4330/fw_bcmdhd.bin
and CONFIG_BCMDHD_NVRAM_PATH path nvram_4330.txt

Bug 976783

Change-Id: I8ff0b690201cd1bdb83329d10c1a4a9692889bb2
Signed-off-by: Syed Rafiuddin <srafiuddin@nvidia.com>
Reviewed-on: http://git-master/r/105073
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoARM: tegra: dalmore: initialize 3rd usb port
Graziano Misuraca [Wed, 5 Sep 2012 22:16:00 +0000]
ARM: tegra: dalmore: initialize 3rd usb port

Change-Id: I74ff45003bc64eec12967c96f5a83c4f7fefb441
Signed-off-by: Ray Poudrier <rapoudrier@nvidia.com>
Signed-off-by: Graziano Misuraca <gmisuraca@nvidia.com>
Reviewed-on: http://git-master/r/129850
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

7 years agoARM: tegra: rt5640: remove passing of regulator name
Laxman Dewangan [Fri, 31 Aug 2012 08:54:37 +0000]
ARM: tegra: rt5640: remove passing of regulator name

Hardcode the regulator name based on device pin names and
passing correct information through platform data.

Change-Id: I657bbc17626654389041f316f36ca1649757d6ff
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Vijay Mali <vmali@nvidia.com>
Reviewed-on: http://git-master/r/129845
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>

7 years agoARM: tegra: fix dalmore-t114 compilation errors
aghuge [Wed, 5 Sep 2012 12:43:59 +0000]
ARM: tegra: fix dalmore-t114 compilation errors

Bug 1035282

Change-Id: I6e158ce88a8cce4818fe6ec633b1bb58564d8b18
Signed-off-by: aghuge <aghuge@nvidia.com>
Reviewed-on: http://git-master/r/129834
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

7 years agoARM: tegra: T114: Update tegra11_android_defconfig
aghuge [Wed, 5 Sep 2012 07:44:26 +0000]
ARM: tegra: T114: Update tegra11_android_defconfig

Change-Id: Ibbaa79718b1e81585f3fd5a827bf2d89866e45bd
Signed-off-by: aghuge <aghuge@nvidia.com>
Reviewed-on: http://git-master/r/129833
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

7 years agoARM: tegra11: Remove cache initialization
Bo Yan [Wed, 29 Aug 2012 05:59:49 +0000]
ARM: tegra11: Remove cache initialization

T11x has no external L2 cache, cache initialization is unnecessary.
The required data latency has been set in bootloader and secondary
CPU startup routine before cache is enabled.

Change-Id: I2e013cc2587374af7d693990b1baf5c4e1a4cdc8
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/129832
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

7 years agoarm: tegra: dalmore: Enable display subsystem
Vineel Kumar Reddy Kovvuri [Mon, 3 Sep 2012 14:05:56 +0000]
arm: tegra: dalmore: Enable display subsystem

enabled TEGRA_PANEL_ENABLE macro

Bug 1042382

Change-Id: Iaaf434eb02e2c852ab65c3f2f63947a491fbc7a9
Signed-off-by: Vineel Kumar Reddy Kovvuri <vineelkumarr@nvidia.com>
Reviewed-on: http://git-master/r/129831
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

7 years agoarm: tegra: pluto: enable 8bit mode for eMMC
Gaurav Batra [Thu, 30 Aug 2012 00:14:53 +0000]
arm: tegra: pluto: enable 8bit mode for eMMC

Change-Id: Ia46e3719915ff7d3c13ed1918df9544b3e37b6a8
Signed-off-by: Gaurav Batra <gbatra@nvidia.com>
Reviewed-on: http://git-master/r/129830
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

7 years agoARM: Tegra: Dalmore: Enable keyboard support
Graziano Misuraca [Tue, 4 Sep 2012 21:24:25 +0000]
ARM: Tegra: Dalmore: Enable keyboard support

kbc was added for dalmore but it was never actually
initialized.

Bug 1017712

Change-Id: I67609fd33b582d7e5b45de63ec351f2087eaa2af
Signed-off-by: Graziano Misuraca <gmisuraca@nvidia.com>
Reviewed-on: http://git-master/r/129829
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

7 years agoARM: tegra: pluto: enable keyboard support
Laxman Dewangan [Fri, 31 Aug 2012 14:26:09 +0000]
ARM: tegra: pluto: enable keyboard support

Enable keyboard support by initializing require
key related driver registration.

Change-Id: I531b3ea4613541397e37ba1850a4894e9ac5984d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/129828
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>

7 years agoarm: tegra: pluto: Support for hdmi
Gaurav Batra [Sat, 1 Sep 2012 00:58:26 +0000]
arm: tegra: pluto: Support for hdmi

Added code for hotplug_init and postsuspend
functions for hdmi.

Change-Id: I5ac086d1581c536c5dcae761d7d60798c246080c
Signed-off-by: Gaurav Batra <gbatra@nvidia.com>
Reviewed-on: http://git-master/r/129827
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>

7 years agoarm: tegra: Add panel reset support
Animesh Kishore [Fri, 31 Aug 2012 13:38:31 +0000]
arm: tegra: Add panel reset support

Most dsi panels need to be reseted
before init.

Bug 1034528
Bug 1028791
Bug 1028790
Bug 1028789
Bug 1012298

Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Change-Id: I30d681cd9784c9d05a2b49652507b44bd8ccfa97
Reviewed-on: http://git-master/r/129826
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
GVS: Gerrit_Virtual_Submit

7 years agoMerge remote-tracking branch 'experimental/dev/android-t114-3.4-rebased' into android...
Varun Wadekar [Fri, 31 Aug 2012 07:28:23 +0000]
Merge remote-tracking branch 'experimental/dev/android-t114-3.4-rebased' into android-t114-3.4

this is part of the merge from main to dev-t114 from main-jb-2012.08.30-B4

Change-Id: I7c2e7e2d84fa37d5de754ed2f5eace7ccac37519

7 years agomfd: aic3262: Add support for HP detection
Manoj Gangwal [Thu, 30 Aug 2012 10:09:30 +0000]
mfd: aic3262: Add support for HP detection

Bug 1041365

Change-Id: Iaff67abf1e54e15bd159f4818ef1d06416234893
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/128473
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Tested-by: Scott Peterson <speterson@nvidia.com>

7 years agoasoc: aic326x codecs: Fix HP detection issue.
Manoj Gangwal [Thu, 30 Aug 2012 09:53:09 +0000]
asoc: aic326x codecs: Fix HP detection issue.

There was issue with the flags used in headset
detection function of TI codec.

Bug 1041365

Change-Id: I44c990ebbe30ebdbd79d486ce3f1f03f6c3c507e
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/128469
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Tested-by: Scott Peterson <speterson@nvidia.com>

7 years agoasoc: aic326x machine: Route voice call to asi2
Manoj Gangwal [Wed, 29 Aug 2012 13:50:53 +0000]
asoc: aic326x machine: Route voice call to asi2

Route voice call to asi2 for TAI

Bug 1034241

Change-Id: I5f6de84e6892207991d28a1d817487aa10b71099
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/128225
GVS: Gerrit_Virtual_Submit
Reviewed-by: Michael Hsu <mhsu@nvidia.com>
Tested-by: Michael Hsu <mhsu@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>

7 years agoasoc: soc-dapm: Add support for TI driver
Manoj Gangwal [Wed, 22 Aug 2012 16:55:49 +0000]
asoc: soc-dapm: Add support for TI driver

Bug 1034241

Change-Id: Ie136f34030952f86244c5650bdd3844ed704d6b8
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/125283
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Peterson <speterson@nvidia.com>

7 years agoarm: tegra: kai: correct compass orientation
Chandler Zhang [Tue, 28 Aug 2012 09:42:59 +0000]
arm: tegra: kai: correct compass orientation

The previous orientation matrix was incorrect and breaks compass
function.

Bug 1034522

Change-Id: I0567b512a709bd0cce8307312aee3ac386f77c1f
Signed-off-by: Chandler Zhang <chazhang@nvidia.com>
Reviewed-on: http://git-master/r/127815
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Robert Collins <rcollins@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agoiio:isl29028: change proximity default period.
Erik Lilliebjerg [Mon, 27 Aug 2012 13:12:06 +0000]
iio:isl29028: change proximity default period.

Changed proximity default period for the most power savings.

Bug 1013133

Change-Id: I6d96510718aff3e23e6aa560c29339494f1a7557
Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-on: http://git-master/r/127547
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit

7 years agoASoC: Tegra: Add ALSA ctl to set DMA address
Sumit Bhattacharya [Mon, 27 Aug 2012 08:07:39 +0000]
ASoC: Tegra: Add ALSA ctl to set DMA address

Add support for setting of DMA address through alsa control for AVP
rendering. This is required to directly do DMA from IRAM to I2S.

Bug 1024403

Change-Id: I6b79ae6e9a562160a19d238b817e1a8b407ac208
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/127436
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Niranjan Wartikar <nwartikar@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Peterson <speterson@nvidia.com>

7 years agoarm: tegra: la: Add config option for latency allowance.
Krishna Reddy [Thu, 23 Aug 2012 20:57:47 +0000]
arm: tegra: la: Add config option for latency allowance.

This allows enable/disable latency allowance.

Change-Id: Iee2cb320f40de902e0c2792c516d7ac108451224
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/126984
GVS: Gerrit_Virtual_Submit

7 years agovideo: tegra: dc: fix boot issue with HDMI
Deepak Nibade [Thu, 16 Aug 2012 11:58:51 +0000]
video: tegra: dc: fix boot issue with HDMI

Set default mode for probe and resume to enable initialization of dc.1
Skipping this initialization results in hard system hang.

bug 1030415

Change-Id: Icd8fe08a7803490117ed20caf0185f5cd4fb0d0b
Reviewed-on: http://git-master/r/124001
(cherry picked from commit 50fa5e50b74a0534d7524fb6d7dcaa65b2e6e74c)
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/126782
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agovideo: tegra: nvmap: Add config to fill page pools at init.
Krishna Reddy [Mon, 23 Jul 2012 22:23:52 +0000]
video: tegra: nvmap: Add config to fill page pools at init.

This config option allows disabling page pool fill during page pool init
and avoids increase in boottime.

Change-Id: Icdffd5c3e7114d9c368c8900c53adf72be2f3462
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/123545
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agovideo: tegra: dc: move set default videomode out of _tegra_dc_enable.
Marvin Zhang [Fri, 3 Aug 2012 00:03:21 +0000]
video: tegra: dc: move set default videomode out of _tegra_dc_enable.

Set default videomode happens during probe and resume. _tegra_dc_enable
is also called during hotplug, setting default videomode there causes
hdcp test failure.

Bug 991805

Reviewed-on: http://git-master/r/121052
(cherry picked from commit 7d4e0461a88b8cf638963e69829274824fecc38b)
Change-Id: Ic71ca4df54a2c7f4a6cb2b56143cd86f718bd39e
Signed-off-by: Marvin Zhang <mzhang@nvidia.com>
Reviewed-on: http://git-master/r/121981
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoenterprise pinmux: set the pinmux for audio ports
Nikesh Oswal [Tue, 28 Aug 2012 14:21:04 +0000]
enterprise pinmux: set the pinmux for audio ports

Bug: 1039342

Change-Id: Ie96b123129dc7e78569dbfee781a717c76538668

Reviewed-on: http://git-master/r/127868
(cherry picked from commit 92f2d2099e3411dfa1966e8ead58dc5654f3124c)

Signed-off-by: Nikesh Oswal <noswal@nvidia.com>
Change-Id: Ida83875fe9dbad386f101a6aca572a6b2b7b2018
Reviewed-on: http://git-master/r/128101
Reviewed-by: Niranjan Wartikar <nwartikar@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>

7 years agoarm: mm: Fix cpa_lock deadlock during split_large_page.
Krishna Reddy [Tue, 24 Jul 2012 05:14:47 +0000]
arm: mm: Fix cpa_lock deadlock during split_large_page.

cpa_lock should be released before allocating memory in split_large_page.
Bug 997083

Change-Id: I262d94a1f75ebf225e5361893620f34150746313
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/120164

7 years agospi: tegra: Add stub runtime power management
Laxman Dewangan [Wed, 29 Aug 2012 11:42:05 +0000]
spi: tegra: Add stub runtime power management

Add stub runtime_pm calls which go through the flow of enabling and
disabling but don't actually do anything with the device itself as
there's nothing useful we can do. This provides the core PM framework
with information about when the device is idle, enabling chip wide
power savings.

Change-Id: Ie795c16840ccbe07e1a8bfac1a1c5a87281e6849
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/128184
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
GVS: Gerrit_Virtual_Submit

7 years agoi2c: tegra: Add stub runtime power management
Laxman Dewangan [Wed, 29 Aug 2012 10:11:37 +0000]
i2c: tegra: Add stub runtime power management

Add stub runtime_pm calls which go through the flow of enabling and
disabling but don't actually do anything with the device itself as
there's nothing useful we can do. This provides the core PM framework
with information about when the device is idle, enabling chip wide
power savings.
The change is based on change done by Mark Brown for s3c2410 i2c bus
driver.
----------
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
    i2c-s3c2410: Add stub runtime power management
----------

Change-Id: Icb92129c4f79a1642b2b73d14578b05928d745a8
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/128151

7 years agoi2c: tegra: rename fast clock and div clock
Laxman Dewangan [Wed, 29 Aug 2012 09:49:04 +0000]
i2c: tegra: rename fast clock and div clock

Rename fast clock to "fast-clk" and div clock to
"div-clk" in driver and clock table to have aligned
with mainline as:
This is based on change:
---------
commit f16e6e77a105ec53496f0d8343895da342917873
Author: Laxman Dewangan <ldewangan@nvidia.com>
    i2c: tegra: pass proper name for getting clock
---------

Change-Id: Ie9a1972a18e2e60ac7c84c4509860cf72405ef16
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/128150

7 years agoi2c: tegra: remove support for I2C_M_REV_DIR_ADDR
Laxman Dewangan [Wed, 29 Aug 2012 09:41:59 +0000]
i2c: tegra: remove support for I2C_M_REV_DIR_ADDR

The Tegra i2c controller actually can not support the reverse of
direction address (toggling r/w bit of address) as controller
take 7 bit address from configuration and HW make it 8 bit address
based on read/write flag.
Hence reverting this protocol mangling support.

Change-Id: I987b2be343d535c078e27b44575717a209d15584
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/128149