mmc: core: Attribute the IO wait time properly in mmc_wait_for_req_done()

In mmc_wait_for_req_done() function, change the call wait_for_completion()
to wait_for_compltion_io(). This change makes the kernel account for
wait time as I/O wait and through another configuration, this io wait
is treated as busy which makes the acpu clock to scale up.

Change-Id: Iebdc7b1b22871bf845f10a55e2272816c72d9964
Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
net: usb: Using workqueue as bottom half handler

usbnet driver uses tasklet as bottom half handler. Since tasklet
runs in interrupt context in case of high throughput driver is
spending more time in interrupt context to process rx buffers
this is causing watch dog reset. Hence replace the tasklet with
workqueue to avoid watchdog reset.

CRs-Fixed: 378526
Change-Id: I8eac339e37d734dbaaf7a2e874d3974f562e8680
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
arm: arch_timer: export function to read physical counter

Since the arch_timer is a system-wide block, other hardware in an SoC
can make use of the counter values. Export a way to read the physical
counter for use by other drivers.

Change-Id: I0bcd95fa4cd7507c41ac608fc9740955d15d4b88
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
gpu: ion: Add dummy msm_ion header file

The msm specific parts of ion.h are being moved into a new header
file. For now, add a dummy header file to get clients transitioned
over.

Change-Id: Iac039678e1c3f15d87e67aa667f7e9883ca16669
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
USB: gadget: Fix memory leak in UASP function

The write buffer is allocated twice in bot_send_write_request
function.  Fix this by removing additional memory allocation.

Change-Id: I3253c149c3703621be30d0f84499d6af0aff8bc8
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: android: Add support for USB Target Function (UASP)

Add UASP function to Android supported functions array.  UASP
function depend on Target core.  Provide empty functions when
Target core is not enabled.

Change-Id: I959f26ebd63e036dae041708d0ad6169213a3cf0
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
msm: pcie: Disable secondary bus reset functionality

Setting the 'Secondary Bus Reset' bit in 'Bridge Control' register
of root complex port configuration space is causing the PCIE core to
reset due to hardware limitation. Discard any request to set this bit.

Change-Id: Iacad6ba8e8a49406428bf875901817f3f96fa24d
Signed-off-by: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
mm: cma: don't replace lowmem pages with highmem

The filesystem layer expects pages in the block device's mapping to not
be in highmem (the mapping's gfp mask is set in bdget()), but CMA can
currently replace lowmem pages with highmem pages, leading to crashes in
filesystem code such as the one below:

  Unable to handle kernel NULL pointer dereference at virtual address 00000400
  pgd = c0c98000
  [00000400] *pgd=00c91831, *pte=00000000, *ppte=00000000
  Internal error: Oops: 817 [#1] PREEMPT SMP ARM
  CPU: 0    Not tainted  (3.5.0-rc5+ #80)
  PC is at __memzero+0x24/0x80
  ...
  Process fsstress (pid: 323, stack limit = 0xc0cbc2f0)
  Backtrace:
  [<c010e3f0>] (ext4_getblk+0x0/0x180) from [<c010e58c>] (ext4_bread+0x1c/0x98)
  [<c010e570>] (ext4_bread+0x0/0x98) from [<c0117944>] (ext4_mkdir+0x160/0x3bc)
   r4:c15337f0
  [<c01177e4>] (ext4_mkdir+0x0/0x3bc) from [<c00c29e0>] (vfs_mkdir+0x8c/0x98)
  [<c00c2954>] (vfs_mkdir+0x0/0x98) from [<c00c2a60>] (sys_mkdirat+0x74/0xac)
   r6:00000000 r5:c152eb40 r4:000001ff r3:c14b43f0
  [<c00c29ec>] (sys_mkdirat+0x0/0xac) from [<c00c2ab8>] (sys_mkdir+0x20/0x24)
   r6:beccdcf0 r5:00074000 r4:beccdbbc
  [<c00c2a98>] (sys_mkdir+0x0/0x24) from [<c000e3c0>] (ret_fast_syscall+0x0/0x30)

Fix this by replacing only highmem pages with highmem.

Change-Id: I6af2d509af48b5a586037be14bd3593b3f269d95
Reported-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ASoC: msm: Update the AFE-PCM RX and TX dai link for mpq8064

In AFE-PCM RX and TX dai links of MPQ8064 machine driver there
was a conflict in codec dai name and codec name, with this ALSA
Framework is not creating the node in /dev/snd/

CRs-Fixed: 377509
Change-Id: I5337b216a3d0a2cdc36292ccdafe3e144e7f1d41
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
msm: ultrasound: support new devices, conflicting with the USF.

Some new TSC drivers advertise themselves by using
ABS_MT_POSITION_* bits instead of ABS_*.
This change supports TSC drivers, using
ABS_MT_POSITION_* and/or ABS_* bits.

Change-Id: I1134c0b25cef3d777896ca225b9214929e909d93
Signed-off-by: Baruch Eruchimovitch <baruche@codeaurora.org>
msm: camera: Fix memory leak with stats buffers

Buffer unprepare is not done while releasing stats buffers,
hence add support for buf unprepare ioctl

Change-Id: If4fa95c270363d1948b5924c2365785d1427e2f4
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
msm: 8064: Remove cpu dcvs governor from device list

8064 does not support the msm dcvs governor

Change-Id: I51d44cf7d3339127f86b736e0c9b7c18122830f2
CRs-Fixed: 363761
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
msm_fb: display: add out of range check for display sizes

MDP pipe or mixer size registers have 12-bit number, so boundary
checks are needed for those parameters. If not, input req sizes could
be very large 32 bit unsigned numbers, e.g. 0xffffffff, unsigned
operations may have overflow to pass all later checks, causing MDP
underruns or hang issues.

CRs-fixed: 380469
Change-Id: I096d7022ede21d54266b46a140782ab0348dd54b
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: camera: Add support for Bayer stats

Add support for Bayer stats

Change-Id: I69b408af91565581c925540bccb04708278bda05
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
mmc: msm_sdcc: Add support for card detect, write protect gpios

Add support for SD card insertion/removal detection and
write protect switch detection using gpio numbers passed
through device tree.

Change-Id: I63aed72f38f912b33de4b8eaedf72e52bbaeb4a0
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
msm: kgsl: Limit the number of indirect buffers per submission

Put a reasonable upper limit on the number of indirect buffers allowed
per submission via IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS.

CRs-Fixed: 380267
Change-Id: Ic0dedbadd78a0ad3f09f67660f34b2fba421007f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Do bounds checking on user supplied GPU addresses

Add bounds checking to kgsl_sharedmem_find_region to ensure that GPU
addresses supplied by the user via KGSL_IOCTL_SHAREMEM_FREE and
KGSL_IOCTL_CFF_SYNCMEM are within a valid range for the MMU scheme of
choice.

CRs-Fixed: 380296
Change-Id: Ic0dedbadf40fca4a9e04ba075e67e08e617806b5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: bam_dmux: add missing parameter to bam_dmux_log() call

bam_dmux_log() takes a formatted string and a variable argument list
similar to printf() and creates printf() style output to a private kfifo
log.  This change fixes a particular invocation of bam_dmux_log() which has
an invalid variable argument list for the formatted string used.  Depending
on system timing, this invocation could succeed as expected, or it could
cause a null pointer exception.

To prevent further issues, add the __printf() function attribute so that
the gcc compiler will check at compile time the arguments to bam_dmux_log()
for proper number and types according to printf() usage.

CRs-Fixed: 382037
Change-Id: I247ac3e83664385b9dc61a434049ca5c8bb60cd2
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Bluetooth: Avoid putting LE Conn into sniff/active

LE connections don't have sniff/active connection
mode, unlike BR/EDR. Make sure that the link which
has been requested to enter sniff/active mode is not
an LE connection.

CRs-fixed: 376972
Change-Id: Iec4714d1c2ea7621267f9064b7046eb9d5ff9462
Signed-off-by: Sunny Kapdi <sunnyk@codeaurora.org>
hwmon: qpnp-adc: Add PMIC QPNP VADC Driver

The QPNP VADC driver supports the User Bank Peripheral of
the voltage ADC(VADC).

VADC is a 15 bit ADC that measures signals through the
Main analog multiplexer (AMUX) and PREMUX. The driver
arbitrates the request to issue ADC read requests.

VADC driver includes support for the conversion sequencer.
The conversion sequencer is a HW triggered signal to start
ADC measurement on trigger events for PA ON,
camera flash and TX threshold.

The AMUX supports external pull-ups simultaneously. Clients
can select the appropriate AMUX input channel to measure the
ADC for the intended pull up configuration.

Change-Id: I8886968ccec54ad03334b113b4516d4d200e0da8
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>