PM: devfreq: Use high priority workqueue

It does not make sense to run kgsl on high and devfreq on regular
priority.
mm: make is_vmalloc_addr lockless

is_vmalloc_addr currently takes the vmap_area_lock and walks
the list of vmalloc areas to determine if an address is actually
a vmalloc address. Unfortunately, the current locking structure
with vmap_area_lock does not disable irqs which means that it may
be possible to recusively take the vmap_area_lock if an irq occurs
while walking the tree list. Considering the list of possible
vmalloc vs. not vmalloc ranges is not going to change after bootup,
skip the tree walking and just keep a bitmap of which virtual
addresses are set aside for vmalloc and which are not.

Change-Id: I0c159e09dc17b5c6641d08dcf630e6116b991cd5
CRs-Fixed: 591797
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: kgsl: Increase fault timer for slower a305 GPU

Slower GPU's need larger fault timer to detect hangs correctly.
we use 50ms fault timer for faster GPU's, a305 GPU is slower
compared to faster GPU, use a larger 200ms fault timer to
prevent false hang detection.

Change-Id: I0f0bf492ae2d9941979893b75b2e1dbc832e1ba8
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Increase fault timer for A305B GPU

Slower GPU's need larger fault timer to detect hangs
correctly. Frodo A305B GPU is slower compared to faster
GPU, hence use a larger 200ms fault timer to prevent
false hang detection.

Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
Change-Id: I6338cecc3be81700ab10c45fab66daa7a1078e42
msm: kgsl: Fix mem leak when page allocation fails

Page allocation may fail during OOM condition. Update
sglen and size to correct value (allocated) so that
they get freed in kgsl_sharedmem_free().

Change-Id: I1aa0ca77bb767523dfcf0f6cc3a21eac2b6b80e4
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
USB: u_serial: Don't free usb_requests in gs_close and reuse them

Commit: 950a3a3 "USB: Gadget: u_serial: Freeing usb requests as a
part of gs_close" results in freeing requests and flushing the EP
on every port close even if USB connection is present. These requests
are allocated again on port open. Also, EP flush call may result in
unclocked access of USB hardware if USB BUS state was suspended at
the time of port_close. This patch fixes that and also addresses the
original issue of gs_open allocating usb requests on every port_open
by adding a condition to allocate USB requests in port open only if
they are not already allocated.

CRs-fixed: 591617
Change-Id: If2ab31fa1d36ea6119dc0ced13ade5ed93d85d86
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
tcp: fix FIONREAD/SIOCINQ

tcp_ioctl() tries to take into account if tcp socket received a FIN
to report correct number bytes in receive queue.

But its flaky because if the application ate the last skb,
we return 1 instead of 0.

Correct way to detect that FIN was received is to test SOCK_DONE.

Reported-by: Elliot Hughes <enh@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arm/dt: hammerhead: Reduce minimum panel brightness
msm: kgsl: when unmapping from the mmu flush the entire tlb

Flushes the entire tlb when calling mmu_unmap to make sure there
is no race condition between unmapping and freeing the pages.

Change-Id: I911f8479a3aef2006f9df40a3419284423937542
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>
msm: kgsl: Fix file permission
msm: kgsl: devfreq_target requests can happen during SLUMBER

Bus updates should be ignored if the bus is already off.  The bus
will wake at the default frequency for the active power level.

Change-Id: I63b8d1aacfe45971929f21f7c63bdd8ba16536e1
CRs-fixed: 589899
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
ext4: make sure the journal sb is written in ext4_clear_journal_err()

After we transfer set the EXT4_ERROR_FS bit in the file system
superblock, it's not enough to call jbd2_journal_clear_err() to clear
the error indication from journal superblock --- we need to call
jbd2_journal_update_sb_errno() as well.  Otherwise, when the root file
system is mounted read-only, the journal is replayed, and the error
indicator is transferred to the superblock --- but the s_errno field
in the jbd2 superblock is left set (since although we cleared it in
memory, we never flushed it out to disk).

This can end up confusing e2fsck.  We should make e2fsck more robust
in this case, but the kernel shouldn't be leaving things in this
confused state, either.

Change-Id: I7a7cd58880209fbd54f4ded5f2b62de492cae9e0
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
Git-commit: d796c52ef0b71a988364f6109aeb63d79c5b116b
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
ext4: fix memory leak in xattr

If we take the 2nd retry path in ext4_expand_extra_isize_ea, we
potentionally return from the function without having freed these
allocations.  If we don't do the return, we over-write the previous
allocation pointers, so we leak either way.

Spotted with Coverity.

[ Fixed by tytso to set is and bs to NULL after freeing these
  pointers, in case in the retry loop we later end up triggering an
  error causing a jump to cleanup, at which point we could have a double
  free bug. -- Ted ]

Change-Id: I49b8ca41a6c6d44b563eb23306870258a3affd3b
Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Cc: stable@vger.kernel.org
Git-commit: 6e4ea8e33b2057b85d75175dd89b93f5e26de3bc
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
mmc: card: fix arbitrary write via read handler in mmc_block_test

In mmc_block_test, the debug_fs based read function handlers write to an
arbitrary buffer which is given by any user. We add an access_ok check
to verify that the address pointed by *buffer is not in kernel space.
Only if the buffer is valid, do we continue the read handler.

Change-Id: I1413f71be13509a3b4e56b919cfbcbd9fcc9d2bd
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
msm: pm-8x60: Increase warn timeout for sleep sts check

Arm cores take longer time to enter sleep. Wait for longer
time before warning until the CPU goes to sleep state.

Change-Id: I15caa8b2b2560aa68a4f4967c3364533234584b7
Signed-off-by: Priyanka Mathur <pmathur@codeaurora.org>
arm/dt: msm8974: Increase "ib" values for VIDC DDR bandwidth request

As per the recommendation by performance team, update the
"ib" values for DDR BW requests. This change fixes the
display under-runs seen during video playback.

Change-Id: I137814c82b257b8c751dab9df4f705e43fd5643e
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
sync: Limit logging to particular fence on timeout and error

Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
Change-Id: I5bd7d62260666cdd2a32212f0e828d2d5d7d7bba
ARM: dts: msm: increase adsp heap size for msm8974

For hevc hybrid codec, adsp heap size needs to be increased to
64MB to support 1080p video.

Change-Id: I3812cc2f0204f18fbade9ae41d8e784909055569
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
ARM: dts: Enable additional GDSC collapse modes based on HW version

8974v2.2 supports additional collapse modes for Oxili, Venus,
and MDSS. Move the device-tree parameters that disable the modes
to version-specific files. Some MDSS collapse modes should still
remain disabled, even on v2.2.  All collapse modes are supported
on 8974Pro.

Change-Id: Ic9f1c057d16042d9a9c339dc5786cf35301169f0
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
ARM: dts: msm: modify memory reservation requirements for tmc-etr on 8974

The CoreSight TMC-ETR driver is modified to meet its coherent memory
allocation requirement using dma_alloc_coherent api instead of custom
allocate_contiguous_ebi function. Add support to the device tree to
specify this memory requirement.

Also retain the dt entry to allocate contiguous memory via
allocate_contiguous_ebi api until the corresponding driver changes go
in to prevent breaking TMC-ETR functionality.

Change-Id: I67b4813ab45d520311765500513ea265fb33188e
Signed-off-by: Aparna Das <adas@codeaurora.org>