drm/anx7808: Increase delay at the end of power_off

This increases the delay at the end of the power_off routine to ensure
the value of the cable_det gpio is valid when we exit. The gpio bounces
as a result of powering down the chip, so waiting 25ms ensures that it's in
steady state.

BUG=chromium:351844
TEST=Tested on spring by entering/exiting docked mode repeatedly

Change-Id: Iad2efec2e8d4a8c722a8b7539fce006c3a9cb4dd
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/190494
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/194016
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
drm/exynos: add support for 1600x900

This patch adds new resoluton range of 1600x900
in the range of supported resolutions.

BUG=chrome-os-partner:26914
TEST=connect monitor with max/best resolution supported
as 1600x900 and verifed 1600x900 is selected on HDMI

Change-Id: I1e56f08092653c8c37c79c406178f64aa3f6c16e
Signed-off-by: Shirish S <s.shirish@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/190278
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Dongwon Jung <dw3333.jung@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/194071
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
UPSTREAM: Bluetooth: btmrvl: don't consume all vendor specific events

If vendor specific HCI commands are received from application,
we should send corresponding events to stack.
These events should be consumed in driver, only if they are for
the internal HCI commands generated by driver.

This patch fixes the vendor command 0x3f stuck problem with
above mentioned change. For example,

hcitool cmd 3f 22 fe 06 22 21 20 43 50 00

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

BUG=chrome-os-partner:27124
TEST="hcitool cmd 3f 22 fe 06 22 21 20 43 50 00" command succeeds.

Change-Id: If79ed4f7cedf623813e303644fa6fc9d9da2caee
Reviewed-on: https://chromium-review.googlesource.com/191040
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Tested-by: Bing Zhao <bzhao@marvell.com>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/194076
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
UPSTREAM: Bluetooth: btmrvl: separate write-to-clear function from interrupt handler

This patch improves readability and makes future changes easier.

Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=chrome-os-partner:26511
TEST=hciconfig up and hcitool scan work fine

Change-Id: I197273bb4356cc904911457a655b0669d4427135
Reviewed-on: https://chromium-review.googlesource.com/191933
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Tested-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/197670
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
UPSTREAM: Bluetooth: btmrvl: implement read-to-clear for SD8897 interrupts

For SD8897, CMD52 write_to_clear may have missing interrupts
under certain corner case condition. Use CMD53 read-to-clear
to fix the problem.

Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=chrome-os-partner:26511
TEST=hciconfig/hcitool works, a2dp works fine for 12+ hours
on peach_pit.

Change-Id: Id525fd8de181bdf96def10498960694a13e209f4
Reviewed-on: https://chromium-review.googlesource.com/191934
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Tested-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/194077
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
CHROMIUM: Bluetooth: btmrvl: indicate pscan scheduling instant in a debug event

A vendor specific command is sent to firmware during
initialization to enable this feature. This command is for
SD8897 only.

Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=chrome-os-partner:26511
TEST=play video clips with A2DP continuously for 4 hours.

Change-Id: I4550696e55e154d15298c429d6c1f6d7ca0d46c6
Reviewed-on: https://chromium-review.googlesource.com/192240
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Tested-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/194079
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
UPSTREAM: mwifiex: use timeout variant for wait_event_interruptible

It has been observed that system hangs during suspend, if host
sleep activation fails due to a missing interrupt from firmware.
Use timeout variant, so that the thread will be woken up when
timer expires.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=chrome-os-partner:26770,26781,26916
TEST=run "suspend_stress_test" overnight and confirm no msgs
"GET_CMD_NODE: cmd node not available" in /var/log/messages.
There could be "cmd_wait_q terminated: -512" logs but they
should not cause system hang.

Change-Id: I50f3868fe6bf3c715fd7f185b54383eb22d804f2
Reviewed-on: https://chromium-review.googlesource.com/191026
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Bing Zhao <bzhao@marvell.com>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/194011
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
atmel_540s, Touch Major should get from area.

We get touch mojor from peak. But it is incorrect.
Touch major should be calculated by area.
With patch, we can get correct touch major value on pi.

BUG=chrome-os-partner:27698
TEST=Run evtest, mtplot and gesture on pi.
Check if touch_major is large with palm or not.

Change-Id: I2fa848a91919039120053c72623ee5b8f2e68ffc
Signed-off-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/193578
Reviewed-by: Inno Park <ih.yoo.park@samsung.com>
Tested-by: Inno Park <ih.yoo.park@samsung.com>
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Tested-by: Charles Mooney <charliemooney@chromium.org>
(cherry picked from commit d1206c014d207f54b1fcf5d158a03bff72a1018b)
Reviewed-on: https://chromium-review.googlesource.com/193740
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
UPSTREAM: mwifiex: fix spinlock bad magic bug

[ 6630.450908] BUG: spinlock bad magic on CPU#1,
               ksdioirqd/mmc1/355
[ 6630.450914] Unable to handle kernel NULL pointer dereference
               at virtual address 0000004f
[ 6630.450919] pgd = ecbd8000
[ 6630.450926] [0000004f] *pgd=00000000
[ 6630.450936]  lock: 0xeea4ab08, .magic: 00000000,
               .owner: <none>/-1, .owner_cpu: 0
[ 6630.450939] Backtrace:
[ 6630.450956] [<c010d354>] (unwind_backtrace+0x0/0x118) from
               [<c060c238>] (dump_stack+0x28/0x30)
[ 6630.450960] Internal error: Oops: 5 [#1] SMP ARM
[ 6630.450964] Modules linked in: uvcvideo videobuf2_vmalloc
[ 6630.450980] [<c060c238>] (dump_stack+0x28/0x30) from
               [<c0315ab4>] (spin_dump+0x80/0x94)
[ 6630.450988] [<c0315ab4>] (spin_dump+0x80/0x94) from
               [<c0315af4>] (spin_bug+0x2c/0x30)
[ 6630.450996] [<c0315af4>] (spin_bug+0x2c/0x30) from
               [<c0315b80>] (do_raw_spin_lock+0x28/0x15c)
[ 6630.451004] [<c0315b80>] (do_raw_spin_lock+0x28/0x15c) from
               [<c0610c24>] (_raw_spin_lock_irqsave+0x20/0x28)
[ 6630.451016] [<c0610c24>] (_raw_spin_lock_irqsave+0x20/0x28)
               from [<bf07a7f4>] (mwifiex_exec_next_cmd
                                  +0x6c/0x45c [mwifiex])
[ 6630.451030] [<bf07a7f4>] (mwifiex_exec_next_cmd+0x6c/0x45c
               [mwifiex]) from [<bf07834c>]
               (mwifiex_main_process+0x2c8/0x464 [mwifiex])
[ 6630.451047] [<bf07834c>] (mwifiex_main_process+0x2c8/0x464
               [mwifiex]) from [<bf0a093c>]
               (mwifiex_sdio_interrupt+0xc8/0x1cc [mwifiex_sdio]
[ 6630.451064] [<bf0a093c>] (mwifiex_sdio_interrupt+0xc8/0x1cc
               [mwifiex_sdio]) from [<c04bbde0>]
               (sdio_irq_thread+0x178/0x31c)
[ 6630.451079] [<c04bbde0>] (sdio_irq_thread+0x178/0x31c) from
               [<c0145514>] (kthread+0xc8/0xd8)
[ 6630.451095] [<c0145514>] (kthread+0xc8/0xd8) from
               [<c0106118>] (ret_from_fork+0x14/0x20)

This bug has introduced/exposed due to recent patch in which we
cancel pending commands before suspend (using hs_enabling flag).
The NULL pointer is dereferenced when both
mwifiex_cancel_all_pending_cmd() and mwifiex_exec_next_cmd()
try to access cmd pending queue simultaneously.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=chrome-os-partner:26770,26916
TEST=run "suspend_stress_test" overnight and don't get
"BUG: spinlock bad magic" kernel panic.

Change-Id: Ia4bcc8b642d18dfacf9c70086d9f2d5692cf1ab8
Reviewed-on: https://chromium-review.googlesource.com/192050
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/194075
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
UPSTREAM: mwifiex: cancel pending commands during host sleep

Sometimes we may end up downloading other commands when host
sleep is configured. This patch makes sure that pending
commands are cancelled and we stop queueing further commands
during host sleep.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=chrome-os-partner:26770,26916
TEST=enable driver cmd logs, run "suspend_stress_test" overnight
on peach and confirm that hs_cfg and hs_activated happens
atomically based on the logs, i.e., no command being sent
between "hs_cfg command response is received" and "hs_activated".

Change-Id: I1e8c329bd600500e27fcc2936de5449f8371ac78
Reviewed-on: https://chromium-review.googlesource.com/191642
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Tested-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/194074
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
UPSTREAM: mwifiex: correction in sleep confirm command sequence
 number

Incremented sequence number was not being used for SLEEP confirm
command. This patch fixes the issue.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=none
TEST=enable driver log and check the sequence number of sleep_cfm
command is increased by one.

Change-Id: I1b80b6751ec5e27b7142bf1a02dc3202915e3a31
Reviewed-on: https://chromium-review.googlesource.com/191641
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Tested-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/194073
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
UPSTREAM: mwifiex: corner case NULL pointer dereference fix

When next scan command is delayed due to Tx traffic and
meanwhile synchronous command is received followed by a signal,
we cance all pending commands. NULL pointer dereference is seen
in this case while queueing next command in scan delay timer.
This patch adds a check to fix this issue.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=chrome-os-partner:26770,26916
TEST=run "suspend_stress_test" overnight on peach and confirm
no NULL pointer dereference at PC=mwifiex_insert_cmd_to_pending_q,
LR=scan_delay_timer_fn().

Change-Id: I708e2c691ec841e3eb4c4453462e3affafffba69
Reviewed-on: https://chromium-review.googlesource.com/191640
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Tested-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/194072
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
HACK: ARM: mm: Increase TAG and DATA RAM Setup on exynos542x at boot

In (ARM: exynos542x: Adjust L2 cache timings at resume time) we fix
the cache timings at resume time (and thus whenever we switch from an
A7 to an A15), but we don't fix them at boot time.

Close the gap in time when the L2 cache timings are wrong by making
sure that we also adjust the timings at boot.

If/when we release a RW firmware update on pit and pi we can safely
revert this patch.

Before this change:
Data RAM Latency is 010 i.e. 3
Data RAM Slice = 1
Data RAM Setup = 0
So effective Data RAM Latency is 5

Tag RAM latency is 010 i.e. 3
Tag RAM Setup = 0
Tag RAM Slice = 0
So effective Tag RAM Latency is 3.

After this change:
Now, make Data Setup -> 1, Tag RAM setup -> 1

So effective Data RAM Latency is 6
So effective Tag RAM Latency is 4

BUG=chrome-os-partner:27270
TEST=Factory stress test on Pit and Pi shows no more hangs.

Change-Id: I5a155529655161dfd66384d2e549ae45e9921bd9
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Arjun.K.V <arjun.kv@samsung.com>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/191670
Reviewed-on: https://chromium-review.googlesource.com/194070
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
ARM: exynos542x: Adjust L2 cache timings at resume time

On the exynos5420 and exynos5422 we need to make sure that the Data
RAM Setup and Tag RAM Setup are both set to 1 in order for things to
be stable.  Unfortunately some early firmware shipped with devices
doesn't set this up properly.

We'll tweak the platform-specific resume code to detect exynos542x and
fix.

BUG=chrome-os-partner:27270
TEST=See I1c8d3c48b2a6a617f71a965070aa3d8be6cad887 (with all patches)

Change-Id: Ib4915d1bb05cf4f62328ee28881e31759116b502
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Arjun.K.V <arjun.kv@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/191698
Reviewed-on: https://chromium-review.googlesource.com/194019
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
arm: bL_switcher: Use plat_cpu_resume to get the resume code

We may want to run a bit of platform specific code at resume time
before the generic ARM code runs.  Let's use the plat_cpu_resume
global to call the resume code so that we can get patches in.

BUG=chrome-os-partner:27270
TEST=See I1c8d3c48b2a6a617f71a965070aa3d8be6cad887 (with all patches)

Change-Id: I3970134682a8e4bb2e195294d9cfe2a9bce56fc3
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/191697
Tested-by: Arjun K V <arjun.kv@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/194018
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
ARM: kernel: Create plat_cpu_resume to hold a pointer to resume

In some platform-agnostic code (like MCPM) we need a pointer to the
resume code.  Create a global variable that defaults to the generic
ARM resume code.  This allows platforms needing resume-time patches to
update the global.

A future patch will change mcpm to refer to this global.

BUG=chrome-os-partner:27270
TEST=See I1c8d3c48b2a6a617f71a965070aa3d8be6cad887 (with all patches)

Change-Id: I2e9bb358c7916e2ff326f1f60f967ea85d631c5f
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/191696
Tested-by: Arjun K V <arjun.kv@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/194017
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
CHROMIUM: s5p-mfc: De-init MFC when watchdog kicks in

If the software watchdog kicks in, we need to de-init MFC
before reloading firmware and re-intializing it again.

BUG=chrome-os-partner:26961
TEST=Seek resolution change videos till it stops.
Open another video and observe it plays

Change-Id: I5f5a825c590f58842c11b52bfb58b14ab19793c5
Signed-off-by: Arun Mankuzhi <arun.m@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/190838
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Kiran AVND <kiran@chromium.org>
Tested-by: Kiran AVND <kiran@chromium.org>
Commit-Queue: Pawel Osciak <posciak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/194015
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
UPSTREAM: mwifiex: abort scan while cancelling pending command

mwifiex_cancel_pending_ioctl() and
mwifiex_cancel_all_pending_cmd() are called in command timeout
and driver unload paths respectively.
If scan operation is in progress, we should abort it smoothly.

Reported-by: Tim Shepard <shep@alum.mit.edu>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

BUG=chrome-os-partner:26626
TEST=run "./reload_network_device.sh mlan0; sleep 30" in a loop
for 50 times.

Change-Id: I44de2acf0d0cb7f72fbda45bd68037b9a259ffa8
Reviewed-on: https://chromium-review.googlesource.com/190810
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/194014
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
UPSTREAM: mwifiex: scan command preparation failure handling

When scan request is received, scan commands are prepared and
queued into scan pending queue. There is a corner case when
command nodes are full. So we stop queueing further scan
commands and return an error. This patch makes sure that
currently queued commands in scan pending queue are also freed
in this case.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=chrome-os-partner:26770,26916
TEST=run "suspend_stress_test" overnight and confirm no msgs
"GET_CMD_NODE: cmd node not available" in /var/log/messages.

Change-Id: Ib61533ebb9636fb77731981005f90f43cec846a7
Reviewed-on: https://chromium-review.googlesource.com/191024
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Bing Zhao <bzhao@marvell.com>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/194013
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
UPSTREAM: mwifiex: cancel pending commands for signal

When a thread is interrupted by signal, all
wait_event_interruptible calls after queueing commands return
an error. Numbers of commands in pending queue are increased
in this case. Sometimes all commands nodes in pool are filled.

We will cancel pending commands when signal is received.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>

BUG=chrome-os-partner:26770,26916
TEST=run "suspend_stress_test" overnight and confirm no msgs
"GET_CMD_NODE: cmd node not available" in /var/log/messages.

Change-Id: I04841c7991e570b269bde55485a13f0ada97afdc
Reviewed-on: https://chromium-review.googlesource.com/191025
Reviewed-by: hyuckjoo lee <hyuckjoolee345@gmail.com>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Bing Zhao <bzhao@marvell.com>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/194012
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>