msm: ADSPRPC: Fix offset for input and output buffers

The buffers being passed to remote processor did not have
the right offset into the IOMMU VA for cases where the offset
was greater than 4K.

Change-Id: I32360a337ecbb9ebe3d33e5a6d680b1033945641
Acked-by: Sathish Ambley <sambley@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Akhila Musunuri <makhila@codeaurora.org>
qseecom: Add boundary checks for offset within message.

Qseecom driver does not have boundary checks for offset within the
message. So this patch add checks to validate the offsets sent by
client to modify data within the command request message and it
should not exceed the memory allocated for that message.

Change-Id: I29bfbdc154eebb4f3f4bfbb31789562e37fa5886
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Mallikarjuna Reddy Amireddy <mamire@codeaurora.org>
msm: vidc: Fix race condition in power collapse sequence

There is a race condition if client queued an ETB between
RELEASE_RESOURCE (OCMEM) and PC_PREP commands in power
collapse sequence where the client will never receive
ETB_DONE because the clocks are already turned off.
Avoid the problem by counting the number of commands
queued to video hardware to skip power collapse sequence
if client queues any commands.

Change-Id: I0bb908e11308cfc4f8bdbdc01fd92dac67b78eac
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
diag: Handle spinlock correctly

Currently, if failure happens while writing data over to USB,
spinlock is not released. This leads to deadlock and kernel panic
which re-accessing it. This patch fixes that issue.

Change-Id: Ic34cfdb8c145329177b0b0ab0da9fb8b361196c9
Signed-off-by: Katish Paran <kparan@codeaurora.org>
USB: composite: Fix issue of get interface returning wrong altsetting

Currently composite driver will block and doesn't forward the set
interface with zero index vlaue after set configuration request.
This leads to returning wrong altsetting value for get interface
request from Host for interfaces that does support multiple
alternatesettings when host sends set interface with one followed
by set interface with zero index value after device is configured.
This could cause USB3.0 complaince test fail. Hence fix this value
by forwarding set interface request for interfaces that does
support mutliple altsettings.

CRs-Fixed: 747760
Change-Id: Ib82d4acc90f577308e18f0e0af1e616dbc8ce6a8
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
ASoC: update codec driver to handle new SSR design.

Update codec driver to reduce the time for wait to check Q6 core
is ready.

LNX.LA.3.7 Change-Id: I06f7124dda56bf867df32c3a03a63e1ee0e2bd94

Change-Id: I2067772e2cb66a1b7a59a84ccf072927580a38ee
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
ASoC: msm: qdsp6v2: handle VoIP call recovery during SSR

Add support for VoIP call auto recovery during Sub System Restart(SSR)

Change-Id: Ie8dce8f575ba3af5560c523a00e8520aef1c68c3
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
bacon/find7: add custom defconfig

Change-Id: Iea007941971e5c2d66ee572991653250daaa5f59
find7: sync defconfig with cm

Change-Id: Ie9b5dfeeee041f3006a7751076eaeb0185ceb7cf
defconfig: enable CIFS

Change-Id: I6525cff867843c5d0583e7401789c09bdb42df8f
bacon/find7: enable NETFILTER_XT_TARGET_IDLETIMER

Change-Id: Ifd23329d901461748381cdcd5dcc387f0147e6d4
Remove '+' symbol from kernel version string

Change-Id: I169942394a1a0bfd1b95b299168e95715cc3340b
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
lib/int_sqrt.c: optimize square root algorithm

Optimize the current version of the shift-and-subtract (hardware)
algorithm, described by John von Newmann[1] and Guy L Steele.

Iterating 1,000,000 times, perf shows for the current version:

 Performance counter stats for './sqrt-curr' (10 runs):

         27.170996 task-clock                #    0.979 CPUs utilized            ( +-  3.19% )
                 3 context-switches          #    0.103 K/sec                    ( +-  4.76% )
                 0 cpu-migrations            #    0.004 K/sec                    ( +-100.00% )
               104 page-faults               #    0.004 M/sec                    ( +-  0.16% )
        64,921,199 cycles                    #    2.389 GHz                      ( +-  0.03% )
        28,967,789 stalled-cycles-frontend   #   44.62% frontend cycles idle     ( +-  0.18% )
   <not supported> stalled-cycles-backend
       104,502,623 instructions              #    1.61  insns per cycle
                                             #    0.28  stalled cycles per insn  ( +-  0.00% )
        34,088,368 branches                  # 1254.587 M/sec                    ( +-  0.00% )
             4,901 branch-misses             #    0.01% of all branches          ( +-  1.32% )

       0.027763015 seconds time elapsed                                          ( +-  3.22% )

And for the new version:

Performance counter stats for './sqrt-new' (10 runs):

          0.496869 task-clock                #    0.519 CPUs utilized            ( +-  2.38% )
                 0 context-switches          #    0.000 K/sec
                 0 cpu-migrations            #    0.403 K/sec                    ( +-100.00% )
               104 page-faults               #    0.209 M/sec                    ( +-  0.15% )
           590,760 cycles                    #    1.189 GHz                      ( +-  2.35% )
           395,053 stalled-cycles-frontend   #   66.87% frontend cycles idle     ( +-  3.67% )
   <not supported> stalled-cycles-backend
           398,963 instructions              #    0.68  insns per cycle
                                             #    0.99  stalled cycles per insn  ( +-  0.39% )
            70,228 branches                  #  141.341 M/sec                    ( +-  0.36% )
             3,364 branch-misses             #    4.79% of all branches          ( +-  5.45% )

       0.000957440 seconds time elapsed                                          ( +-  2.42% )

Furthermore, this saves space in instruction text:

   text    data     bss     dec     hex filename
    111       0       0     111      6f lib/int_sqrt-baseline.o
     89       0       0      89      59 lib/int_sqrt.o

[1] http://en.wikipedia.org/wiki/First_Draft_of_a_Report_on_the_EDVAC

Change-Id: Ief93505d0084e916a349c3ef78978ca37b308997
Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Reviewed-by: Jonathan Gonzalez <jgonzlez@linets.cl>
Tested-by: Jonathan Gonzalez <jgonzlez@linets.cl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
zlib: clean up some dead code

Cleanup unused `if 0'-ed functions, which have been dead since 2006
(commits 87c2ce3b9305 ("lib/zlib*: cleanups") by Adrian Bunk and
4f3865fb57a0 ("zlib_inflate: Upgrade library code to a recent version")
by Richard Purdie):

 - zlib_deflateSetDictionary
 - zlib_deflateParams
 - zlib_deflateCopy
 - zlib_inflateSync
 - zlib_syncsearch
 - zlib_inflateSetDictionary
 - zlib_inflatePrime

Change-Id: Ia898f77f3b257d1dc5bf6ef316d8b67e2870f117
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
msm-of: Remove init macros to avoid "section mismatch" error during compilation

Change-Id: Ibcb0ffa9e11a200d866f11bf151a7705b2f3b343
Disable -fconserve-stack on ARM v2

There are reports that -fconserve-stack misaligns variables on the stack.
Disable it for ARM to work around this gcc bug.

v2: Move top level flags definition up

Change-Id: I4a3b058b7a50bc513580e695995f77cd721e1fb9
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
USB: storage: ene_ub6250: fix warning for the frame size

[-Wframe-larger-than=]

Change-Id: I19f9a88cfa151e932dab30ed6dd34f452340cb5b
ARM: 8165/1: alignment: don't break misaligned NEON load/store

The alignment fixup incorrectly decodes faulting ARM VLDn/VSTn
instructions (where the optional alignment hint is given but incorrect)
as LDR/STR, leading to register corruption. Detect these and correctly
treat them as unhandled, so that userspace gets the fault it expects.

Change-Id: I0848bac77eee63531cc5300fda38fbb9390e3193
Reported-by: Simon Hosie <simon.hosie@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: smp: Wait just 1 second for other CPU to halt

Currently, the busyloop waiting for a 2nd CPU to stop takes about 4
seconds.  Adjust for the overhead of the loop by looping every 1ms
instead of 1us.

Change-Id: Id9f158c94ff2712225e086b6c64cc816ddce7bee
Signed-off-by: Chris Fries <C.Fries@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/537864
SLT-Approved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
Reviewed-by: Russell Knize <rknize2@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
ARM: compressed/head.S: work around new binutils warning

In August 2012, Matthew Gretton-Dann checked a change
into binutils labelled "Error on obsolete & warn on
deprecated registers", apparently as part of ARMv8
support. Apparently, this was supposed to emit
the message "Warning: This coprocessor register access
is deprecated in ARMv8" when using certain mcr/mrc
instructions and building for ARMv8. Unfortunately,
the message that is actually emitted appears to be
'(null)', which is less helpful in comparison.

Even more unfortunately, this is biting us on
every single kernel build with a new gas, because
arch/arm/boot/compressed/head.S and some other files
in that directory are built with -march=all since
kernel commit 80cec14a8 "[ARM] Add -march=all to
assembly file build in arch/arm/boot/compressed"
back in v2.6.28.

This patch reverts Russell's nice solution and
replaces it with a more complex one that sprinkles
.arch statements inside of the head.S file in
functions that are executed in different architecture
levels, which seems to solve the original problem
just as well, and gets rid of the new one, too.

Without this patch, building anything results in:

arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:565: Warning: (null)
arch/arm/boot/compressed/head.S:676: Warning: (null)
arch/arm/boot/compressed/head.S:698: Warning: (null)
arch/arm/boot/compressed/head.S:722: Warning: (null)
arch/arm/boot/compressed/head.S:726: Warning: (null)
arch/arm/boot/compressed/head.S:957: Warning: (null)
arch/arm/boot/compressed/head.S:996: Warning: (null)
arch/arm/boot/compressed/head.S:997: Warning: (null)
arch/arm/boot/compressed/head.S:1027: Warning: (null)
arch/arm/boot/compressed/head.S:1035: Warning: (null)
arch/arm/boot/compressed/head.S:1046: Warning: (null)
arch/arm/boot/compressed/head.S:1060: Warning: (null)
arch/arm/boot/compressed/head.S:1092: Warning: (null)
arch/arm/boot/compressed/head.S:1094: Warning: (null)
arch/arm/boot/compressed/head.S:1095: Warning: (null)
arch/arm/boot/compressed/head.S:1102: Warning: (null)
arch/arm/boot/compressed/head.S:1134: Warning: (null)

Change-Id: If8a72743d8fb86663c546cac11aa5d14ee6fb76b
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Paul Beeler <sparksco@gmail.com>