hammerhead: Rewrite memory reservation

* Get rid of membanks.
* Move to proper address.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
crypto: lzo - try kmalloc() before vmalloc()

zswap allocates one LZO context per online cpu.

Using vmalloc() for small (16KB) memory areas has drawback of slowing
down /proc/vmallocinfo and /proc/meminfo reads, TLB pressure and poor
NUMA locality, as default NUMA policy at boot time is to interleave
pages :

edumazet:~# grep lzo /proc/vmallocinfo | head -4
0xffffc90006062000-0xffffc90006067000   20480 lzo_init+0x1b/0x30 pages=4 vmalloc N0=2 N1=2
0xffffc90006067000-0xffffc9000606c000   20480 lzo_init+0x1b/0x30 pages=4 vmalloc N0=2 N1=2
0xffffc9000606c000-0xffffc90006071000   20480 lzo_init+0x1b/0x30 pages=4 vmalloc N0=2 N1=2
0xffffc90006071000-0xffffc90006076000   20480 lzo_init+0x1b/0x30 pages=4 vmalloc N0=2 N1=2

This patch tries a regular kmalloc() and fallback to vmalloc in case
memory is too fragmented.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Linux 3.4.103

This is the 3.4.103 stable release

Signed-off-by: Dan Trifan <jimsth@gmail.com>
arch/arm/mach-msm/mpm-of.c: gcc 4.9.x fix up

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
doubletap2wake: Add user selected feather radius

Signed-off-by: Dan Trifan <jimsth@gmail.com>
Sweep2wake: add vertical sweep capability and expose tunables to userspace

HUGE thanks to Dennis Rassmann <showp1984@gmail.com> for his original
sweep2wake contribution!

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
sweep2wake: Cleanup dead code

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Option to disable touch wake with power button

Signed-off-by: flar2 <asegaert@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
disable s2w/dt2w after timeout

Signed-off-by: flar2 <asegaert@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
waketimeout: Stop spam in dmesg when not enabled

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
s2w/s2s/dt2w: Cleanup and re-implementation

* Thanks to Flar.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
drivers: input: touchscreen: fix wake_timeout derps

Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: qcom: qdsp6v2: fix crash due to asynchronous read/write

Whenever an async read command is issued to dsp when
the driver is not enabled, there is a crash in userspace.
The read command is disallowed in the driver and an error
is propagated to userspace which results in the crash.
The driver is re-enabled in a subsequent asynchronous write
command anyway, so the async read command can be allowed.
Ensure that read is allowed by removing a superfluous check.

CRs-Fixed: 675131
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
Change-Id: I5d0598e37d08ac1090f98c24be49fd99c132e22f
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Revert "net: wireless: bcmdhd: add GSCAN Support"

This reverts commit e4ad72dd5772834f24bb81ae03775f7af44d601d.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
net: wireless: bcmdhd: Add support for hidden ssid PNO scan

Changes to support hidden ssid config to be sent to FW. Earlier
all ssids were hard coded as hidden, now only those indicated
as such by supplicant will be.

Change-Id: I927030fe12f162c52c93277b2ebfb4bf55daef4a
Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
net: wireless : bcmdhd fix the type of bssidx of P2P

Currently we set WL_INVALID(-1) to bssidx for deinit.
However, the bssdix has u32 type.
so, we need to change type to s32.
Signed-off-by: Ecco park <eccopark@broadcom.com>

Change-Id: Icf18dbe6cbed560f07ecb2c25d5e8261021fabee
Signed-off-by: Dan Trifan <jimsth@gmail.com>
cfg80211: mlme: Silently ignore duplicate management registrations

Instead of erroring out, just ignore the call

Change-Id: I5ff67100ea2d7f53bd30b6844c462bca71c24d15
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ext4: Add support for FIDTRIM, a best-effort ioctl for deep discard trim

* What
This provides an interface for issuing an FITRIM which uses the
secure discard instead of just a discard.
Only the eMMC command is "secure", and not how the FS uses it:
due to the fact that the FS might reassign a region somewhere else,
the original deleted data will not be affected by the "trim" which only
handles un-used regions.
So we'll just call it "deep discard", and note that this is a
"best effort" cleanup.

* Why
Once in a while, We want to be able to cleanup most of the unused blocks
after erasing a bunch of files.
We don't want to constantly secure-discard via a mount option.

From an eMMC spec perspective, it tells the device to really get rid of
all the data for the specified blocks and not just put them back into the
pool of free ones (unlike the normal TRIM). The eMMC spec says the
secure trim handling must make sure the data (and metadata) is not available
anymore. A simple TRIM doesn't clear the data, it just puts blocks in the
free pool.
JEDEC Standard No. 84-A441
  7.6.9 Secure Erase
  7.6.10 Secure Trim

From an FS perspective, it is acceptable to leave some data behind.
 - directory entries related to deleted files
 - databases entries related to deleted files
 - small-file data stored in inode extents
 - blocks held by the FS waiting to be re-used (mitigated by sync).
 - blocks reassigned by the FS prior to FIDTRIM.

Change-Id: I676a1404a80130d93930c84898360f2e6fb2f81e
Signed-off-by: Geremy Condra <gcondra@google.com>
Signed-off-by: JP Abgrall <jpa@google.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
usb: gadget: f_accessory: Enabled Zero Length Packet (ZLP) for acc_write

Accessory connected to Android Device requires
Zero Length Packet (ZLP) to be written when data
transferred out from the Android device are multiples
of wMaxPacketSize (64bytes (Full-Speed) / 512bytes (High-Speed))
to end the transfer.

Change-Id: Ib2c2c0ab98ef9afa10e74a720142deca5c0ed476
Signed-off-by: Anson Jacob <ansonkuzhumbil@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
zlib: clean up some dead code

Cleanup unused `if 0'-ed functions, which have been dead since 2006
(commits 87c2ce3b9305 ("lib/zlib*: cleanups") by Adrian Bunk and
4f3865fb57a0 ("zlib_inflate: Upgrade library code to a recent version")
by Richard Purdie):

 - zlib_deflateSetDictionary
 - zlib_deflateParams
 - zlib_deflateCopy
 - zlib_inflateSync
 - zlib_syncsearch
 - zlib_inflateSetDictionary
 - zlib_inflatePrime

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>