gpu: ion: Export ion_client_create

Will enable modules to allocate memory with ion.

Signed-off-by: Johan Mossberg <johan.mossberg@stericsson.com>
gpu: ion: Remove heapmask from client

The heapmask in the client generally wasn't being used.  This
patch removes it.

Change-Id: I3526723fbf8f2e81c28c0733deb583ea14bdd837
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
gpu: ion: Modify zeroing code so it only allocates address space once

vmap/vunmap spend a significant amount of time allocating the
address space to map into.  Rather than allocating address space
for each page, instead allocate once for the entire allocation
and then just map and unmap each page into that address space.

Change-Id: I4a5c850717c80f75506a36b7ec2bcd55857b8dea
Signed-off-by: Rebecca Schultz Zavin <rschultz@google.com>
gpu: ion: Refactor the code to zero buffers

Refactor the code in the system heap used to map and zero the buffers
into a seperate utility so it can be called from other heaps.  Use it from
the chunk heap.

Change-Id: I706341ae42b80bc4aae8a8614b4f73435bbf05d9
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
gpu: ion: Only flush buffers in the chunk heap if they were used cached

Change-Id: I4ffcf81a6be09e968310bbd882fb017415d61b48
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
gpu: ion: Add support for sharing buffers with dma buf kernel handles

Currently ion can only share buffers with dma buf fd's. Fd's can not be
used inside the kernel as they are process specific so support for
sharing buffers with dma buf kernel handles is needed to support kernel
only use cases. An example use case could be a GPU driver using ion
that wants to share its output buffers with a 3d party display
controller driver supporting dma buf.

Change-Id: If1b3753ddbd5b44c5a3e622055d5473e16fc1c48
Signed-off-by: Johan Mossberg <johan.mossberg@stericsson.com>
gpu: ion: Make ion_free asynchronous

Add the ability for a heap to free buffers asynchrounously.  Freed buffers
are placed on a free list and freed from a low priority background thread.
If allocations from a particular heap fail, the free list is drained.  This
patch also enable asynchronous frees from the chunk heap.

Change-Id: Idfdbc8608b6cbd9e27d2e31ea4fd84fea9f69f7d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
gpu: ion: fix kfree/list_del order

With CONFIG_SLUB_DEBUG_ON it would panic during
ion_alloc()
 ion_buffer_create()
   io_heap_drain_freelist()

Signed-off-by: JP Abgrall <jpa@google.com>
gpu: ion: ion_chunk_heap: Zero chunk heap memory at creation time

Allocations from the ion heap need to be zeroed to protect userspace
from seeing memory belonging to other processes.  First allocations
from this heap were not zero'd allowing users to see memory from other
processes on a warm reset.

Change-Id: I524a7b79cb76c390c870fcf8b30d213185fc85a0
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
gpu: ion: Fix bug in ion shrinker

The high variable was sometimes used uninitialized

Change-Id: I2f51413fd2d063fdff325047e824dc8c749d9e0a
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
trace/events: add gpu trace events

Change-Id: I0607b9c776acf61cb796b8572cf8cfb8b2dc1377
Signed-off-by: Jamie Gennis <jgennis@google.com>
trace/events: fix gpu event timestamp formatting

This change fixes the how the gpu_sched_switch timestamp field is formatted.

Signed-off-by: Jamie Gennis <jgennis@google.com>
Change-Id: I273234935254ed15772c9e561c9af20e480004ae
ARM: Allow SoCs to enable scatterlist chaining

Allow SoCs to enable the scatterlist chaining support, which allows
scatterlist tables to be broken up into smaller allocations.

As support for this feature depends on the implementation details of
the users of the scatterlists, we can't enable this globally without
auditing all the users, which is a very big task.  Instead, let SoCs
progressively switch over to using this.

SoC drivers using scatterlists and SoC DMA implementations need
auditing before this option can be enabled for the SoC.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
msm_fb: Fix the hang issues due to improper usage of vsync

For LCDC/DSI command/DTV interfaces, fix the various corner cases
of wait4vsync getting stuck due to TG turned off/wait4sync
count being reset to zero etc. Add timeout to waiting for vsync
to avoid hang issues when vsync interrupt is turned off.

Change-Id: I97322f3f1c6cc13b484cfa594d2fadcdec53d48a
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
lcdc_ld9040: fix locking in lcd_sysfs_store_auto_brightness()

  * mutex was unlocked before the call to lcdc_ld9040_set_brightness()

Change-Id: I73765ca66f3dce908f93290d0e76da8e72c1d2ae
ashmem: avoid deadlock between read and mmap calls

Avoid holding ashmem_mutex across code that can page fault.  Page faults
grab the mmap_sem for the process, which are also held by mmap calls
prior to calling ashmem_mmap, which locks ashmem_mutex.  The reversed
order of locking between the two can deadlock.

The calls that can page fault are read() and the ASHMEM_SET_NAME and
ASHMEM_GET_NAME ioctls.  Move the code that accesses userspace pages
outside the ashmem_mutex.

Bug: 9261835
Change-Id: If1322e981d29c889a56cdc9dfcbc6df2729a45e9
Signed-off-by: Todd Poynor <toddpoynor@google.com>
avr32: fix relocation check for signed 18-bit offset

commit e68c636d88db3fda74e664ecb1a213ae0d50a7d8 upstream.

Caught by static code analysis by David.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ARM: plat-orion: Fix num_resources and id for ge10 and ge11

commit 2b8b2797142c7951e635c6eec5d1705ee9bc45c5 upstream.

When platform data were moved from arch/arm/mach-mv78xx0/common.c to
arch/arm/plat-orion/common.c with the commit "7e3819d ARM: orion:
Consolidate ethernet platform data", there were few typo made on
gigabit Ethernet interface ge10 and ge11. This commit writes back
their initial value, which allows to use this interfaces again.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: vt6656: use free_netdev instead of kfree

commit 0a438d5b381e2bdfd5e02d653bf46fcc878356e3 upstream.

use free_netdev() instead of kfree(pDevice->apdev)

Signed-off-by: Hema Prathaban <hemaklnce@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
usb: option: Add Telewell TW-LTE 4G

commit 73c042df6e1bc50544842a04b777b36bbe3630e6 upstream.

Information from driver description files:

  diag:  VID_19D2&PID_0412&MI_00
  nmea:  VID_19D2&PID_0412&MI_01
  at:    VID_19D2&PID_0412&MI_02
  modem: VID_19D2&PID_0412&MI_03
  net:   VID_19D2&PID_0412&MI_04

Signed-off-by: Teppo Kotilainen <qubit303@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>