Revert "msm: mdss: Enable overfetch unconditionally"

This reverts commit 0c2915e6a0c034e37dd6c983a9b80add5748b9a8.
It fixed the time green line but broke neflix video playback.

Change-Id: I39c5f992ed42256c7bfc0d6fba7f959bd26c2c4e
Signed-off-by: Dan Trifan <jimsth@gmail.com>
arm: hammerhead: Use LGE rfkill driver

Port rfkill driver from android-msm-dory-3.10-kitkat-wear.

Change-Id: I831666a8c45fa71d465db647561cc06f3ee8b0f9
Signed-off-by: Dan Trifan <jimsth@gmail.com>
bluesleep: Update to latest google version

Use bluesleep driver from android-msm-dory-3.10-kitkat-wear.

Change-Id: I8c5d10bc77bc0c47a1c5d35a7164c071d1a920e1
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm_serial_hs: Update to latest google version

Port msm_serial_hs from android-msm-dory-3.10-kitkat-wear.

Change-Id: I8c32e656ab8f8291bd49fe53c5da67c465d5d733
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: pm: Increase cpu collapse timeout

2ms is still not enough, try 5ms.

<4>[  670.307705] ------------[ cut here ]------------
<4>[  670.308133] WARNING: at arch/arm/mach-msm/msm-pm.c:792 msm_pm_wait_cpu_shutdown+0x9c/0xb0()
<4>[  670.308351] CPU2 didn't collapse in 2 ms
<4>[  670.308839] [<c010dfb8>] (unwind_backtrace+0x0/0x144) from [<c0a26304>] (dump_stack+0x20/0x24)
<4>[  670.310590] [<c0a26304>] (dump_stack+0x20/0x24) from [<c019b610>] (warn_slowpath_common+0x58/0x70)
<4>[  670.311848] [<c019b610>] (warn_slowpath_common+0x58/0x70) from [<c019b6a4>] (warn_slowpath_fmt+0x40/0x48)
<4>[  670.313030] [<c019b6a4>] (warn_slowpath_fmt+0x40/0x48) from [<c0179500>] (msm_pm_wait_cpu_shutdown+0x9c/0xb0)
<4>[  670.313580] [<c0179500>] (msm_pm_wait_cpu_shutdown+0x9c/0xb0) from [<c01260bc>] (platform_cpu_kill+0x38/0x48)
<4>[  670.320147] [<c01260bc>] (platform_cpu_kill+0x38/0x48) from [<c010c5a8>] (__cpu_die+0x4c/0x98)
<4>[  670.320767] [<c010c5a8>] (__cpu_die+0x4c/0x98) from [<c09fb544>] (_cpu_down+0xf8/0x2e0)
<4>[  670.321029] [<c09fb544>] (_cpu_down+0xf8/0x2e0) from [<c09fb7d0>] (cpu_down+0x34/0x50)
<4>[  670.321452] [<c09fb7d0>] (cpu_down+0x34/0x50) from [<c01943c4>] (cpu_down_work+0x120/0x154)
<4>[  670.321924] [<c01943c4>] (cpu_down_work+0x120/0x154) from [<c01b59a4>] (process_one_work+0x178/0x4f4)
<4>[  670.322385] [<c01b59a4>] (process_one_work+0x178/0x4f4) from [<c01b60a0>] (worker_thread+0x174/0x448)
<4>[  670.322795] [<c01b60a0>] (worker_thread+0x174/0x448) from [<c01bc454>] (kthread+0xb4/0xc0)
<4>[  670.323049] [<c01bc454>] (kthread+0xb4/0xc0) from [<c0108060>] (kernel_thread_exit+0x0/0x8)
<4>[  670.323699] ---[ end trace 26c4346f4c26704b ]---

Signed-off-by: Dan Trifan <jimsth@gmail.com>
USB: ccid_bridge: Increase the bulk message timeout

The card is taking more than 500 msec to respond to some commands.
Increase the timeout to 1 sec.

Change-Id: I8ecfec6fa6e7465f6c51dcf0db899f576ae45298
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
USB: ccid_bridge: Drop the usb device reference upon disconnect

usb device ref count is incremented in probe via usb_get_dev. Call
usb_put_dev during disconnect to drop the ref count. Otherwise
struct usb_device memory is leaked.

Change-Id: Ia82f5ff7ef1a0a5e5c54f6e52b9e22f8434c45a6
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
USB: ccid_bridge: Enable the auto-suspend

The USB UICC cards are always attached to the host. Enable the
auto-suspend to save power.

Change-Id: I715171fa677b64da220114d515ceb775fdab54a0
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
USB: ccid_bridge: Add module param for bulk message timeout

The bulk message timeout is 1 second by default. Some cards take
more time to respond to CCID commands. Provide a module param
to configure the bulk message timeout.

For example, the below command configures the timeout as 5 seconds.

echo -n 5000 > /sys/module/ccid_bridge/parameters/bulk_msg_timeout

CRs-Fixed: 652421
Change-Id: I5f8fc2a9586d3728fe1c43311a28c4084a333164
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
mmc: core: Fix power class config for HS400

Use the correct power class field from the extended CSD register
for HS400 mode as defined in the eMMC5.0 specification.

CRs-fixed: 690341
Change-Id: Ie10e35941fd3c6ee49c686f721bf5af6fcd74862
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Sound Control: expose direct register manipulations to userspace

bump driver version to 3.3

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Sound Control: Misc clean up for newer WCD9xxx SOCs

Bump driver version to 3.4

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Sound Control: let register lock be dependent on different hw revisions

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Sound Control: separate locking mechanism for recording and playback

with newer hardware revisions coming from Qualcomm, single register lock
control isn't sufficient to cover both playback and recording usage scenarios

bump to version 3.5

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
lz4: ensure length does not wrap

Given some pathologically compressed data, lz4 could possibly decide to
wrap a few internal variables, causing unknown things to happen.  Catch
this before the wrapping happens and abort the decompression.

Change-Id: I055b70a212d4c0f3f2ad8e57eebec6ce8aa8b4a6
Reported-by: "Don A. Bailey" <donb@securitymouse.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
lz4: fix another possible overrun

There is one other possible overrun in the lz4 code as implemented by
Linux at this point in time (which differs from the upstream lz4
codebase, but will get synced at in a future kernel release.)  As
pointed out by Don, we also need to check the overflow in the data
itself.

While we are at it, replace the odd error return value with just a
"simple" -1 value as the return value is never used for anything other
than a basic "did this work or not" check.

Change-Id: I839144f135e2a4eb3c1fdcf1fa418ea34d481ea3
Reported-by: "Don A. Bailey" <donb@securitymouse.com>
Reported-by: Willy Tarreau <w@1wt.eu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
initramfs: read CONFIG_RD_ variables for initramfs compression

When expert configuration option(CONFIG_EXPERT) is enabled, menuconfig
offers a choice of compression algorithm to compress initial ramfs image;
This choice is stored into CONFIG_RD_* variables.  But usr/Makefile uses
earlier INITRAMFS_COMPRESSION_* macros to build initial ramfs file.  Since
none of them is defined, resulting 'initramfs_data.cpio' file remains
un-compressed.

This patch updates the Makefile to use CONFIG_RD_* variables and adds
support for LZ4 compression algorithm.  Also updates the
'gen_initramfs_list.sh' script to check whether a selected compression
command is accessible or not.  And fall-back to default gzip(1)
compression when it is not.

Change-Id: I32aca0c8ccea3f25e65247195ba2d7f576c41fd4
Signed-off-by: P J P <prasad@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
scripts/gen_initramfs_list.sh: fix flags for initramfs LZ4 compression

LZ4 as implemented in the kernel differs from the default method now
used by the reference implementation of LZ4.  Until the in-kernel method
is updated to support the new default, passing the legacy flag (-l) to
the compressor is necessary.  Without this flag the kernel-generated,
LZ4-compressed initramfs is junk.

Kyungsik said:

: It seems that lz4 supports legacy format with the same option as lz4c
: does.  Just looking at the first few bytes of lz4 compressed image, we can
: see whether it is new format or not.
:
: It shows new format magic number without this patch.  New format magic
: number is 0x184d2204.
:
: $ hexdump -C ./initramfs_data.cpio.lz4 |more
: 00000000  04 22 4d 18 64 70 b9 69 (Little Endian)
: ...
:
: Currently kernel supports legacy format only.

Change-Id: I93df5bcf5db593a7f7e6c09b00b29bd7df98cd68
Signed-off-by: Daniel M. Weeks <dan@danweeks.net>
Cc: Michal Marek <mmarek@suse.cz>
Acked-by: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
kconfig: update compression algorithm info

There have been new compression algorithms added without updating nearby
relevant descriptive text that refers to (a) the number of compression
algorithms and (b) the most recent one.  Fix these inconsistencies.

Change-Id: I8da8c534cb205d1e2fa6888ea5411dc5f816f6e6
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Reported-by: <qasdfgtyuiop@gmail.com>
Cc: Lasse Collin <lasse.collin@tukaani.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Alain Knaff <alain@knaff.lu>
Cc: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
gen_init_cpio: remove redundant empty line

Just a completely trivial patch to remove a completely redundant blank
line from usr/gen_init_cpio.c

Change-Id: Ifb6bb3583c930b6417fc76d11aa70e454c882e5e
Signed-off-by: Jesper Juhl <jj@codesealer.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dan Trifan <jimsth@gmail.com>