thermal: qpnp-adc-tm: Check BTM channel index

Check for valid BTM channel index before accessing the
corresponding BTM channel elements.

Change-Id: I27f48793f5eb7a99e49fcc94a009230becf4fa22
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Merge "thermal: qpnp-adc-tm: Check BTM channel index"
usb: gadget: rndis: add flexibility to trigger RX via SysFS

Currently RNDIS/uether driver starts when usb cable is connected
and network interface is up. This might lead to DHCP pkt drop (very
initial packets from host/windows PC) if RNDIS bridges are not setup
appropriately in userspace. DHCP packet drop results in delayed IP
assignment.
Provide SysFS parameter to enable and trigger RX from
userspace.

Change-Id: Ib4516af124a5d6d7e87a9bb81166952fd7e8aa97
Signed-off-by: Amit Blay <ablay@codeaurora.org>
Merge "usb: gadget: rndis: add flexibility to trigger RX via SysFS"
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>
msm: Make CONFIG_STRICT_MEMORY_RWX even stricter

If CONFIG_STRICT_MEMORY_RWX was set, the first section (containing
the kernel page table and the initial code) and the section
containing the init code were both given RWX permission, which is
a potential security hole.

Pad the first section after the initial code (which will never
be executed when the MMU is on) to make the rest of the kernel
text start in the second section and make the first section RW.

Move some data which had ended up in the "init text"
section into the "init data" one, as this is RW, not RX.
Make the "init text" RX.

We will not free the section containing the "init text",
because if we do, the kernel will allocate memory for RW data there.

Change-Id: I6ca5f4e07342c374246f04a3fee18042fd47c33b
CRs-fixed: 513919
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
msm: scm: Add scm_call_noalloc and helper macros

Currently, scm_call internally calls kmalloc() to allocate a command
buffer structure. This prevents scm_call from working before kmalloc
structures are initialized or during atomic contexts. Allow clients
to pass in a pre-allocated buffer for scm_call to be used for internal
structures.

Change-Id: Id09500c8c696298228aefdcc2a61953e654677c9
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
arm: Add ARCH_RANDOM Kconfig

Some boards may support architecture generated random numbers. Add
the appropriate Kconfig.

Change-Id: I0077a982c9bb6d3a35435cc27fe40b7e0596ca84
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: implement ARCH_RANDOM

Currently, the software random number generator is not intialized
until relatively late in the boot process. Software that relies on
random numbers early will not be reliable. Entropy sources are
available early but not early enough for some use cases which means
that moving the software random number generation earlier is not an
option. As an alternate solution, implement the functions associated
with CONFIG_ARCH_RANDOM. These functions currently make a call into
trustzone to get reliable random numbers. The functions are disabled
once the regular random number generator is sufficiently reliable.

Change-Id: If40cfcb96b091fa26a28047c10a902287b26f6c1
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
init: Move stack canary initialization after setup_arch

Stack canary intialization involves getting a random number.
Getting this random number may involve accessing caches or other
architectural specific features which are not available until
after the architecture is setup. Move the stack canary initialization
later to accomodate this.

Change-Id: I00b564a2c3172229a44339c061fa380c17fe7d8e
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Merge "msm: scm: Add scm_call_noalloc and helper macros"
Merge "arm: Add ARCH_RANDOM Kconfig"
Merge "msm: implement ARCH_RANDOM"
Merge "init: Move stack canary initialization after setup_arch"
Merge "msm: Make CONFIG_STRICT_MEMORY_RWX even stricter"
Merge "ARM: 7527/1: uaccess: explicitly check __user pointer when !CPU_USE_DOMAINS"
msm: pil-q6v5-lpass: Remove disabling watchdog irq multiple times

Disabling watchdog irq twice requires enabling it an equal number
of times. Due to the watchdog irq being disabled twice while being
enabled only once; on watchdog bite happening muliple times, the
watchdog handler is not fired for the subsequent ones.

This change makes sure that this is rectified by disabling the
irq only once when the subsystem is shutdown during restart.

Change-Id: I58732e6a6d3d484bed53dc8198e8794eefd1b45c
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Signed-off-by: Devendra Patel <cdevenp@codeaurora.org>
Merge "msm: pil-q6v5-lpass: Remove disabling watchdog irq multiple times"
usb: gadget: mbim: Remove QBI block on usb cable disconnection

QBI is a user space module that transfers control packets between
USB and modem.

On USB cable disconnection QBI was blocked, and didn't receive a
notification on the cable disconnection, so QBI couldn't notify the modem
on this event as well. Once we connect the USB cable the QBI receive both
disconnect message and connect message and notify the modem. This can
result in a situation where QBI goes out of sync with the current state
of the system.

By this fix, we don't block the QBI on cable disconnection, so USB will
notify QBI on the disconnection allowing QBI to stay in sync with the
system state.

CRs-Fixed: 521610
Change-Id: I6779e94570bf8848307cc77355c96e485cd65e52
Signed-off-by: Bar Weiner <bweiner@codeaurora.org>
diag: Fix log, event and msg mask status in control packets

The status field in the logs, events and msg mask update control
packets is set incorrectly to a defaul t value. This patch adds
the correct status value in the control packet sent from Apps
to peripherals.

Change-Id: I7850db055b5c4aad0d3e6ffceb6411be03090091
CRs-Fixed: 524134
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>