BACKPORT: mwifiex: do not re-associate when already connected

In managed mode if the driver is getting a re-associate command
from cfg80211, driver deauthenticates with the AP internally and
sends a disconnected event to cfg80211 before completion of its
association process. The disconnected event then modifies the
SSID length as wdev->ssid_len = 0. So, upon receiving the connect
result event from driver, cfg80211 is unable to get that BSS from
the device's BSS list and generates the following WARN_ON message.

WARNING: CPU: 0 PID: 857 at net/wireless/sme.c:658
         __cfg80211_connect_result+0x3a6/0x3e0 [cfg80211]()

Avoid re-association while the device is already associated to a
network. Also remove the internal deauthentication from the
association path.

BUG=chrome-os-partner:18058
TEST=On Daisy ToT kernel, we do not see this WARNING.
Also ran complete autotest suite, no regression are seen.

Change-Id: I4d44ca2d100c4ee16f79b630bd5c335153296310
Signed-off-by: Ujjal Roy <royujjal@gmail.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/230790
Reviewed-by: Paul Stewart <pstew@chromium.org>
CHROMIUM: mwifiex: few more register offset entries for sdio card structure

This patch adds some more defitions to card specific register structure
and removes static defines for these registers.

BUG=None
TEST=With all patches in this series applied, SD8887 device is
enumarated successfully. WLAN scan, associate, ping works fine.
Bluetooth interface is loaded successully and pscan works fine.

Change-Id: I28feb38dadf940e98c967e980d3687f0928ad43e
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229880
Reviewed-by: Peter Qiu <zqiu@chromium.org>
CHROMIUM: mwifiex: add support for SD8887 chipset

This patch adds SD8887 support to mwifiex.
SD8887 is Marvell's 1x1 11ac solution.

The corresponding firmware image file is located at:
"mrvl/sd8887_uapsta.bin"

BUG=none
TEST=With all patches in this series applied, SD8887 device is
enumarated successfully. WLAN scan, associate, ping works fine.
Bluetooth interface is loaded successully and pscan works fine.

Change-Id: Iee588244622926f1d7cdac28702b426af0dda87f
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229881
Reviewed-by: Peter Qiu <zqiu@chromium.org>
CHROMIUM: drm/cirrus: increase sequence number on page flip

BUG=None
TEST=None

Users expect the sequence number associated with a crtc to increase
after vblank. This patch fulfills this missing behaviour.

Signed-off-by: Zach Reizner <zachr@chromium.org>
Change-Id: Ic8ec8ffb39d0a3d1ccbb50a9116a14e0673fba9c
Reviewed-on: https://chromium-review.googlesource.com/231067
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
CHROMIUM: Bluetooth: btmrvl: rename definitions from 88xx to 8897

Register offsets are different for SD8897 and newer chip SD8887.
We can not have common btmrvl_sdio_card_reg map for them.

BUG=None
TEST=With all patches in this series applied, SD8887 device is
enumarated successfully. WLAN scan, associate, ping works fine.
Bluetooth interface is loaded successully and pscan works fine.

Change-Id: I97931a4f91229aece0362662555e494dfc10a0c9
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229882
Reviewed-by: Peter Qiu <zqiu@chromium.org>
CHROMIUM: Bluetooth: btmrvl: support Marvell Bluetooth device SD8887

This patch adds driver support for marvell SD8887 chip.

BUG=None
TEST=With all patches in this series applied, SD8887 device is
enumarated successfully. WLAN scan, associate, ping works fine.
Bluetooth interface is loaded successully and pscan works fine.

Change-Id: I884847462d34f175974c70cbdbae80e63ed4fe95
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Kevin Gan <ganhy@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229883
Reviewed-by: Peter Qiu <zqiu@chromium.org>
CHROMIUM: mwifiex/btmrvl: support for parallel FW download

This patch adds support for independant parallel FW download
for SD8887 WLAN and BT modules.

BUG=None
TEST=With all patches in this series applied, SD8887 device is
enumarated successfully. WLAN scan, associate, ping works fine.
Bluetooth interface is loaded successully and pscan works fine.

Change-Id: I58ccfd72b3d9635ddccf588a051886afc9e0fb92
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229884
Reviewed-by: Peter Qiu <zqiu@chromium.org>
drm/udl: handle page mapping in dmabuf export.

BUG=chromium:402599
TEST=drm-tests null_platform_test with 2 frame buffers
Signed-off-by: Haixia Shi <hshi@chromium.org>

Change-Id: I69958d2287d1eb2035ccf3eb82623f59d5359396
Reviewed-on: https://chromium-review.googlesource.com/231074
Commit-Queue: Haixia Shi <hshi@chromium.org>
Tested-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Haixia Shi <hshi@chromium.org>
BACKPORT: xhci: fix list access before init

If for whatever reason we fall into fail path in xhci_mem_init()
before bw table gets initialized we may access the uninitialized lists
in xhci_mem_cleanup().

Check for bw table before traversing lists in cleanup routine.

This patch should be backported to kernels as old as 3.2, that contain
the commit 839c817ce67178ca3c7c7ad534c571bba1e69ebe "xhci: Store
information about roothubs and TTs."

Reported-by: Sergey Dyasly <dserrg@gmail.com>
Tested-by: Sergey Dyasly <dserrg@gmail.com>
Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
(cherry picked from commit 88696ae432ce7321540ac53d9caab3de9118b094)
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>

Conflicts (minor surrounding context change):
	drivers/usb/host/xhci-mem.c

BUG=chrome-os-partner:32694
TEST=No known steps to reproduce.  Compile, install, run with no
     noticeable regressions in the context of usb and suspend/resume.

Change-Id: Ia8519cf36415feafe8e7e5b1ecceaadcc7334377
Reviewed-on: https://chromium-review.googlesource.com/230490
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Matthew E Hiltner <matthew.e.hiltner@intel.com>
Commit-Queue: Ullysses A Eoff <ullysses.a.eoff@intel.com>
BACKPORT: usb: xhci: Fix OOPS in xhci error handling code

The xhci driver will OOPS on resume from S2/S3 if dma_alloc_coherent()
is out of memory. This is a result of two things:
1. xhci_mem_cleanup() in xhci-mem.c free's xhci->lpm_command if
it's not NULL, but doesn't set it to NULL after the free.
2. xhci_mem_cleanup() is called twice on resume, once for normal
restart and once from xhci_mem_init() if dma_alloc_coherent() fails,
resulting in a free of xhci->lpm_command that has already been freed.
The fix is to set xhci->lpm_command to NULL after freeing it.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0eda06c7c17ae48d7db69beef57f6e2b20bc3c72)
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>

Conflicts (minor surrounding context change):
	drivers/usb/host/xhci-mem.c

BUG=chrome-os-partner:32694
TEST=No known steps to reproduce.  Compile, install, run with no
     noticeable regressions in the context of usb and suspend/resume.

Change-Id: I10a03e9498ce30784482c2a93b2ed9fefbe736a1
Reviewed-on: https://chromium-review.googlesource.com/230491
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Matthew E Hiltner <matthew.e.hiltner@intel.com>
Commit-Queue: Ullysses A Eoff <ullysses.a.eoff@intel.com>
UPSTREAM: xhci: fix oops when xhci resumes from hibernate with hw lpm capable devices

Resuming from hibernate (S4) will restart and re-initialize xHC.
The device contexts are freed and will be re-allocated later during device reset.

Usb core will disable link pm in device resume before device reset, which will
try to change the max exit latency, accessing the device contexts before they are re-allocated.

There is no need to zero (disable) the max exit latency when disabling hw lpm
for a freshly re-initialized xHC. So check that device context exists before
doing anything. The max exit latency will be set again after device reset when usb core
enables the link pm.

Reported-by: Imre Deak <imre.deak@intel.com>
Tested-by: Imre Deak <imre.deak@intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 96044694b8511bc2b04df0776b4ba295cfe005c0)
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>

BUG=chrome-os-partner:32694
TEST=No known steps to reproduce.  Compile, install, run with no
     noticeable regressions in the context of usb and suspend/resume.

Change-Id: I97904e8e23a52ca4e80f9473e5dc23e79d4f1021
Reviewed-on: https://chromium-review.googlesource.com/230492
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Matthew E Hiltner <matthew.e.hiltner@intel.com>
Commit-Queue: Ullysses A Eoff <ullysses.a.eoff@intel.com>
Merge branch 'chromeos-3.8' of https://chromium.googlesource.com/chromiumos/third_party/kernel into chromeos-3.8