staging: prima: merge of 3.2.6.103 (bf99077)

0358c4b wlan: wiphy->bands[] can be null.
f9927f5 wlan: GO should not follow STA channel if channel is passive.
d776d38 wlan:Block WiFi Direct GO mode on UNII-1 Band.
2c8c79d wlan: support active/passive scan selection via DRIVER command
4c59dde wlan: Enable TDLS for the drivers build as part of the kernel
daf0669 wlan:CCX:DUT TPC value is above AP's Max Tx power
69fbcc8 wlan: dump DXE registers on ERR interrupt
0057d7b wlan: Aborting scan while disconnect is in progress.
ca5d36f wlan: Vacate DFS channel if there is  no acivity within 10 sec.
45a358a Fix for making TDLS max peer count independent of IBSS
a743f52 Fix for the assert in hdd_rx_packet_cbk
fcab6ed Wlan: Fix for device not entering into BMPS mode
4fd1792 wlan : Revision 3.2.6.103

Change-Id: I3424f1420027f25f4726550397eb9edbbda24a42
staging: prima: merge of 3.2.6.106 (6968398)

e2f67ae wlan: driver version 3.2.6.106
6beb791 wlan: update sched_scan_results after cfg80211 resumed
32cd86a wlan: Return success while stoping sched scan.
65eaf0d wlan:Increase CSR_RSN_MAX_AUTH_SUITES to 16
4c59dde wlan: Enable TDLS for the drivers build as part of the kernel
45a358a Fix for making TDLS max peer count independent of IBSS
a743f52 Fix for the assert in hdd_rx_packet_cbk
fcab6ed Wlan: Fix for device not entering into BMPS mode

Change-Id: I7ce91f34d9a92f38b778fafbca9f35e5e1a942cc
ARM: 7527/1: uaccess: explicitly check __user pointer when !CPU_USE_DOMAINS

The {get,put}_user macros don't perform range checking on the provided
__user address when !CPU_HAS_DOMAINS.

This patch reworks the out-of-line assembly accessors to check the user
address against a specified limit, returning -EFAULT if is is out of
range.

[will: changed get_user register allocation to match put_user]
[rmk: fixed building on older ARM architectures]

CRs-Fixed: 504011
Change-Id: I3818045a136fcdf72deb1371b132e090fd7ed643
Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Git-commit: 8404663f81d212918ff85f493649a7991209fa04
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Slim_msm: Wait for reconfig sequence to complete

Wait for current reconfiguration to complete during
reconfigure_now sequnce. Earlier we are not waiting
for reconfiguration done interrupt after sending the
reconfiguration message to the slimus hardware. This
may lead to hardware synchronization issues in lower
slimbus clock frequencies.

In this patch we are waiting for the reconfiguration
done interrupt from slimbus hardware.

CRs-Fixed: 490022
Change-Id: If0126dac9a1ad2d931e9a0e345d19559fe36f67a
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
qseecom: fix memory leak in qseecom_start_app()

Fixes the incorrect reurn path in qseecom_start_app() function with
proper clean-up. With out this patch, there are lot of memory leaks.

Change-Id: Ib9f7b08dd86952c1b0a1572d9a7d81517c3b2189
CRs-fixed: 509111
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
qseecom: Fix error handling path in receive_req()

This patch fixes the error handling path in receive_req() function
called from userspace. Issue seen if user is calling the receive_req
function without calling the listener registration. qseecom_find_svc()
should return NULL if there are no services found.

Change-Id: Id51d8f48d7266b5acbc845f7b9ac0068d16b1ede
CRs-fixed: 496927
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
qseecom: Fix QSEECOM_IOCTL_UNLOAD_EXTERNAL_ELF_REQ kernel crash

Fixes the kernel crash occuring with IOCTL_UNLOAD_EXTERNAL_ELF_REQ
ioctl by adding unavailable client type to qseecom_client_handle_type
enum, which is required in the driver during qseecom_release().

Change-Id: I73b817255149ffc4a808852feb2954a0ba3c317f
CRs-fixed: 508253
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
qseecom: Add NULL pointer check in qseecom_ioctl

NULL pointer check is added to the qseecom driver in qseecom_ioctl,
which is required to validate the data pointer before executing any
other code from ioctl's.

Change-Id: I6fecf13769b4d7e94eebd4dc075a5ece79b18e1b
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
msm: ipc: IPC Router updates to support QMI in the kernel

1) Move the kernel interface APIs to a separate header file.
2) Use platform device to indicate the arrival/exit of service.
3) Add kernel APIs to send and receive messages through IPC Router.
4) Clean up unused Macros, enums, header inclusion.

Change-Id: I1541e9815d104f7ea46d19c10b57c77d967bd065
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
lib: qmi: Introduce QMI Encode/Decode library

Introduce Encode/Decode Library to perform QMI message marshaling.
The QMI Encode/Decode Library encodes the kernel C data structures into
QMI wire format and decodes the messages in QMI wire format into kernel
C structures.

Change-Id: Ib443e697dafedeac8a790de9a3a8ed4a8444082f
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Update the wakelock naming format for the local ports

Update the wakelock names to "ipc<local_port_id>_<port_owner>". This
enables easier identification of the wakelock owners.

Change-Id: Ife2bcbea5f4ab27269749123475065b6ec7b7f0b
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Add support for IPC Logging

Enhance IPC Router to log information pertaining to the messages
exchanged between user-space and other systems.

Change-Id: I8ef3e793a85bcdb14c69eb96278ce2ea8a47df96
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
msm: ipc: Add IPC Logging support to IPC Router

IPC Router to log debug & Router-to-Router messages onto the IPC Log
buffer. This will enable debugging the IPC Router initialization
issues and Router-to-Router communication issues, using debugfs without
logging to the kernel logs.

Change-Id: I90d968baf355f2f9abe95ea53d8b059781e8fbc6
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Change IPC log file name for IPC Router

Change the name of the files that contain the IPC log information
from the IPC Router. This change is done to reflect the module name
as a part of the IPC log file name.

Change-Id: I541aa5866251348b472eba6d1b3d1840500387f9
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
msm: ipc: Update recvmsg operation to be non-blocking by default

Update the IPC Router recvmsg operation to be non-blocking by default
and return 0 when there is no data to read.

CRs-Fixed: 464634
Change-Id: I1f43e3a36d72312372a3ac141d506c81a613c408
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc_router: Fix potential leaks and null dereferences

Added null pointer checks to avoid potential null pointer dereferences
and free statements to avoid potential memory leaks

Change-Id: I0553dfe6c61260a700a9dc6a411dcec6483e0eb8
Signed-off-by: Brent Hronik <bhronik@codeaurora.org>
msm: ipc: Pass RESUME_TX events to the endpoints

IPC Message Router blocks the endpoints from transmission if the transmit
message count for the destination endpoint reaches the quota count. This
will cause the asynchronous message transfer to block, which violates the
defintion of asynchronous behavior.

Return -EAGAIN when the transmit message count for the destination
endpoint reaches the quota count. In addition, after receiving the
resume_tx event from the remote endpoints notify all the local endpoints
that are waiting on the remote endpoint's resume_tx event.

CRs-Fixed: 473573
Change-Id: I82b49d268394bb8c064d88fd6a2799a5e9ec566f
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Do not broadcast remove client messages, if possible

Remove client message is broadcast to all subsystems within the system.
If a client has never communicated over any link, then do not send the
remove client message over any link. If a client has been communicating
only over a specific link, then send the remove client message only over
that link. If a client has been communicating over multiple links, then
broadcast the remove client message.

CRs-Fixed: 454809
Change-Id: I007c7f1ace66191ce9cbf0bad033381c4f3b750f
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Return -ENODEV when remote port is not found

Current implementation returns -ENOMEM when look up for a remote port
fails.

Return -ENODEV instead of -ENOMEM.

Change-Id: I7022e760631b3faaf7f1ba7952c8569905c4ee5a
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
msm: ipc: Check pointer validity before dereferencing it

Transport OPEN and CLOSE events are handled by dynamically allocating a
work. Check that the work item is properly allocated before dereferencing
it.

Change-Id: Icb73548f0747494791f14f9c8014f8effd4b844c
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>