msm: kgsl: Activate the dispatcher following a resume

The dispatcher is put into pause during suspend to avoid commands coming in
during suspend.  Unfortunately the dispatcher never has a chance to unpause
itself on resume so new commands sit there waiting for the GPU to turn on.

Change-Id: Ic0dedbad6c9744b47fa1ae711d1b04735fa2f083
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
input: SynaImage_ds5: Firmware E061 (ORISE)

- Improved noisy charger performance
  . unexpected palm rejection, finger separation, unexpected release
- Improved linearity
- Improved small finger operation (sudden release with nail contact)

Change-Id: Idc1fa350a97745556578cad8e03fabc740e3d166
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
msm: mdss: release all overlay resources on last fb release

There are cases where the last frame buffer reference is released from a
different pid than the one who originally allocated the resource.
In these cases we can still deallocate all resources currently allocated
as we know that all references on fb dev have been released.

Change-Id: Ice2ca8df765cb8c4537a89fec887cb125d820d7a
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
ipv6: use a stronger hash for tcp

It looks like its possible to open thousands of TCP IPv6
sessions on a server, all landing in a single slot of TCP hash
table. Incoming packets have to lookup sockets in a very
long list.

We should hash all bits from foreign IPv6 addresses, using
a salt and hash mix, not a simple XOR.

inet6_ehashfn() can also separately use the ports, instead
of xoring them.

Reported-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:
	include/net/ipv6.h
net: defer net_secret[] initialization

Instead of feeding net_secret[] at boot time, defer the init
at the point first socket is created.

This permits some platforms to use better entropy sources than
the ones available at boot time.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arm/dt: hammerhead: Set the framerate to 60fps

Bug: 10668099
Change-Id: I13d3695f26a141f487c3af57a65f0fdfaea9219f
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm: camera: Bound check length for Dequeue stream buff info

Bound check the length param from user space given to
copy_from_user function to avoid any invalid memory access.

Change-Id: I926509a5fffd49cfc0130d182f246fbb9335b60e
CRs-Fixed: 519124
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
smp: Relax irqs_disable() warning in smp_call_function_single()

The change that long-ago added the interrupts-disabled warning in
smp_call_function_single() cited the following deadlock as the reason:
	CPU A				CPU B
	Disable interrupts
					smp_call_function()
					Take call_lock
					Send IPIs
					Wait for all cpus to acknowledge IPI
					CPU A has not responded, spin waiting
					for cpu A to respond, holding call_lock
	smp_call_function()
	Spin waiting for call_lock
	Deadlock			Deadlock

Such a deadlock is not possible however, in the event that
smp_call_function_single() is called for the currently-executing CPU.
While not a common usecase, relaxing the warning may simplify some
driver implementations.

The 'acpuclock-krait' driver in the MSM ARM sub-architecture provides
one example, where smp_call_function_single() is sometimes called from
a cpuidle path with interrupts disabled, but only ever from the target
CPU. Other callers of that same function may cross-call, but only do so
when interrupts are enabled.

Bug: 10858938
Change-Id: I647b3b46fe6aa4dfb06f7750396986b80b92d700
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
msm: camera_v2: Add new CPP ioctl for buf dequeue.

Add a new ioctl in CPP to just remove a buffer from the queue
and do a buf done on it, without any processing.

Bug: 10844261
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
hammerhead_defconfig: Support for some usb devices

1. usb printer support
2. usb joy stick support: specially ps2 vibrator
3. hid wii remote controller support

Change-Id: I02b1bace126dda057c7b124b1b4ca590cda0b897
Signed-off-by: jude84.kim <jude84.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
net: wireless: bcmdhd: Fixed Coverity issue.

Signed-off-by: Ecco Park <eccopark@broadcom.com>
mdss: Fix merge conflict

An earlier outdated version of the commit
27c4c3204beb2e6a4699ded7a4e3cc53ecaedbfd was applied to the
tree. Update the commit with the CAF version.

Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
usb: dwc3: reduce the charger detection dcd poll time to 1.5s

There are some old chargers which have dp/dm floating. Since
that charger are out of spec, usb driver cannot detect charger
type until poll retry end. Previously it took 10 sec.
Reduce the charger detection retry time to 1.5s for quick
abnormal charger detection.

Change-Id: Idf671f23c2372aeed0b279865fa2c4f2088a8d31
Signed-off-by: mohamed.khadri <mohamed.khadri@lge.com>
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
USB: android: Handle error conditions if usb_add_config fails

When bind_config() of any function driver fails, we go ahead and do a
usb_gadget_connect() due to which remove_config is called during
next disconnect process and a crash is observed as we delete the
config->list once again.

So if the bind_config of any function driver fails, don't call
usb_gadget_connect(), instead handle the possible error conditions.

CRs-Fixed: 488052
Change-Id: I974e2838ef5c36e586f49ae783e8608150770883
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
msm: vidc: add check for supported video session

Check if video session load can be handled by f/w
after session_init_done state and before moving to
load_resources state. This will ensure fallback of
unsupported video session to software codec library.

Change-Id: Ib8856a519a23c8bcab951c0e014dc5f454859efe
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: vidc: Add support for dumping packets

Whenever we read and write from queues add support for logging the
packet being written or read.  As this produces heavy kmsg traffic, also
add a dynamic fallback option to use ftrace.  Output to ftrace can be
triggered by 'echo 1 > debugfs/msm_vidc/debug_output'

Change-Id: Ie221c60ab465605ede332ac7eaadfb4b26c19e01
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: vidc: Increase maximum buffer count limit

Some clients want to allocate more buffers on decoder
input port than required (mainly for performance reasons).
Video decoder should honor the client request as long as
V4L2 framework permits.

CRs-fixed: 509088
Change-Id: Ic0da1b11ca49ebcd4498f8c8d93ba5b0e2dae8ba
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
msm: vidc: Add support for ring buffer and frame assembly

Add capabilities to optimize input buffers memory usage by using a
single ring buffer and at the same time provide to firmware a
contiguous buffer to handle frame assembly internally avoiding memory
copies.

Change-Id: I37badbb86b6990c9bf47a86042290c0a1052b68c
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: Add mutex for FW load calculation

When driver is calculating the load it should be
protected by mutex. While this calculation is in
progress if new session created then the load
calcuation goes wrong. So this should be protected
by mutex.

Change-Id: I22dd526b1b07d9edd7d7211f63485b2059cbfe57
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
msm: vidc: Return min buffer count in VIDIOC_REQBUFS.

- If stream triggers multiple port reconfigure events, number of
  buffers required for output plane incremented due to actual
  buffer count returned from video driver.
- Minbuffer count should be return when buffer requirement called.

Change-Id: I943f2cfdd595b8278058b5bdcbbcf24c9f320440
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>