video: slimport: disable not-supported timings

Disable non-supported timings from the HDMI LUT. ANX7808 is able to
support for max 1080p60.

Change-Id: Iaf26fbdd584153cbd570344830e5ac083872b267
Signed-off-by: Devin Kim <dojip.kim@lge.com>
video: slimport: Fix slimport blinking issue

Link integrity check sometimes failed without external power.
This is a workaround for this failure. Enabling the USB clk prevent
this issue.

Change-Id: I4934c8fe840bd865b6355aefdb565ca00f1c7b69
Signed-off-by: Devin Kim <dojip.kim@lge.com>
arm/dt: hammerhead: slimport: Fix slimport blinking issue

Link integrity check is sometimes failed without external the power.
This is a workaround for this failure. Enabling the USB clk prevent
this issue.

Change-Id: I793127de438d14e71ee0f104e94fd39e09d7b39b
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Revert "mdss: hdmi: Wait for mdss iommu attached on boot with hdmi"

This reverts commit cdc6e7b7f83bceb9b099c56ac2e0c594634febae.

Conflicts:
	drivers/video/msm/mdss/mdss.h

Change-Id: I2026e75a7a252a91c6c08810f1207120a21ecfee
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
video: slimport: wait until boot done before start detection

If slimport cable inserted during boot up, slimport could not
work properly since other system is not ready yet. So, wait
until boot completion before start cable detection. The boot
completion should be notified by userspace.

Change-Id: I9fbee9568068b03a3b0d6776cc051a7d87e41c94
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
arm/dt: hammerhead: Change the search order of dtb

bootloader searches the dtb matched with board id from appended DTBs.
So changed the order to search latest dtb first.

order:
kernel -> rev11 -> rev11j -> rev10 -> ...

Change-Id: I5d9ff4f1aee6d17616fa67e532283d3d31f8e295
Signed-off-by: Devin Kim <dojip.kim@lge.com>
seq_file: always update file->f_pos in seq_lseek()

This issue was first pointed out by Jiaxing Wang several months ago, but no
further comments:
https://lkml.org/lkml/2013/6/29/41

As we know pread() does not change f_pos, so after pread(), file->f_pos
and m->read_pos become different. And seq_lseek() does not update file->f_pos
if offset equals to m->read_pos, so after pread() and seq_lseek()(lseek to
m->read_pos), then a subsequent read may read from a wrong position, the
following program produces the problem:

    char str1[32] = { 0 };
    char str2[32] = { 0 };
    int poffset = 10;
    int count = 20;

    /*open any seq file*/
    int fd = open("/proc/modules", O_RDONLY);

    pread(fd, str1, count, poffset);
    printf("pread:%s\n", str1);

    /*seek to where m->read_pos is*/
    lseek(fd, poffset+count, SEEK_SET);

    /*supposed to read from poffset+count, but this read from position 0*/
    read(fd, str2, count);
    printf("read:%s\n", str2);

out put:
pread:
 ck_netbios_ns 12665
read:
 nf_conntrack_netbios

/proc/modules:
nf_conntrack_netbios_ns 12665 0 - Live 0xffffffffa038b000
nf_conntrack_broadcast 12589 1 nf_conntrack_netbios_ns, Live 0xffffffffa0386000

So we always update file->f_pos to offset in seq_lseek() to fix this issue.

cherry-picked from https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/fs/seq_file.c?id=05e16745c0c471bba313961b605b6da3b21a853d

Signed-off-by: Jiaxing Wang <hello.wjx@gmail.com>
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Conflicts:
	fs/seq_file.c

Change-Id: If419b92498e2c3e08669a4342e9b9ebf99ad3768
Signed-off-by: Devin Kim <dojip.kim@lge.com>
seq_file: always clear m->count when we free m->buf

Once we'd freed m->buf, m->count should become zero - we have no valid
contents reachable via m->buf.

cherry-picked from https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/fs/seq_file.c?id=801a76050bcf8d4e500eb8d048ff6265f37a61c8

Change-Id: I4c1d3e69db4ecf5362e2a5d05bfd7db754dc6dc6
Reported-by: Charley (Hao Chuan) Chu <charley.chu@broadcom.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
fs/dcache.c: Fix the too small buffer for dname

temp[64] is used for internal temporary buffer in dynamic_dname().
This is for dname. But It's too small. dname's size may be > 64.
In that case, it returns as -ENAMETOOLONG. So Increase the buffer size
to 256 for avoiding this issue.

The following was caused by the small buffer.
WARNING: at /kernel/mm/page_alloc.c:2470 __alloc_pages_nodemask+0x24c/0x938()
CPU: 2 PID: 505 Comm: android.bg Not tainted 3.10.0-g2f73780-00003-g2ff41d9-dirty #13
[<c010ba3c>] (unwind_backtrace+0x0/0x11c) from [<c0109cac>] (show_stack+0x10/0x14)
[<c0109cac>] (show_stack+0x10/0x14) from [<c01939a0>] (warn_slowpath_common+0x48/0x68)
[<c01939a0>] (warn_slowpath_common+0x48/0x68) from [<c0193a7c>] (warn_slowpath_null+0x18/0x20)
[<c0193a7c>] (warn_slowpath_null+0x18/0x20) from [<c0222454>] (__alloc_pages_nodemask+0x24c/0x938)
[<c0222454>] (__alloc_pages_nodemask+0x24c/0x938) from [<c0222b50>] (__get_free_pages+0x10/0x24)
[<c0222b50>] (__get_free_pages+0x10/0x24) from [<c024faf8>] (kmalloc_order_trace+0x24/0xf0)
[<c024faf8>] (kmalloc_order_trace+0x24/0xf0) from [<c024fe20>] (__kmalloc+0x30/0x244)
[<c024fe20>] (__kmalloc+0x30/0x244) from [<c02723c8>] (seq_read+0x270/0x464)
[<c02723c8>] (seq_read+0x270/0x464) from [<c0256a18>] (vfs_read+0xa4/0x134)
[<c0256a18>] (vfs_read+0xa4/0x134) from [<c0256de8>] (SyS_read+0x38/0x68)
[<c0256de8>] (SyS_read+0x38/0x68) from [<c0106140>] (ret_fast_syscall+0x0/0x30)

Change-Id: I74f5217ba3c4be73e91f33f900f1f0c26810cc05
Signed-off-by: Devin Kim <dojip.kim@lge.com>
ping: prevent NULL pointer dereference on write to msg_name

A plain read() on a socket does set msg->msg_name to NULL. So check for
NULL pointer first.

[Backport of net-next cf970c002d270c36202bd5b9c2804d3097a52da0]

Bug: 12780426
Change-Id: Ida66892d359d2dfbb32803d8b0872bf8c0bb3865
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
arm/dt: hammerhead: change usb otg detection level

The vadc value on the USB ID pin should be less than 20 milivolts
when the otg cable has been connected.
However some devices return over 15 milivolts with PMIC ES 3.1
and couldn't recognize an otg cable connection in that case.
Fix this by adjusting vadc threshold value on the USB ID pin to 100 milivolts.

Bug: 13312153
Change-Id: I8342d447c1e3ab5861e702a24fa973df16b1ffb2
Signed-off-by: jude84.kim <jude84.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
(cherry picked from commit df13a5d7a4328b193edf8111b82d7463b4bb71f6)
msm: msm_watchdog_v2: Increase watchdog bark timeout during panic

We now wait for 10 seconds during panic handling before triggerring a
watchdog bark. This is done because the earlier timeout of 4 seconds
was not sufficient for all targets which resulted in the device resetting
in the middle of the panic handler.

Bug: 11293746

Change-Id: I1a45ac2ccf626d93848763fe56bb6ad164c2471d
Signed-off-by: Ameya Thakur <ameyat@codeaurora.org>
(cherry picked from commit c2acf59dc892653e1a67852c5bdb298ed1a09689)
usb: gadget: audio: Fix problem resuming playback on alt interface change

If the alternate interface is set back to 1, we now resume playback
if still triggered.

Bug: 12549807
(cherry picked from commit 898bafb4722ac04cda46249e39b0be96ab9d2bbd)

Change-Id: I6c3eb43ebafbc8a101ae83e7864097be5b07a0f9
switch: hds_max1462x: Should handle release event

Previously, if headset is removed while pressing keys,
release key is ignored.  Upperlayer would know the event
still be pressed.

The release event should be reported to prevent the problem.

Bug: 12235838
Change-Id: I8b77605e1f85b57a9b4683db4aaf4ff131f96026
Signed-off-by: hyunsub.na <hyunsub.na@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
nf: xt_qtaguid: fix handling for cases where tunnels are used.

* fix skb->dev vs par->in/out
When there is some forwarding going on, it introduces extra state
around devs associated with xt_action_param->in/out and sk_buff->dev.
E.g.
   par->in and par->out are both set, or
   skb->dev and par->out are both set (and different)
This would lead qtaguid to make the wrong assumption about the
direction and update the wrong device stats.
Now we rely more on par->in/out.

* Fix handling when qtaguid is used as "owner"
When qtaguid is used as an owner module, and sk_socket->file is
not there (happens when tunnels are involved), it would
incorrectly do a tag stats update.

* Correct debug messages.

Bug: 11687690
Change-Id: I2b1ff8bd7131969ce9e25f8291d83a6280b3ba7f
Signed-off-by: JP Abgrall <jpa@google.com>
SELinux: include definition of new capabilities

The kernel has added CAP_WAKE_ALARM and CAP_EPOLLWAKEUP.  We need to
define these in SELinux so they can be mediated by policy.

Change-Id: I8a3e0db15ec5f4eb05d455a57e8446a8c2b484c2
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
[sds: rename epollwakeup to block_suspend to match upstream merge]
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>