msm: kgsl: Don't open kgsl device in erroneous case

If kgsl_get_process_private() returns NULL, it goes to
err_stop with result = -ENOMEM. If open_count is 0,
adreno_stop() overwrites the result variable with 0.
This leads to kgsl_open() to be successful while it
shouldn't.

Change-Id: Ic12d92a099280e4d958fa192fa5128211120d361
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: Pass the right timeout to adreno_drawctxt_wait()

adreno_drawctxt_wait() expects the passed in timeout to be in
milliseconds and converts it to jiffies.  Unfortunately, so does
the caller so the timeout is shorter than it should be.

Change-Id: Ic0dedbad85d50b32dba0fbf3ebb914335bf55166
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: Get CP_RPTR from register instead of shadow memory

Sometimes the RPTR shadow memory is unreliable causing timeouts
in adreno_idle().  Read it directly from the register instead.

Change-Id: Icae7521edd9723610c41f320c6a5c99f57bec7f5
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: Flush the UCHE when context changes

Add commands to flush the GPU UCHE when a new context submits
commands to GPU. The ensures that the new context does not use
stale data present in UCHE.

Change-Id: I123a323be5f3fb9d1f9f96fed5bb68b8d0d27d76
CRs-Fixed: 607976
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: kgsl: Enhance GFT to avoid hang->recover->hang cycle

If GFT recovered more than X times in Y ms invalidate the context
and do not attempt recovery. this is to prevent the case where GFT keeps
recovering continuously.

Change-Id: I9326a4cf0c8d1b6b92497ae5cd086e4b8bb7e89f
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: smem: make irq names more descriptive

Use node->name for irq devname if available.

Signed-off-by: Patrick Tjin <pattjin@google.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
gpio: msm-common: Add wakeup reason logging

Add call to log_wakeup_reason from msm_gpio_show_resume_irq
and remove redundant print.

Signed-off-by: Patrick Tjin <pattjin@google.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
nf: Fix PM notifier list corruption

unregister the pm_notifier when the netfilter is destroyed.
check for null timer when system suspends.

Bug: 13508802
Bug: 13508117

Change-Id: I8ff0c18993d8374103fae6f35183c3eae8a7e6f0
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>

Conflicts:

	net/netfilter/xt_IDLETIMER.c
Revert "nf: Fix PM notifier list corruption"

This reverts commit 5e647ffb460d9301f05281ba0a5ca6e257129c8d.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "ARM: msm: hammerhead: Update wlan locale translation table"

This reverts commit 2063faa0a2a2f0b1cd57091a79e1f586cd2592a7.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ARM: msm: hammerhead: Remove DFS channels in default locale

Change-Id: Ic61e5c029d9a7043c0e60401db8f91c784e73cd3
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
hamerhead_defconfig: merge the android configs (+DM_VERITY)

Bug: 13026447
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: camera: Add support for RAW streams in camera

Add suport for raw streams in ISP driver.

Change-Id: I5121981f63d656d08a72f362a6a9621031226dab
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: camera2: cpp: Append frame buffers to the list

In case of late buffer allocation, allocated buffers
have to be appended to the existing queues.

Change-Id: Ie14f00038e86b9d7c8caa01587a2ed1aee7d80e8
Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: camera_v2: Fix CAMIF stop sequence

Only stop CAMIF immediately if all active PIX and RAW streams
are stopped.

Bug: 13891761
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Change-Id: Idb0bc8da91a46c997c31c8075f9f4152a63d046d
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: camera: Fix buffer index mismatch for HAL buffer

AXI irq could arrive before EOF irq. Because of this,
folowing changes are made:

1. Set request_frame flag during IOCTL instead of waiting
until EOF, and
2. Set AXI skip flag during SOF instead of EOF.

Bug: 13887745
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Change-Id: I25a238e2cfae0e3a792a3689e00e16bc46dcb9d0
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
firmware_class: Introduce the request_firmware_direct API

On devices with low memory, using request_firmware on rather
large firmware images results in a memory usage penalty that
might be unaffordable. Introduce a new API that allows the
firmware image to be directly loaded to a destination address
without using any intermediate buffer.

Change-Id: I3ac3c5036c14773125291eccf83d494a8703b4cd
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: peripheral_loader: Use the new request_firmware_direct API

The request_firmware_direct API is more suited to devices
with memory constraints. Replace the call to request_firmware
with this new API.

Change-Id: I7e23c7b1f0728126b2b285addf81beee4d80a2b0
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
net/ipv6/addrconf: fix wdog_bark caused by infinite spinning on a deadlock

A synchronization issue may occur while addrconf_ifdown(),
when it updates inet6_addr_lst[] with already destroyed *ifp
by ipv6_add/del_addr(), using the same addrconf_hash_lock.

[core 0]                                        [core 1]
   |                                               |
   |->ipv6_add_addr                                |->addrconf_ifdown
       |                                               |
       |                                               |-> spin_lock(&addrconf_hash_lock);
       |                                               |-> remove ifa->addr_lst from inet6_addr_lst
       |                                               |-> spin_unlock(&addrconf_hash_lock);
       |-> spin_lock(&addrconf_hash_lock);             |
       |-> add ifa->addr_lst to inet6_addr_lst[hash]   |
       |-> spin_unlock(&addrconf_hash_lock);           |
       |-> write_lock(&idev-lock);                     |
       |-> add ifa->if_list to idev->addr_list         |
       |-> write_unlock(&idev->lock);                  |
       |                                               |-> write_lock(&idev->lock);
       |                                               |-> remove ifa->if_list from idev->addr_list
       |                                               |-> write_unlock(&idev->lock);

[28055.378524] ------------[ cut here ]------------
[28055.378591] WARNING: at net/ipv6/addrconf.c:546 inet6_ifa_finish_destroy+0x98/0xc8()
[28055.378691] [<c010de1c>] (unwind_backtrace+0x0/0x144) from [<c09fd08c>] (dump_stack+0x20/0x24)
[28055.378747] [<c09fd08c>] (dump_stack+0x20/0x24) from [<c0192adc>] (warn_slowpath_common+0x58/0x70)
[28055.378840] [<c0192adc>] (warn_slowpath_common+0x58/0x70) from [<c0192bec>] (warn_slowpath_null+0x2c/0x34)
[28055.378931] [<c0192bec>] (warn_slowpath_null+0x2c/0x34) from [<c0911a90>] (inet6_ifa_finish_destroy+0x98/0xc8)
[28055.379026] [<c0911a90>] (inet6_ifa_finish_destroy+0x98/0xc8) from [<c091498c>] (addrconf_ifdown+0x2e4/0x430)
[28055.379120] [<c091498c>] (addrconf_ifdown+0x2e4/0x430) from [<c0915b70>] (addrconf_notify+0xe4/0x3ac)
[28055.379209] [<c0915b70>] (addrconf_notify+0xe4/0x3ac) from [<c01b9df0>] (notifier_call_chain+0x54/0x94)
[28055.379321] [<c01b9df0>] (notifier_call_chain+0x54/0x94) from [<c01ba3ac>] (__raw_notifier_call_chain+0x24/0x2c)
[28055.379379] [<c01ba3ac>] (__raw_notifier_call_chain+0x24/0x2c) from [<c01ba3dc>] (raw_notifier_call_chain+0x28/0x30)
[28055.379475] [<c01ba3dc>] (raw_notifier_call_chain+0x28/0x30) from [<c0840ea4>] (call_netdevice_notifiers+0x38/0x60)
[28055.379568] [<c0840ea4>] (call_netdevice_notifiers+0x38/0x60) from [<c0844d5c>] (__dev_notify_flags+0x3c/0x6c)
[28055.379657] [<c0844d5c>] (__dev_notify_flags+0x3c/0x6c) from [<c0844dcc>] (dev_change_flags+0x40/0x58)
[28055.379747] [<c0844dcc>] (dev_change_flags+0x40/0x58) from [<c08d2834>] (devinet_ioctl+0x79c/0x8bc)
[28055.379837] [<c08d2834>] (devinet_ioctl+0x79c/0x8bc) from [<c08d3488>] (inet_ioctl+0x1c0/0x1d0)
[28055.379928] [<c08d3488>] (inet_ioctl+0x1c0/0x1d0) from [<c082d7f0>] (sock_ioctl+0x80/0x248)
[28055.379982] [<c082d7f0>] (sock_ioctl+0x80/0x248) from [<c0275364>] (do_vfs_ioctl+0x94/0x5bc)
[28055.380071] [<c0275364>] (do_vfs_ioctl+0x94/0x5bc) from [<c0275908>] (sys_ioctl+0x7c/0x8c)
[28055.380164] [<c0275908>] (sys_ioctl+0x7c/0x8c) from [<c0107300>] (ret_fast_syscall+0x0/0x30)
[28055.380252] ---[ end trace 920b8b321354f066 ]---
[28061.735021] Watchdog bark! Now = 28061.735014
[28061.735106] Watchdog last pet at 28050.179294
[28061.735245] cpu alive mask from last pet 0-3
[28061.735321] Causing a watchdog bite!

The addrconf_hash_lock should cover both modification of inet6_addr_list and idev->addr_list
to resolve any possible synchronization issue between addrconf_ifdown() and ipv6_add/del_addr().

Bug: 11293746
Signed-off-by: David C. Park <davidc.park@lge.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
input: SynaImage_ds5: Firmware E079 (ORISE)

- Improved noise peak filter (increase from 60 to 70)
- Increased IM threshold of switching into 60Hz
- Increased software filter delay
- Less frequency shifting in noisy state
- Improved low temperature environment

Change-Id: I58a79c034ee1600cc7a2b79c48bf2ef2594efecb
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>