diag: Fix race condition in diagchar driver

diag driver maintains socket logging process in global driver
structure which is manipulated in switch_logging and in close
file_operation.
There is a possibility of race while clearing the socket logging
process in close operation and sending signal in switch_logging
operation. Adding lock to serialize the two operations.

CRs-Fixed: 495063
Change-Id: I0064509c9ace18a8ff40c5a744363546a9021612
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
msm: rotator: Extend fast YUV invalid checker for 2-pass

For 2-pass mode, we need to check for the fast YUV constraints
separately for both the 1st and 2nd pass. Make change to extend
the fast YUV invalid checker to 2-pass mode.

CRs-fixed: 504007
Change-Id: I7ef96ff29423fbd5cc454e8fd125b4bb1a9d59e1
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_serial_hs: Rx discard flush timeout

While configuring the uart buadrate using set_termios
function, timeout is occuring for rx discard flush
operation. This is due to the driver is waiting for
less time for the DMA call back to occur after programing
the DMA register with the discard flush command.

To overcome this issue increased the timeout to 300ms.

Change-Id: I60db1f9eea8bb59fab4024e5f5dfcbcdcde253bb
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
msm: dcvs: fail gracefully if TZ does not support dcvs

If dcvs attempts to initialize on a system where TZ does not support
dcvs, it will eventually cause a crash. Prevent this by disabling
dcvs if TZ does not successfully initialize its part of dcvs.

Change-Id: Ic9cd361243c03c3832133614c4847a2815b0bbb4
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
radio-iris: Fix in the AF_LIST event handling

- Copying more than available size in AF list buffer which leads to crash.
- Added a check to avoid copy more than available size.

Change-Id: I8f00c6dd82e64ee2744bfad63ea4523b206732a6
CRs-Fixed: 498758
Signed-off-by: Venkateshwarlu Domakonda <Venkateshwarlu@codeaurora.org>
msm_fb: Fail fb2 open during suspend if ref_cnt is zero

Fail fb2 open during suspend if the ref_cnt for fb2 is zero
currently.

CRs-fixed: 475310
Change-Id: Ie5dd7c2dadecb489423cca1e2ff8276edc6314d7
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
mfd: wcd9xxx: Let system suspend and lock it later

When wcd9xxx codec receives IRQ, codec driver acquires suspend lock to
prevent system from entering suspend and waits until either system is
already awake or is awoken.
However if power management interface is already in the middle of calling
suspend chains, codec cannot lock suspend.
For this case, let the power management interface to proceed suspend and
make codec driver not to handle IRQ for now so unhandled IRQ would raise
shortly again.

Change-Id: Ia06394a890fe0c5fbde65d482d584346d167132a
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
tty: n_smux: After receiving OPEN_ACK flush tx_queue

If a local SMUX client re-opens the channel and tries to send data before
receiving the OPEN_ACK, the transaction will get stuck because the
channel local state is not OPENED.

Add the channel to ready list if tx_queue is not empty after receiving
the OPEN_ACK.

CRs-Fixed: 507379
Change-Id: I357b6edc340c404c890da0c415ed3aeba96dcfe8
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
cfg80211/nl80211: add API for MAC address ACLs

Add API to enable drivers to implement MAC address based
access control in AP/P2P GO mode. Capable drivers advertise
cfg80211/nl80211: add API for MAC address ACLs

Add API to enable drivers to implement MAC address based
access control in AP/P2P GO mode. Capable drivers advertise
this capability by setting the maximum number of MAC
addresses in such a list in wiphy->max_acl_mac_addrs.

An initial ACL may be given to the NL80211_CMD_START_AP
command and/or changed later with NL80211_CMD_SET_MAC_ACL.

Black- and whitelists are supported, but not simultaneously.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
[rewrite commit log, many cleanups]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 77765eaf5cfb6b8dd98ec8b54b411d74ff6095f1
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
CRs-fixed: 487410
Change-Id: Ib739f5c317e1433827370f24ab04ef798eca0d53
[duttus@codeaurora.org: resolved 3.4 backport issues]
Signed-off-by: Sunil Dutt <duttus@codeaurora.org>
radio: iris: Fix 64th character in  RDS RT field is missing

FM driver sends only upto 63 characters as Radio Text data
to upper layer.

Pass upto 64 characters as Radio Text

Change-Id: I3d49d85eb0c6e91ef0ea5660e572734a38281d62
CRs-Fixed: 505062
Signed-off-by: Ayaz Ahmad <aahmad@codeaurora.org>
msm: wfd: Pass proper ion buffer handle to video driver

This change gets ion handle corresponding to output
buffer and passes it to the video driver for ION
kernel mapping.

Change-Id: Ie6783f160029119f0df36f6d4a2e14c737b80edc
CRs-fixed: 508888
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: bam_dmux: trigger modem subsystem restart in case of timeout

If bam_dmux times out waiting for a power collapse protocol response from
the modem, bam_dmux assumes the modem has crashed and will disable itself
until the subsystem restart callback is triggered.

Change the behavior in bam_dmux to request that the modem subsystem
restarts regardless of its current state so that the restart callback is
always triggered.

CRs-Fixed: 495690
Change-Id: I076ab16dd727694feb68b9e9052b1b6a60a2b0ca
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
net: rmnet_usb: silence URB submission errors during disconnect

URB submissions will fail with -ENODEV while the device is being
disconnected.  The current code prints error message for an URB
submission failure.  If too many URBs are submitted during the
disconnect window, then target is crashing due to excessive
console logging.

CRs-Fixed: 507556
Change-Id: I287c5021bacb2238b62bf78a8ddf887f588b6f16
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
msm_fb: Avoid MDP mixer reset from ISR context

During DSI error interrupt handling, we currently try to do
MDP mixer reset. Avoid this since MDP clock control happens
in mixer reset which is not correct in ISR context. Schedule
a workqueue instead to call mixer reset as a separate thread.

CRs-fixed: 508882
Change-Id: Ie5471a01d79b4d8b67d8bb78647c407c35acae65
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
power: pm8921-bms: Fix SOC fluctuations at 100%

It is observed that the SOC can oscillate between 100-99-100
based on OCV updates after EOC (it is possible that there are
multiple varying OCV updates as the battery settles down).
Prevent this by avoiding the SOC to increase if it has dropped
and not charging.

While handling this scenario make sure that we do not scale
when soc = 100 and charging.

CRs-Fixed: 505132
Change-Id: Ie20c02d6df9407717c31e958b6b6f3e736325660
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
msm_fb: Make sure MDP clock is ON during register access

Change to make sure that MDP clock is ON while accessing
MDP fixed arbitration read and write selection
registers. This avoids target freeze due to unclocked
register access.

CRs-fixed: 505154
Change-Id: I1d2e654c7b97ca51e42611a5bd3aefd65421bcf4
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: kgsl: Don't hold process list global mutex in process private create

Don't hold process list global mutex for long. Instead make
use of process specific spin_lock() to serialize access
to process private structure while creating it. Holding
process list global mutex could lead to deadlocks as other
functions depend on it.

Change-Id: I4f60737393efa2001597f0222aa6fe19fb6a07c5
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
Signed-off-by: Ananta Kishore K <akollipa@codeaurora.org>
Merge of Sony 10.3.A.0.423 release

Change-Id: I5c885acecf38435ca8af96ca618e13d634e71cbe
Merge branch 'cm-10.1' of https://github.com/CyanogenMod/android_kernel_sony_apq8064 into phablet