mxc: gpu_viv: Finalize ioctl handling for v4 dmabuf

Clean up the ioctl2 handling and dmabuf integration into the v4
driver framework.  We now have the structures finalized and
have decided that we will only support clients using the new
userspace, since only a few developers were using the old interface.
ENGR00308066 [#1091]Use spinlock_irqsave instead of spinlock in gpu

Gpu kernel driver used spinlock in inerrupt context for debug
purpose. So when enabled debug mode in gpu kernel driver, it may
 cause gpu kernel driver deadlock.
Changed spinlock to spinlock_irqsave to resolve this issue.
Patch from vivante.

Date: Apr 11, 2014
Signed-off-by: Loren Huang <b02279@freescale.com>
mxc: gpu_viv: Change Free_Memory order of operations

Make sure that we can clean up all the references to the memory
node before we actually free the memory.  This fixes the problem
where you have freed the memory but then have references to it
in the various tracker dbs.
mxc: gpu_viv: Flush Caches when importing a dmabuf

Flush the cache for all the dmabuf's pages before mapping them
into the GPU.
mxc: gpu_viv: Change WaitSignal sleep state to TASK_KILLABLE

WaitSignal was previously exiting on any kernel signal.  This
would defeat the stuck GPU detection because Xorg fires timers
about every 20ms in order to schedule clients.
ENGR00318063-9: clk: do not allow parent switching with another mux being child

When switching parent clock with another basic mux clock being its
child, a glitch might be generated and propagated to downstream clocks
through this child mux.

The patch adds a flag CLK_IS_BASIC_MUX to identify the basic mux clocks,
and prohibit the parent switching when the clock itself is the parent of
any basic mux clock.  With this check, the parent switching of a clock
has to happen before the child mux switches to this clock path.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
pci: pci-imx6: Don't reset pci in wait for link

This was actually a bug introduced by the freescale patch porting
and merge done earlier.  Thanks Xobs for catching the error.