usb: diag_bridge: Support PID 9079

Add support for PID 0x9079 and also designate device IDs per-PID.
9079, having a device ID of 1, is intended to be able to coexist
with another probed device with device ID 0.

Change-Id: Ib8cc52a9277b0013e098baeaafa6fce1c8498c42
Signed-off-by: Jack Pham <jackp@codeaurora.org>
msm_fb: display: add mdp clock control to histogram enable/disable

Add mdp clock control to histogram enable and disable block to
prevent system from crashing when accessing register with mdp
clocks off.

Change-Id: Ide808b332b5456f3fc639fcbb0d03d5cad0e387f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Revert "msm: board-8064: Increase MFC ION heap size by 256KB"

changing MFC heap size requires a corresponding change in TZ and
should affect only 8064 target. Reverting the size change for
8960 target

Change-Id: Iea100464218891e288714ee93cc8786b7c160f94
Signed-off-by: Praveen Chavan <pchava@codeaurora.org>
ASoC: msm: qdsp6: check for invalid port index

Function which converts port ID to port index can return
error value if port ID is invalid. Caller should not
blindly use return value without checking

Change-Id: I02b8112b6714e3364758907e7078bcbb88d45b6b
Signed-off-by: Patrick Lai <plai@codeaurora.org>
arm: msm: qdsp6v2: update to finite loop

The reason why the original code requires infinite loop
cannot be accounted for. However, it seems reasonable to
wait for 10 minutes.

Change-Id: I057f7ac8a83585abbc4ccd63a721df82f71ea045
Signed-off-by: Patrick Lai <plai@codeaurora.org>
msm_fb: display: initialize dmap_comp before wait4dmap

blt_wait flag will be set when both two writeback buffers
are used. In this case, kickoff can not be proceeded until
next dmap_done to release writeback buffer. This patch
initialize dmap_comp before wait4dmap to make sure
wait_for_completion is enforced.

CRs-fixed: 448168
Change-Id: I64f2ad599b18f9d8b346c41a55829c564fcced0b
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: HDMI: Reset HDCP reauth flag when powering off

The software flag used for storing the HDCP reauthentication state
needs to be reset whenever the HDMI device is powered off. This is
needed to avoid a potential reauthentication attempt upon a
subsequent connection which could lead to device hang as a result
of incorrect sequence of register accesses.

CRs-Fixed: 444312
Change-Id: I6b5b08394dd96ccbc08c4ca72b6dc4b2c4dbf6be
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
qseecom: Check if app exists before loading the app

There is a chance of send a request to QSEE to load an app that
is already previously loaded. Requesting QSEE to load an app
that is already loaded will result in a failure.

Issuing a request to QSEE to check if app already exists before
issuing a request to load it, all within the same app_access_lock
mutex, fixes this issue.

CRs-Fixed: 420473
Change-Id: I5dfb02c7b0f0144d142fc70084ec1e096ada0439
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
android/lowmemorykiller: Wait for memory to be freed

The memory reclaim code needs to give time to the system to
return the memory from a killed process otherwise the memory
reclaim code could run continuously, in multiple threads,
which could starve both the watchdog thread and the thread
which is responsible for returning the memory from the
killed process.

Change-Id: Ib390dbb021cb6d41e74ac64eca6fef46367daf1e
CRs-fixed: 447740
Signed-off-by: Liam Mark <lmark@codeaurora.org>
media: dvb: mpq: Fix initialization of secure-demux resources

When filter is started secure-demux buffers handles
should be initialized with invalid values so that they
are not released if they were not set.

Change-Id: I79c3896130059a5118f4966cc59c80d2f3f83814
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
cma: fix watermark checking

* Add ALLOC_CMA alloc flag and pass it to [__]zone_watermark_ok()
  (from Minchan Kim).

* During watermark check decrease available free pages number by
  free CMA pages number if necessary (unmovable allocations cannot
  use pages from CMA areas).

CRs-Fixed: 446321
Change-Id: Ibd069b028eb80b70701c1b81cb28a503d8265be0
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[lauraa@codeaurora.org: context fixups]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Bluetooth: GAP: Dont allow role switch when there is another ACL

The scatternet scenarios are difficult to be handled in SOC. This
change not to allow role switch during outgoing ACL connections
will avoid scatternet scenarios.

CRs-fixed: 392836
Change-Id: I5769b71879ea951755e115424fb2b5b504e95784
Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
Bluetooth: Avoid re-authentication for secure high connections

The re-authentication code changes are added to mandate 16 digit
PIN Key for SECURE_HIGH connections. But only SAP profile needs
16 digit key, not all the profiles that register with SECURITY
HIGH. Avoid the code to mandate 16 digit key.

Change-Id: Iffc02841e52b8c0b2f6e2495b27df26869e72999
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
Signed-off-by: Ram Mohan Korukonda <rkorukon@codeaurora.org>
Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
Bluetooth: Fix for LE cancel Create Connection not working

Added management method to send LE cancel create connection
HCI command

CRs-fixed: 366284
Change-Id: I17a75ecf4ecaa32cab7e3a4cb8beb8cc4b4580c4
Signed-off-by: Archana Ramachandran <archanar@codeaurora.org>
Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
Bluetooth: GAP: Read the clock offset on ACL connection complete

Keep the Clock offset valid for one Hour and read it again after
connection complete so that we have most recent value. This helps
for faster ACL connections.

CRs-fixed: 430132
Change-Id: I1526878a7365f9cc0c654e0af6c4dd214fac4cd8
Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
Bluetooth: Validate the hci connection before data transfer

Avoid the possible crash due to Bluetooth connection loss while data
trasfer is in progress. Bluetooth connection loss might happen due to
turn off of Bluetooth or reset of device when there is an active data
transfer over Bluetooth.

Change-Id: Ib15a9ac2df3a250d279774d6e45f1e37c9ea1cc0
CRs-fixed: 375238
Signed-off-by: Bhakthavatsala Raghavendra <braghave@codeaurora.org>
Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
Revert "usb: msm_otg: prevent abnormal charging stop when vbus active."

This reverts commit d530d1cf40f3b45474621e0893d6c415b27d2077.
It doesn't disable USB charging on receiving RESET from Host
which is failing USB CV unconfigure current measurement test
case.

CRs-Fixed: 446955
Change-Id: I17c3277b8f0bceee690ae547e79e5287b0eb3f19
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Revert "usb: ehci-msm-hsic: replace wakelock with wakeup source"

This reverts commit dd5ad79f501c462fbee8e36c57747883d2317d29.

Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:

	drivers/usb/host/ehci-msm-hsic.c

Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:
	drivers/usb/host/ehci-msm-hsic.c
EHCI: HSIC: Handle asynchronous interrupt properly

Runtime PM resume and asynchronous interrupt can run in parallel. When
this happens, there is a possibility of PM usage counter mismatch.
Fix this by checking the return value of pm_runtime_get() and by
disabling the USB interrupt while resuming the HSIC.

Consider asynchronous interrupt case when resuming HSIC during system
resume.

(cherry picked from commit 822fbe6e90d32ec7c7b5d7cee69a8cd36869005f)

Conflicts:

	drivers/usb/host/ehci-msm-hsic.c

CRs-Fixed: 444883
Change-Id: I63db49d8b45a7413f9456a93c9648511ad622b4b
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
EHCI: HSIC: Disable asynchronous interrupt when wakeup gpio is present

Controller can generate interrupt asynchronously in low power mode (LPM).
Enable this interrupt in USBCMD register only when wakeup gpio IRQ is
not available.

(cherry picked from commit 0c9f29cff6b8686e9a89a500b545a9f331ab4618)

CRs-Fixed: 444883
Change-Id: I05258feb9476d1373d30645f6c750923589aa1cb
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>