omap4: hwmod_data: add clocks to ipu processor devices

The ipu processor hwmod devices (ipu_c0 & ipu_c1) are defined
primarily as pseudo-hwmod devices with only reset controls.
These share the same functional clock along with the ipu hwmod
device that is mainly used for controlling the MMU. This clock
name is added to these pseudo-hwmod devices, as it will improve
the robustness to any HW_AUTO settings performed within the
hwmod framework. There is no major effect on the clock framework
itself, as the clock enable & disable will simply be reference
counted and the functionality would be identical as before.

Change-Id: I865e9690b503e601df27aa0a55cfac45622c4259
Signed-off-by: Suman Anna <s-anna@ti.com>
 ARM: OMAP4: clock data: add clockdomains for clocks used as main clocks

Until the OMAP4 code is converted to disable the use of the clock
framework-based clockdomain enable/disable sequence, any clock used as
a hwmod main_clk must have a clockdomain associated with it.  This
patch populates some clock structure clockdomain names to resolve warnings during the kernel init.
add will tisdales auto_hotplug driver
enable auto hotplug
mm: vmscan: clear kswapd's special reclaim powers before exiting

commit 71abdc15adf8c702a1dd535f8e30df50758848d2 upstream.

When kswapd exits, it can end up taking locks that were previously held
by allocating tasks while they waited for reclaim.  Lockdep currently
warns about this:

On Wed, May 28, 2014 at 06:06:34PM +0800, Gu Zheng wrote:
>  inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-R} usage.
>  kswapd2/1151 [HC0[0]:SC0[0]:HE1:SE1] takes:
>   (&sig->group_rwsem){+++++?}, at: exit_signals+0x24/0x130
>  {RECLAIM_FS-ON-W} state was registered at:
>     mark_held_locks+0xb9/0x140
>     lockdep_trace_alloc+0x7a/0xe0
>     kmem_cache_alloc_trace+0x37/0x240
>     flex_array_alloc+0x99/0x1a0
>     cgroup_attach_task+0x63/0x430
>     attach_task_by_pid+0x210/0x280
>     cgroup_procs_write+0x16/0x20
>     cgroup_file_write+0x120/0x2c0
>     vfs_write+0xc0/0x1f0
>     SyS_write+0x4c/0xa0
>     tracesys+0xdd/0xe2
>  irq event stamp: 49
>  hardirqs last  enabled at (49):  _raw_spin_unlock_irqrestore+0x36/0x70
>  hardirqs last disabled at (48):  _raw_spin_lock_irqsave+0x2b/0xa0
>  softirqs last  enabled at (0):  copy_process.part.24+0x627/0x15f0
>  softirqs last disabled at (0):            (null)
>
>  other info that might help us debug this:
>   Possible unsafe locking scenario:
>
>         CPU0
>         ----
>    lock(&sig->group_rwsem);
>    <Interrupt>
>      lock(&sig->group_rwsem);
>
>   *** DEADLOCK ***
>
>  no locks held by kswapd2/1151.
>
>  stack backtrace:
>  CPU: 30 PID: 1151 Comm: kswapd2 Not tainted 3.10.39+ #4
>  Call Trace:
>    dump_stack+0x19/0x1b
>    print_usage_bug+0x1f7/0x208
>    mark_lock+0x21d/0x2a0
>    __lock_acquire+0x52a/0xb60
>    lock_acquire+0xa2/0x140
>    down_read+0x51/0xa0
>    exit_signals+0x24/0x130
>    do_exit+0xb5/0xa50
>    kthread+0xdb/0x100
>    ret_from_fork+0x7c/0xb0

This is because the kswapd thread is still marked as a reclaimer at the
time of exit.  But because it is exiting, nobody is actually waiting on
it to make reclaim progress anymore, and it's nothing but a regular
thread at this point.  Be tidy and strip it of all its powers
(PF_MEMALLOC, PF_SWAPWRITE, PF_KSWAPD, and the lockdep reclaim state)
before returning from the thread function.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm: vmscan: If kswapd has been running too long, allow it to sleep

Under constant allocation pressure, kswapd can be in the situation where
sleeping_prematurely() will always return true even if kswapd has been
running a long time. Check if kswapd needs to be scheduled.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
NO SR

Conflicts:
	arch/arm/configs/nuked_defconfig
OMAP4 DSS: Fix to return 24bit as the recommended bpp for 18bit panels

Display driver logic to calculate the recommended bpp for FB has been modified
to recommend 24bit for all panels above 16bit mode.

DRT# OMAPS00259536 - ICS R0: App Tray disappears on Hi Res display (1920x1200)

Change-Id: I16aad396083d0ad416e035c59a93089df20d6d82
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
OMAPDSS: DISPC: fix pclk divisor limits

According to TRM, minimal pixel clock divisor value can be 1.
Fix corresponding checks, as high resolution panels use undivided
pixel clock frequency.

Also certain scaler unit constraint must be met: in case DISPC_CLK
and pixel clock frequencies are equal, set IPC to work on rising edge.

Change-Id: Iabeac2ad81f6909213cb81f4e16b1d0762369b53
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
OMAPDSS: DISPC: HW WA for UV plane overread HW bug

vidrot attribute is ignored for NV12 format, but setting it to
1 prevents overread of the UV plane when scaling.

Change-Id: If436c26aace4c805723ccfc1bd2b989bdc7efcd5
Signed-off-by: Sathya Prakash M R <a0393677@ti.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
OMAPDSS: DSSCOMP: Fix klocworks errors

Change-Id: If2ed914c738e28c9b5b19b67353bd367d612e91b
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
OMAP4: DSI: DSI reset removal during enabling

DSI module is made wake up capable in its HWMOD flags but in
The function omapdss_dsi_display_enable(), DSI module is
reset thus values set in DSI_SYSCONFIG is lost because of which
DSI is no longer wakeup capable. This prevents any interrupt from
DSI to be permeated to A9 when A9 sleeping.this reset is not
required while enabling the display thus now it is removed.so it
retains the HWMOD settings.

Now with this fix, the mdelay() within dsi_vc_send_bta_sync(), is removed
and a proper interrupt based implementation is done.

Change-Id: If6c3d25a5ba8003a0bd7732af0fcd81a839293aa
Signed-off-by: Sujeet Kumar Baranwal <s-baranwal@ti.com>
OMAPDSS: DSS: Complete callbacks on mgr->blank if not wait_for_go

Disabled panels do not clear GO automatically, therefore, we
assume no wait_for_go on disabled panels.

When not waiting for GO, complete all pending composition
callbacks regardless of dirty state, as dirty state will not
be propagated.

Change-Id: Ic5ddd81414bab56d136a716907fd8e6dfa0f795f
Signed-off-by: Lajos Molnar <lajos@ti.com>
OMAPDSS: DSS: Fix wait_for_go support on mgr->blank() for manual update panels

Manual update panels do not clear GO automatically.  For these panels we need
to call update so that GO gets cleared.

Change-Id: Idb446af8c77553cec8baf7af893d180cfbaa7582
Signed-off-by: Lajos Molnar <lajos@ti.com>
OMAP DSI: Fix consecutive bus unlocks for manual mode panel.

Description: In manual mode panels, a semphore is used to keep track
of display queue and release. Upon the condition of framedone timeout
error the semaphore is released once by the callback handler before exiting.
If framedone for the timed-out frame arrives after 250 msec and before
next frame queuing, it releases the semaphore second time in the callback handler.
This results in warnon assert later.

This patch puts in proper check before releasing the semaphore.
This way we prevent multiple unlocks of the bus..

Change-Id: I7db034de1a286f58a7fb9187b4ff356d7ad4731b
Signed-off-by: Sreenidhi Koti <sreenidhi@ti.com>
Signed-off-by: Sujeet Barnawal <s-baranwal@ti.com>
Revert "OMAP:DSS: SW workaround for HW scaler overread issue"

This reverts commit 0e11c5b311d2c7436756f80c35c8aef4cd0d911b.

The SW workaround is no longer needed as a hardware workaround
exists, and the SW workaround created artifacts.

Change-Id: I5d8a601b24502a3ac5d4c1f17fcb3936ba8e7e10
Signed-off-by: Sathya Prakash M R <a0393677@ti.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
OMAPDSS: DSS: MFLAG support

This patch enables MFLAG support for OMAP4470 SOCs.
MFLAG changes the arbitration on L3, so DMA of DSS will read
a frame data with a high priority. This is important for
high resolution displays like 1080p and above.

Change-Id: I7e058ec52068bc0c37a6152a6656a90ec3194706
Signed-off-by: Artem Rudenko <artemrudenko@ti.com>
OMAPDSS:DSS: Add write back support.

Port write back support from 2.6.35.

Support for mem2mem mode with overlay/mgr as
input will be added later.

Change-Id: I17efea1d9897f8f9cd2ed8f9623198e0a63c8fba
Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Rohit Choraria <rohitkc@ti.com>
Signed-off-by: Sreenidhi Koti <sreenidhi@ti.com>
OMAPDSS:DSSCOMP: Support for WB capture mode

Implementation of WB capture mode (i.e. output of
overlay manager captured using WB) added. The support
for WB mem2mem mode to be added later.

Change-Id: Ibf3c07770e22638284da8844894fbe2266a2a249
Signed-off-by: Rohit Choraria <rohitkc@ti.com>
OMAPDSS: MFlag thresholds settings

As per the simultaion team suggestion, the below thesholds are set:
HT = fifosize * 5/8;
LT = fifosize * 4/8;

Change-Id: Ieef7d8a090e38ce717729fe30f60f46c6dfd6ddd
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>