msm: board-msm7x27a: Increase Idle timeout

For 7x27a and 7x27, clocks are controlled by modem. To improve stability,
reduce number of interactions to modem to turn on and off GPU clocks.

Change-Id: Ia335960a6a139cd2fbe787d1dbe910e8e7a66f3f
CRs-Fixed: 339805
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: display: Wait for VSYNC if HDMI connected

Before unsetting and reallcating the pipes, a wait of
one VSYNC is required to avoid mixer getting same pipe
allocated. But in case the HDMI cable is disconnected,
external VSYNC would not be received and the primary
display would not respond. To avoid this, wait during
unset is done only if the HDMI cable is connected.

CRs-fixed: 352950
Change-Id: I416dfbdf5c6d82023781cc8fdbfdb0021898fd18
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
ipsec: be careful of non existing mac headers

Niccolo Belli reported ipsec crashes in case we handle a frame without
mac header (atm in his case)

Before copying mac header, better make sure it is present.

Bugzilla reference:  https://bugzilla.kernel.org/show_bug.cgi?id=42809

Reported-by: Niccolò Belli <darkbasic@linuxsystems.it>
Tested-by: Niccolò Belli <darkbasic@linuxsystems.it>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

CRs-Fixed: 344300
Signed-off-by: Jin Hong <jinh@codeaurora.org>
(cherry picked from commit 6329bf0a03811f4644a4c8d50bf241f6db6f19b5)

Conflicts:

	include/linux/skbuff.h

Change-Id: I062e7540bdeb8b2fa1c7b57e8a6d07a01b95d0a6
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
net/ipv4: Eliminate kstrdup memory leak
net sched: fix some kernel memory leaks
mmc: core: Prevent too long response times for suspend

While trying to suspend the mmc host there could still be
ongoing requests that we need to wait for. At the same time
a device driver must respond to a suspend request rather quickly.

Instead of potentially wait forever by claiming the host we now
try to claim the host instead. If it fails, -EBUSY is returned.

Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Reviewed-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>

CRs-Fixed: 325090

[sthumma@codeaurora.org: Squash commit 49df7807]
[sthumma@codeaurora.org: Skip the implementation for SDIO cards]
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
(cherry picked from commit ec6202f968414300c27be0a2dfb38ceb8356ea04)

Change-Id: Ib9cc2a24733e02d952adfad257b162e6ea299476
Signed-off-by: Swetha Basineni <sbasin@codeaurora.org>
Lower radio/event log for more ram
tcp: Increase the initial congestion window to 10
Fast Sleep, wake lock timer change. (wistilt2)
sched_fair: Remove cpu from nohz idle set if not active

    Currently, when determining which cpu should do load balancing in nohz
    mode, we still consider cpus that have been hotremoved. This is a
    problem because, if we decide to try and move the load balancing to a
    hotremoved cpu, we will spin and stop doing load balancing at all. This
    will also make us cease doing any idle power collapse until the cpu has
    been brought back online.

    Fix this by removing a cpu from the nohz idle mask if we find that it
    isn't active when we consider it for load balancing.

    Change-Id: I93a86fdcab88964a452cb3f38e4815db13d0ee6c
    CRs-Fixed: 290042
    Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
    Signed-off-by: Raj Kushwaha <rajk@codeaurora.org>
Updated VFP code (fix memory corruption on pm suspend, clear vfp states etcetc
revert updated code: so much instability
Revert:revert update VFP code (now is fine)
net: Reorder incoming packets in PPPoLAC and PPPoPNS.

PPP handles packet loss but does not work with out of order packets.
This change performs reordering of incoming data packets within a
sliding window of one second. Since sequence number is optional,
receiving a packet without it will drop all queued packets.

Currently the logic is triggered by incoming packets, so queued
packets have to wait till another packet is arrived. It is done for
simplicity since no additional locks or threads are required. For
reliable protocols, a retransmission will kick it. For unreliable
protocols, queued packets just seem like packet loss. Time-critical
protocols might be broken, but they never work with queueing anyway.
Bluetooth: uart-ldisc: Fix memory leak

This is a partial, self-contained, minimal backport of commit
797fe796c4335b35d95d5326824513befdb5d1e9 upstream which fixes the memory
leak:

Bluetooth: uart-ldisc: Fix memory leak and remove destruct cb

We currently leak the hci_uart object if HCI_UART_PROTO_SET is never set
because the hci-destruct callback will then never be called.  This fix
removes the hci-destruct callback and frees the driver internal private
hci_uart object directly on tty-close. We call hci_unregister_dev() here
so the hci-core will never call our callbacks again (except destruct).
Therefore, we can safely free the driver internal data right away and
set the destruct callback to NULL.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bluetooth: Fix l2cap conn failures for ssp devices

commit 18daf1644e634bae951a6e3d4d19d89170209762 upstream

Commit 330605423c fixed l2cap conn establishment for non-ssp remote
devices by not setting HCI_CONN_ENCRYPT_PEND every time conn security
is tested (which was always returning failure on any subsequent
security checks).

However, this broke l2cap conn establishment for ssp remote devices
when an ACL link was already established at SDP-level security. This
fix ensures that encryption must be pending whenever authentication
is also pending.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
fix rpcrouter misspellings - suggested from css771 - might
attempt to fix /dev/pmem_adsp: Failed to map memory in the client: Invalid argument
ganeth: better gannet device
ashmem: Fix flush routine of ashmem

The ashmem flush function ashmem_flush_cache_range was calling
dmac_clean_range and dmac_flush_range with a user virtual address
which is not allowed. Instead of calling dmac_clean_range or
dmac_flush_range use flush_cache_user_range which can be called
with a user vitual address.

Change-Id: I5dd137fb248b45ef2c7ea5f7bdb4b540b8310af9
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>