ARM: 7528/1: uaccess: annotate [__]{get,put}_user functions with might_fault()

The user access functions may generate a fault, resulting in invocation
of a handler that may sleep.

This patch annotates the accessors with might_fault() so that we print a
warning if they are invoked from atomic context and help lockdep keep
track of mmap_sem.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ARM: warnings in arch/arm/include/asm/uaccess.h

On NOMMU ARM, the __addr_ok() and __range_ok() macros do not evaluate
their arguments, which may lead to harmless build warnings in some
code where the variables are not used otherwise. Adding a cast to void
gets rid of the warning and does not make any semantic changes.

Without this patch, building at91x40_defconfig results in:

fs/read_write.c: In function 'rw_copy_check_uvector':
fs/read_write.c:684:9: warning: unused variable 'buf' [-Wunused-variable]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ARM: 7836/1: add __get_user_unaligned/__put_user_unaligned

BTRFS is now relying on those since v3.12-rc1.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ARM: 7951/1: uaccess: use CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS

Now that we select HAVE_EFFICIENT_UNALIGNED_ACCESS for ARMv6+ CPUs,
replace the __LINUX_ARM_ARCH__ check in uaccess.h with the new symbol.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ARM: 8051/1: put_user: fix possible data corruption in put_user

According to arm procedure call standart r2 register is call-cloberred.
So after the result of x expression was put into r2 any following
function call in p may overwrite r2. To fix this, the result of p
expression must be saved to the temporary variable before the
assigment x expression to __r2.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
SOUND CONTROL: For LG G2 we need higher mic/speaker value!

So i have fixed value set by faux APP! and added mic/speaker
gain set for my ramdisk boot set!

it's simple logic, APP 0 value is = 24 for LG sound gain. :)

then all OK :)

by default i have set MIC gain to 30! no more other side hearing
problems.

loud and clear! :)
patch-3.4.92-93 using patch p1 <

+updates to l2cap_core.c manually.
msm: vidc: Increase I-frame period to INT_MAX

There is no restriction on I-frame and IDR period
values, so set them to INT_MAX.

Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: vidc: Print out the proper height and width in debugfs

The driver was printing out the width and height from the OUTPUT port by
default, which is controlled from the client.  If the client doesn't
know any better and sets a bogus width and height, we would mirror that
in debugfs.  The width and height on the CAPTURE port is something we
receive from Venus and is guaranteed to be correct.

Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
nl80211: Correct the usage of command NL80211_CMD_VENDOR

Assign/pass the cur_cmd_info parameter correctly. This fixes a
merge error when open source commit
ad7e718c9b4f717823fd920a0103f7b0fb06183f was pulled into the tree.

Signed-off-by: Sunil Dutt <usdutt@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: qdsp6v2: adding volume per dev-id

Add volume mixer control per device id for pcm use case.

Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm8974: Add VoWLAN dia link

Add VoWLAN dai link to the machine driver
to enable Voice over WLAN.

Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Correct wrong check conditions

1) For targets where micbias is shared, we do not
use vddio to identify special headset. We want
micbias to be enabled always with any headset
inserted for such targets. Currently, if headset is
inserted during recording, we check for this vddio
flag as well. Since, it is null for the above mentioned
targets, we never touch the code to enable micbias
always for any type of headset.

2) Again for the above mentioned targets, if micbias
is enabled by voice call, and we insert the headset.
Now if headset is removed, we try force diable of
micbias. This results in Tx mute. The count to disable
micbias needs to be corrected.

Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
[neo: Only required part.]
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: Configure correct gain on set Volume command

Output channel gain is product of per channel gain and master gain.
Hence if only per channel gain is set and master gain is set to 0
then no audio is heard at the output.
Ensure that if we change per channel gain then we set master gain
to unity and vice versa. This enables only one gain to be effective.

Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: qcom: qdsp6v2: Initialize locks before use

Spinlock crash issue is fixed with this patch. This patch
is to initialize the locks before it is used.

Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
arm: Add option to skip buffer zeroing

The DMA framework currently zeros all buffers because it (righfully so)
assumes that drivers will soon need to pass the memory to a device.
Some devices/use case may not require zeroed memory and there can
be an increase in performance if we skip the zeroing. Add a DMA_ATTR
to allow skipping of DMA zeroing.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Add support for memory limits

Currently, when dynamically placing regions CMA will allow the memory
to be placed anywhere, including highmem. Due to system restrictions,
regions may need to be placed in a smaller range. Add support to
devicetree to allow these regions to have an upper bound on where they
will be placed.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[skhiani@codeaurora.org: Resolve merge conflicts]
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Allow option to use strict memblock_reserved memory

Despite all the performance optimizations, some clients are
still unable to use CMA because of the allocation latency.
Rather than make those clients use a separate set of APIs,
extend the CMA code to allow clients to keep the memory out of
the buddy allocator. Since the pages never actually go to the
buddy allocator, allocation and freeing is only based on the bitmap
allocator to find the appropriate region.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm-camera: Reset ISPIF h/w

Reseting ISPIF hardware after ISPIF is stopped without frame
boundaries.Enabling all clocks for same.

Signed-off-by: Megha Tak <mtak@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm-camera: Adding lock and unlock methods for ISP subdev

Added lock mechanism to lock hardware update
when a sof is received, and ignore any other sof
which is received between the update process

Signed-off-by: Megha Tak <mtak@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>