Bluetooth: hci_ldisc: watchdog timeout while BT file transfer

Serial core's uart_write_wakeup( ) is used to unthrottle line
discipline to send more data notifying that there is less number
of data available in TTY circular buffer by MSM HSUART driver with
uart port spinlock acquire. Here serial core is calling
HCI Line Discipline driver's hci_uart_tty_wakeup( ) without scheduling
tasklet in 3.4 kernel compare to 3.0 kernel. Due to that HCI
Line Discipline driver pushes all available data to TTY Core as part of
hardirq context in 3.4 kernel compare to softirq context on 3.0 kernel,
which is causing watchdog timeout issue. Hence move all
hci_uart_tty_wakeup() work to tasklet context to resolve this issue.

Signed-off-by: Ram Mohan Korukonda <rkorukon@codeaurora.org>
(cherry picked from commit e89accff349b8a8e724cf06da990306000f7eae1)

Change-Id: Ia1ab48faaf51da4e46cc957a24310c199891c714
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>

Conflicts:
	drivers/bluetooth/hci_uart.h
Bluetooth: Wait for wcnss to be ready after SSR

After subsystem restart (SSR), it takes about 10 sec
for wcnss to get ready to accept commands from the
host. If the BT radio is accessed before that, wcnss
can go into bad state.

CRs-fixed: 360858
Change-Id: I5b5c723802311f14b29311372d9d5435eccf583d
Signed-off-by: Sunny Kapdi <sunnyk@codeaurora.org>

Conflicts:
	drivers/bluetooth/hci_smd.c
CONFIG: Build updates
GOV: Incorporated cpufreq: Add cpu utilization statistics to aid decisions made by user space to Lazy gov
msm_dcvs: Update interface to get updated timer on IDLE_EXIT

TZ DCVS algorithm is updated to give a new timer value on idle_exit
in order to catch smaller CPU bursts correctly. Also protect
against a timer race condition between IDLE_EXIT and CLOCK_FREQ_CHANGE
events.

(cherrypicked from commit id 76af983bbd08458eb74d7752c668c561bce2fd22)
Change-Id: I1ab414e9cd582c0eb8f86f0d87fa132d709da100
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
msm: pm-8x60: Don't restore ACPU frequency for hotplug cases.

During hotplug if power collapse fails don't try to restore the
ACPU clock frequency. For normal hotplug exit ACPU drivers save
and restore as part of hotplug notifications.

CRs-fixed: 334002
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
(cherry picked from commit 4e025d9b72f771e30e1803871ac21dbf9d1a366f)

Change-Id: Ifcba558b17a72c232c60ed38d7849f196db1ad44
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: display: Enable pre-multiplied alpha for MDP303

For images which are pre-multiplied with alpha, driver
support is now added to blend them properly

Change-Id: I1c07496f9d85c50f1df9eb8d70362ff23dbd90f8
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
msm_fb: display: resolve compilation issues for 7x27a

Resolve compilation issues for 7x27a

Change-Id: I294e59a1829eb91b48e1ceff510ff589675e496f
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
gpu: msm: Upgrade Adreno driver

 * Match ICS_STRAWBERRY from 08/11/2012

Change-Id: I04cba20ae9c8a2038a2573ab2cbf8d2cbfae940b
ram_console: set CON_ANYTIME console flag

We want to ensure that we get all the console messages, even ones
that occur while the printing CPU is not yet online.

Change-Id: I1d2694d05ac9415669a92f38efdd8e71c927705b
Signed-off-by: Dima Zavin <dima@android.com>
msm: kgsl: Create a separate pagetable for priv bank of IOMMU

The IOMMU registers should only be accessed by priv bank. Create a separate
pagetable for priv bank and map the IOMMU registers to only this pagetable.
This is only supported for devices which can use the priv bank for
performing in stream pagetable switches.

CRs-fixed: 380834
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit 19ca4a6cec18c35d8e2dc1cbde68f636341b5f5e)

Change-Id: I13026b8999dd882f3e4eb02997fa99645ba8b5fa
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
msm: kgsl: Add idle after writing SMMU ASID register

Add an idle for synchronization after writing the SMMU ASID register.

CRs-fixed: 380834
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit be39728459a2b7a9c0a5b1faf11e7406976ddcc7)

Change-Id: I143d045cd94d575b59da6fe6d8f1ccef71d16e69
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
msm: kgsl: For IOMMU only decide to flush when memory is unmapped

In case of IOMMU memory needs to only be flushed when it is
unmapped and not mappped. Also, when an application is running
the number of unmaps would in most cases be less than number of
maps, so this way the number of flushes wil be fewer.

CRs-fixed: 380834
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit 0c811269372d83d18538c74ace76554ac77ce933)

Change-Id: I7ae96adab7b336221fc6bd4e6e085180122c79e3
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
msm: kgsl: Remove additional idle commands

Remove unneeded idle commands from the command stream when updating
pagetables and doing TLB flushes.  Ths cuts down on the number of
commands in the ringbuffer during switches.

CRs-Fixed: 380834
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit 5462907f72ddcc7d337ce9431d54428c8dc486eb)

Change-Id: Id930be772075f5ac099046544c80266c5fc03a07
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
sched/nohz: Correctly initialize 'next_balance' in 'nohz' idle balancer

The 'next_balance' field of 'nohz' idle balancer must be initialized
to jiffies. Since jiffies is initialized to negative 300 seconds the
'nohz' idle balancer does not run for the first 300s (5mins) after
bootup. If no new processes are spawed or no idle cycles happen, the
load on the cpus will remain unbalanced for that duration.

Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1DD7BFEDD3147247B1355BEFEFE4665237994F30EF@HQMAIL04.nvidia.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>

[xqi@codeaurora.org merge into different file location in 3.0]
Change-Id: I42c41210babb0881150d28d11c2d3fce24fe3a9f
Signed-off-by: Xin Qi <xqi@codeaurora.org>
sched/nohz: Fix logic in nohz_kick_needed

Update the logic so that as long as rq->nr_running is greater than 1,
nohz_kick will be needed, regardless of whether the current CPU has
successfully competed for the first or second cpu spot

Previous logic has the corner case that if current CPU has r_running more than
1, and two other CPUs alreay hold first and econd cpu spot, but they don't
meeting kicking criterial (first cpu has nr_running 1, and second cpu doesn't
have any load), then nohz_kick will not be set correctly.

Change-Id: I30790f22df0a2e90899daa44c67757284dcca25d
Signed-off-by: Xin Qi <xqi@codeaurora.org>
sched/nohz: Fix logic in run_rebalance_domains

If triggered by nohz_balancer_kick, idle_at_tick is not updated
accordingly.  Update myself at this moment right before it is used

Change-Id: I20dd4314159e70f955ffe482160c8867c65c261e
Signed-off-by: Xin Qi <xqi@codeaurora.org>

Conflicts:
	kernel/sched_fair.c
msm: kgsl: Faster GPU hang detection

Check global GPU status registers in intervals of 2 seconds,
if the registers did not change after 2 seconds trigger a hang.
When there is an actual GPU hang and GPU is stalled, this reduces
the current hang detection time from 10 seconds to 2 seconds.
Faster GPU hang detection reduces the overall time to recover
from GPU hang.

CRs-fixed: 384922
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
(cherry picked from commit 3335f14d31f5078f1de12774e08e1321e40d093a)

Change-Id: I57f363364eb76056cc65cf9ae9d686a8dad5283d
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
GOV: cpufreq: fix utilization statistics for sync cpus
SCHED: Fix nohz merge