wlan: Prima 3.2.6.125
net: rmnet_usb: Duplicate skb when there is no tailroom

If the skb to be transmitted has no trailroom for mux padding,
then copy the skb into a new expanded skb with tailroom.

CRs-Fixed: 545483
Change-Id: I6d41c7b80246aac928e8466091cc3e925ecf550c
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
netfilter: Enable TOS matching in the kernel

This patch enabled kernel config CONFIG_NETFILTER_XT_MATCH_DSCP.
This adds a netfilter kernel configuration for matching TOS
packets for IPV4 packets. This will be required in certain QOS
filtering scenarios when the filter match is based on TOS.

CRs-Fixed: 542806
Change-Id: I59f311709daba8859db317cc152f96bc09f345b1
Acked-by: Sudharsan Coimbatore Premkumar <supremku@qti.qualcomm.com>
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
msm: audio: qdsp6v2: Change acdb_mmap size variable to unsigned

The acdb_mmap fuction does a size calculation but
stores the result in an int which makes negitive
numbers possible. Changing the variable to unsigned
ensures that the size used is never out of bounds.

Change-Id: I78714044594310a4411db1f50456e1294cf6ffce
CRs-fixed: 548145
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
msm: kgsl: Ignore kgsl flags while submitting cmds

Allow KGSL_CMD_FLAGS_EOF(end of frame) marker flag to
pass while adding userspace commands to ringbuffer.

CRs-fixed: 564030

Change-Id: I730143d2d1a0f3231705371f2119c55e277849e2
Signed-off-by: Anshuman Dani <adani@codeaurora.org>
msm: kgsl: Do not execute shader on wakeup from power collapse for 8064

Reverting "execute shader on wakeup from power collapse"
workaround for 8064.
This is causing GPU hang with all graphics test cases.

CRs-fixed: 564030

Change-Id: I7cc0eaad070fa929951be7247f95f24c1c7d849a
Signed-off-by: Anshuman Dani <adani@codeaurora.org>
msm: Remove files no longer buildable under arch/arm/mach-msm

Removed the files to reduce efforts as we move driver code out of mach-msm

Change-Id: Ic926ede69a7f4bb6ed0fbdffa7d551892886936a
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
msm:pm: Fix for race condition of starting cpu1 when cpu0 in PC.

There is a window where core sends ipi to secondary core and
wait for it to come online for 1 second. This would allow
core0 to go power collapse in a rare condition where core1
started booting and doesn't become online yet.

Fix this by not allowing power collapse on core0
if hot plug operation is in progress.

CRs-fixed: 545714.
Change-Id: I1ca503a2f09cd9a65c2fdcd41eb54466a1e486c5
Signed-off-by: Anil kumar mamidala <amami@codeaurora.org>
KBuild: Export msm_rmnet.h to user space

Exposing msm_rmnet.h to user space using standard mechanism such that
user space applications do not have to use relative paths in include
list.

CRs-Fixed: 548664
Change-Id: I807f9854de1d0bf9961607c9ed54dd5ecef782dc
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
kernel: Prevent unnecessary rfkill event generation.

Prevent unnecessary rfkill event generation when the state has
not actually changed. These events have to be delivered to
relevant userspace processes, causing these processes to wake
up and do something while they could as well have slept. This
obviously results in more CPU usage, longer time-to-sleep-again
and therefore higher power consumption.

Change-Id: I3ac4e141fbdf1315b74d3bad6aa96f34b00c3f92
CRs-fixed: 398283
Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
Signed-off-by: Mykyta Iziumtsev <nikita.izyumtsev@gmail.com>
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
Patch-mainline: v3.7
Git-commit: eab48345c2b2d791159aaac4a77000baa8dbc1ae
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Bluetooth: Remove wake_locks added for BT idle timer

Wakelocks were used to address the issue related to timer
which was not triggered when device was put into suspend
mode.This does not impact the usecases as the link would
be put into sniff mode immediately after the device comes
out of suspend mode.

Change-Id: I648acf32c6ce9bd0d3415ac0e9dcd2250d3fb68d
Signed-off-by: Sumit Bajpai <sbajpai@codeaurora.org>
Bluetooth : Recover BT, if hardware error event is received from the SOC

If Hardware Error event is received from the SOC, then BT SOC is in bad
state. As per spec, Hardware Error event is handled in HCI. Upper layer
gets informed by HCI to reset everything. & recover BT state machine & BT
SOC.

Change-Id: Iefdf8511ad51f88ff8a24ab9e075eb8dbc0a0a67
Signed-off-by: Nitin Shivpure <nshivpur@codeaurora.org>
mmc: block: fix a bug of error handling in MMC driver

Current MMC driver doesn't handle generic error (bit19 of device
status) in write sequence. As a result, write data gets lost when
generic error occurs. For example, a generic error when updating a
filesystem management information causes a loss of write data and
corrupts the filesystem. In the worst case, the system will never
boot.

This patch includes the following functionality:
  1. To enable error checking for the response of CMD12 and CMD13
     in write command sequence
  2. To retry write sequence when a generic error occurs

Messages are added for v2 to show what occurs.

cherry-picked it from
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/mmc?id=c8760069627ad3b0dbbea170f0c4c58b16e18d3d

Change-Id: I2bc5224a83b931a11e4664c449050323c34cdec5
Signed-off-by: KOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
add extra free kbytes tunable

Add a userspace visible knob to tell the VM to keep an extra amount
of memory free, by increasing the gap between each zone's min and
low watermarks.

This is useful for realtime applications that call system
calls and have a bound on the number of allocations that happen
in any short time period.  In this application, extra_free_kbytes
would be left at an amount equal to or larger than than the
maximum number of allocations that happen in any burst.

It may also be useful to reduce the memory use of virtual
machines (temporarily?), in a way that does not cause memory
fragmentation like ballooning does.

[ccross]
Revived for use on old kernels where no other solution exists.
The tunable will be removed on kernels that do better at avoiding
direct reclaim.

Change-Id: I765a42be8e964bfd3e2886d1ca85a29d60c3bb3e
Signed-off-by: Rik van Riel<riel@redhat.com>
Signed-off-by: Colin Cross <ccross@android.com>
mm: add a field to store names for private anonymous memory

Userspace processes often have multiple allocators that each do
anonymous mmaps to get memory.  When examining memory usage of
individual processes or systems as a whole, it is useful to be
able to break down the various heaps that were allocated by
each layer and examine their size, RSS, and physical memory
usage.

This patch adds a user pointer to the shared union in
vm_area_struct that points to a null terminated string inside
the user process containing a name for the vma.  vmas that
point to the same address will be merged, but vmas that
point to equivalent strings at different addresses will
not be merged.

Userspace can set the name for a region of memory by calling
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, start, len, (unsigned long)name);
Setting the name to NULL clears it.

The names of named anonymous vmas are shown in /proc/pid/maps
as [anon:<name>] and in /proc/pid/smaps in a new "Name" field
that is only present for named vmas.  If the userspace pointer
is no longer valid all or part of the name will be replaced
with "<fault>".

The idea to store a userspace pointer to reduce the complexity
within mm (at the expense of the complexity of reading
/proc/pid/mem) came from Dave Hansen.  This results in no
runtime overhead in the mm subsystem other than comparing
the anon_name pointers when considering vma merging.  The pointer
is stored in a union with fieds that are only used on file-backed
mappings, so it does not increase memory usage.

Change-Id: Ie2ffc0967d4ffe7ee4c70781313c7b00cf7e3092
Signed-off-by: Colin Cross <ccross@android.com>
Support full CONE NAT and ADDRESS RESTRICTED CONE NAT

Added support for Full cone NAT and Address Restricted Cone
NAT using the NATTYPE module.

Change-Id: Ib17f87757b86fdb88bbe25bab7d7193b0530f812
Signed-off-by: Smita Ghosh <smitag@codeaurora.org>
net/ipv6/addrconf: IPv6 tethering enhancement

Added new procfs flag to toggle the automatic addition of prefix
routes on a per device basis. The new flag is accept_ra_prefix_route.
Defaults to 1 as to not break existing behavior.

Change-Id: If25493890c7531c27f5b2c4855afebbbbf5d072a
CRs-Fixed: 435320
Acked-by: Harout S. Hedeshian <harouth@qti.qualcomm.com>
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
msm: netfilter: NATTYPE Refresh Timer Changes.

When IPA is present, all the data packets go through IPA
and as a result NATTYPE entry timeout will not be refreshed
and eventually it times out. IPA periodically refreshes
the connection tracking entry timeout. So make changes to refresh
the NATTYPE entry timeout from the connection tracking module.

Change-Id: I5861427990af4bfd6046d21809a778409d0d8d5f
Signed-off-by: Niranjan Reddy Dumbala <ndumba@codeaurora.org>
netfilter: fix ipv6_find_hdr usage

The semantics of the offset parameter of ipv6_find_hdr
changed recently and it is now an in/out. It is therefore
incorrect to pass it in uninitialized.

Change-Id: I47c1dbd856d89b0369fe4a5a8dab15e776da78d8
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
netfilter: xt_qtaguid: do not look at TCP_TIME_WAIT socket

It is possible that skb->sk may be a TCP_TIME_WAIT socket,
in which case many of the fields will not be valid. Thanks
to Eric Dumazet <edumazet@google.com> for pointing out this
issue and the fix.

http://article.gmane.org/gmane.linux.ports.arm.msm/3400

Change-Id: I1fa955df16f8919ec243d55e6131efb335a7871c
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>