Squashed commit of the following:

commit e36875879899997ebc7f937529d722a3d8c20730
Author: HandyMenny <handymenny@outlook.com>
Date:   Fri Dec 5 19:03:33 2014 +0100

    Samsung msm7x27: Update configs

    Change-Id: I62d52d12d3834a09d62d0815da3eead6e2578f85

commit 1f0f7d37002027fd397c881519d5dc7429f8e4ad
Author: androidmeda <hephappy@gmail.com>
Date:   Tue Jan 28 18:07:08 2014 +0200

    bluetooth: jb_mr1_chocolate -> jb_2.6

    Change-Id: Iff040d84e04bd57bf5979cc76a6580eeaffe47af

commit c5c1ff1b0b67ae8ed0f5f596f6604df88e500ef9
Author: Konsta <konsta09@gmail.com>
Date:   Sun Aug 4 09:42:36 2013 +0300

    netfilter: xt_qtaguid: update to msm-3.4

    AU_LINUX_ANDROID_JB_MR2.04.03.00.110.011

    Change-Id: I8912242c95270f21b0d21dc859c56f0d0342d8c0

commit 391a0f0af50cb0d1624520e02a2127b8e35c541a
Author: androidmeda <hephappy@gmail.com>
Date:   Fri Jan 24 01:47:38 2014 +0000

    zram & qcache & zsmalloc: update to LNX.LA.3.5.1-00710-8x26.0

    Change-Id: Icb5167e3d8d4149ad71282d17a9318c15c3879e3

commit e2a7354c93f8f63b798e177c35f8bd95de5ddc63
Author: Ajay Dudani <adudani@codeaurora.org>
Date:   Tue Sep 25 17:37:14 2012 -0700

    This is a combination of 2 commits.

    staging: android: lowmemorykiller: Add config option to support
oom_adj
    values

    The conversion to use oom_score_adj instead of the deprecated
oom_adj
    values breaks existing user-space code. Add a config option to
convert
    oom_adj values written to oom_score_adj values if they appear to be
    valid oom_adj values.

    Change-Id: I68308125059b802ee2991feefb07e9703bc48549
    Signed-off-by: Arve Hjønnevåg <arve@android.com>

    android/lowmemorykiller: Ignore tasks with freed mm

    A killed task can stay in the task list long after its
    memory has been returned to the system, therefore
    ignore any tasks whose mm struct has been freed.

    Change-Id: I76394b203b4ab2312437c839976f0ecb7b6dde4e
    CRs-fixed: 450383
    Signed-off-by: Liam Mark <lmark@codeaurora.org>

    Change-Id: I68308125059b802ee2991feefb07e9703bc48549

commit 23b116eafacc6f5e369cc87aac4d6e80ed960bcb
Author: Robin Humble <plaguedbypenguins@gmail.com>
Date:   Sat May 11 15:43:00 2013 +1000

    backport lowmemorykiller from CAF msm-3.4

    this improves low memory behaviour greatly due to accounting for
    lowmem_reserve as well as shmem pages.

    Change-Id: I1997d142f90afdc998f4bdf88808696bd2866394

commit c1f6b5af4953e5da51107bbef3089212f01f9c7a
Author: HandyMenny <handymenny@outlook.com>
Date:   Fri Nov 28 17:42:50 2014 +0100

    lib: updates and backports

    arm: remove "optimized" SHA1 routines

    Since commit 1eb19a12bd22 ("lib/sha1: use the git implementation of
    SHA-1"), the ARM SHA1 routines no longer work.  The reason? They
    depended on the larger 320-byte workspace, and now the sha1
workspace is
    just 16 words (64 bytes).  So the assembly version would overwrite
the
    stack randomly.

    The optimized asm version is also probably slower than the new
improved
    C version, so there's no reason to keep it around.  At least that
was
    the case in git, where what appears to be the same assembly language
    version was removed two years ago because the optimized C BLK_SHA1
code
    was faster.

    Reported-and-tested-by: Joachim Eastwood <manabian@gmail.com>
    Cc: Andreas Schwab <schwab@linux-m68k.org>
    Cc: Nicolas Pitre <nico@fluxnic.net>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    arm: remove stale export of 'sha_transform'

    The generic library code already exports the generic function, this
was
    left-over from the ARM-specific version that just got removed.

    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    lib/checksum.c: optimize do_csum a bit

    Reduce the number of variables modified by the loop in do_csum() by
1,
    which seems like a good idea.  On Nios II (a RISC CPU with 3-operand
    instruction set) it reduces the loop from 7 to 6 instructions,
including
    the conditional branch.

    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Signed-off-by: David S. Miller <davem@davemloft.net>

    lib/crc: add slice by 8 algorithm to crc32.c

    Add support for slice by 8 to existing crc32 algorithm.  Also modify
    gen_crc32table.c to only produce table entries that are actually
used.
    The parameters CRC_LE_BITS and CRC_BE_BITS determine the number of
bits in
    the input array that are processed during each step.  Generally the
more
    bits the faster the algorithm is but the more table data required.

    Using an x86_64 Opteron machine running at 2100MHz the following
table was
    collected with a pre-warmed cache by computing the crc 1000 times on
a
    buffer of 4096 bytes.

    BITS Size LE Cycles/byte BE Cycles/byte
    ----------------------------------------------
    1 873 41.65 34.60
    2 1097 25.43 29.61
    4 1057 13.29 15.28
    8 2913 7.13 8.19
    32 9684 2.80 2.82
    64 18178 1.53 1.53

    BITS is the value of CRC_LE_BITS or CRC_BE_BITS. The old
    default was 8 which actually selected the 32 bit algorithm. In
    this version the value 8 is used to select the standard
    8 bit algorithm and two new values: 32 and 64 are introduced
    to select the slice by 4 and slice by 8 algorithms respectively.

    Where Size is the size of crc32.o's text segment which includes
    code and table data when both LE and BE versions are set to BITS.

    The current version of crc32.c by default uses the slice by 4
algorithm
    which requires about 2.8 cycles per byte.  The slice by 8 algorithm
is
    roughly 2X faster and enables packet processing at over 1GB/sec on a
    typical 2-3GHz system.

    Signed-off-by: Bob Pearson <rpearson@systemfabricworks.com>
    Cc: Roland Dreier <roland@kernel.org>
    Cc: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

    lib/crc: Update slice by 8 algorithm for crc32, and add to crc32c

    lib/sha1: use the git implementation of SHA-1

    For ChromiumOS, we use SHA-1 to verify the integrity of the root
    filesystem.  The speed of the kernel sha-1 implementation has a
major
    impact on our boot performance.

    To improve boot performance, we investigated using the heavily
optimized
    sha-1 implementation used in git.  With the git sha-1
implementation, we
    see a 11.7% improvement in boot time.

    10 reboots, remove slowest/fastest.

    Before:

      Mean: 6.58 seconds Stdev: 0.14

    After (with git sha-1, this patch):

      Mean: 5.89 seconds Stdev: 0.07

    The other cool thing about the git SHA-1 implementation is that it
only
    needs 64 bytes of stack for the workspace while the original kernel
    implementation needed 320 bytes.

    Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
    Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Cc: Nicolas Pitre <nico@cam.org>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Cc: David S. Miller <davem@davemloft.net>
    Cc: linux-crypto@vger.kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

     arm/crypto: Add optimized AES and SHA1 routines

    Add assembler versions of AES and SHA1 for ARM platforms.  This has
provided
    up to a 50% improvement in IPsec/TCP throughout for tunnels using
AES128/SHA1.

    Platform   CPU SPeed    Endian   Before (bps)   After (bps)
Improvement

    IXP425      533 MHz      big     11217042        15566294
~38%
    KS8695      166 MHz     little    3828549         5795373
~51%

    Change-Id: I9a0d2792587c9743fd288d0caaa6d098963b1a1b
    Signed-off-by: David McCullough <ucdevel@gmail.com>

commit 08765eef0b0980458b41fe9aad3d34805a55776b
Author: HandyMenny <handymenny@outlook.com>
Date:   Fri Nov 28 16:35:32 2014 +0100

    I/O: updates and backports

    Input: Make sure we follow all EV_KEY events

    For some EV_KEY types, sending a larger-than-one value causes the
    input state to oscillate. This patch makes sure this cannot happen,
    clearing up the autorepeat bypass logic in the process.

    Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
    Tested-by: Ping Cheng <pingc@wacom.com>
    Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>

    Input: Move autorepeat to the event-passing phase

    Preparing to split event filtering and event passing, move the
    autorepeat function to the point where the event is actually passed.

    Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
    Tested-by: Ping Cheng <pingc@wacom.com>
    Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>

    Input: Send events one packet at a time

    On heavy event loads, such as a multitouch driver, the irqsoff
latency
    can be as high as 250 us.  By accumulating a frame worth of data
    before passing it on, the latency can be dramatically reduced.  As a
    side effect, the special EV_SYN handling can be removed, since the
    frame is now atomic.

    This patch adds the events() handler callback and uses it if it
    exists. The latency is improved by 50 us even without the callback.

    Cc: Daniel Kurtz <djkurtz@chromium.org>
    Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
    Tested-by: Ping Cheng <pingc@wacom.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
    Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>

    Input: Improve the events-per-packet estimate

    The events-per-packet estimate has so far been used by MT devices
    only. This patch adjusts the packet buffer size to also accomodate
the
    KEY and MSC events.  Keyboards normally send one or two keys at a
    time. MT devices normally send a number of button keys along with
the
    MT information.  The buffer size chosen here covers those cases, and
    matches the default buffer size in evdev. Since the input estimate
is
    now preferred, remove the special input-mt estimate.

    Reviewed-and-tested-by: Ping Cheng <pingc@wacom.com>
    Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
    Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>

    softirq: reduce latencies

    Date	Thu, 03 Jan 2013 23:49:40 -0800

    In various network workloads, __do_softirq() latencies can be up
    to 20 ms if HZ=1000, and 200 ms if HZ=100.

    This is because we iterate 10 times in the softirq dispatcher,
    and some actions can consume a lot of cycles.

    This patch changes the fallback to ksoftirqd condition to :

    - A time limit of 2 ms.
    - need_resched() being set on current task

    When one of this condition is met, we wakeup ksoftirqd for further
    softirq processing if we still have pending softirqs.

    Using need_resched() as the only condition can trigger RCU stalls,
    as we can keep BH disabled for too long.

    I ran several benchmarks and got no significant difference in
    throughput, but a very significant reduction of latencies (one order
    of magnitude) :

    In following bench, 200 antagonist "netperf -t TCP_RR" are started
in
    background, using all available cpus.

    Then we start one "netperf -t TCP_RR", bound to the cpu handling the
NIC
    IRQ (hard+soft)

    Before patch :

RT_LATENCY,MIN_LATENCY,MAX_LATENCY,P50_LATENCY,P90_LATENCY,P99_LATENCY,MEAN_LATENCY,STDDEV_LATENCY
    MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0
AF_INET
    to 7.7.7.84 () port 0 AF_INET : first burst 0 : cpu bind
    RT_LATENCY=550110.424
    MIN_LATENCY=146858
    MAX_LATENCY=997109
    P50_LATENCY=305000
    P90_LATENCY=550000
    P99_LATENCY=710000
    MEAN_LATENCY=376989.12
    STDDEV_LATENCY=184046.92
    After patch :

RT_LATENCY,MIN_LATENCY,MAX_LATENCY,P50_LATENCY,P90_LATENCY,P99_LATENCY,MEAN_LATENCY,STDDEV_LATENCY
    MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0
AF_INET
    to 7.7.7.84 () port 0 AF_INET : first burst 0 : cpu bind
    RT_LATENCY=40545.492
    MIN_LATENCY=9834
    MAX_LATENCY=78366
    P50_LATENCY=33583
    P90_LATENCY=59000
    P99_LATENCY=69000
    MEAN_LATENCY=38364.67
    STDDEV_LATENCY=12865.26

    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: David Miller <davem@davemloft.net>
    Cc: Tom Herbert <therbert@google.com>
    Cc: Ben Hutchings <bhutchings@solarflare.com>

    fs: vfat: reduce the worst case latencies

    When a block partition is mounted with FAT file system
    and MS_DIRSYNC option is used, some file system operations
    like create, rename shall sleep in caller's context until
    all the metadata have been committed to the non-volatile memory.
    Since this operation is blocking call for user context,
    the WRITE_SYNC option must be used instead of WRITE
    (async operation) which incur inherent latencies while
    flushing the meta-data corresponding to directory entries

    Change-Id: I41c514889873a39d564271db0a421e6c66e5ae33
    Signed-off-by: xiaogang <xiaogang@codeaurora.org>

    mmc: msm_sdcc: Remove unnecessary delay in interrupt context

    msmsdcc_request_end when called with interrupts disabled inside an
    interrupt handler adds an unnecessary 5ms delay on command timeouts,
    which impacts system performance. Remove this delay.

    Change-Id: I90aec109fe84f7b9f9a9362b5ee2d8d1310833af
    Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>

    fs/sync: Make sync() satisfy many requests with one invocation

    Dave Jones reported RCU stalls, overly long hrtimer interrupts, and
    amazingly long NMI handlers from a trinity-induced workload
involving
    lots of concurrent sync() calls
(https://lkml.org/lkml/2013/7/23/369).
    There are any number of things that one might do to make sync()
behave
    better under high levels of contention, but it is also the case that
    multiple concurrent sync() system calls can be satisfied by a single
    sys_sync() invocation.

    Given that this situation is reminiscent of rcu_barrier(), this
commit
    applies the rcu_barrier() approach to sys_sync().  This approach
uses
    a global mutex and a sequence counter.  The mutex is held across the
    sync() operation, which eliminates contention between concurrent
sync()
    operations.  The counter is incremented at the beginning and end of
    each sync() operation, so that it is odd while a sync() operation is
in
    progress and even otherwise, just like sequence locks.

    The code that used to be in sys_sync() is now in do_sync(), and
sys_sync()
    now handles the concurrency.  The sys_sync() function first takes a
    snapshot of the counter, then acquires the mutex, and then takes
another
    snapshot of the counter.  If the values of the two snapshots
indicate that
    a full do_sync() executed during the mutex acquisition, the
sys_sync()
    function releases the mutex and returns ("Our work is done!").
Otherwise,
    sys_sync() increments the counter, invokes do_sync(), and increments
    the counter again.

    This approach allows a single call to do_sync() to satisfy an
arbitrarily
    large number of sync() system calls, which should eliminate issues
due
    to large numbers of concurrent invocations of the sync() system
call.

    Changes since v1 (https://lkml.org/lkml/2013/7/24/683):

    o	Add a pair of memory barriers to keep the increments from
    	bleeding into the do_sync() code.  (The failure probability
    	is insanely low, but when you have several hundred million
    	devices running Linux, you can expect several hundred
instances
    	of one-in-a-million failures.)

    o	Actually CC some people who have experience in this area.

    Reported-by: Dave Jones <davej@redhat.com>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Jan Kara <jack@suse.cz>
    Cc: Curt Wohlgemuth <curtw@google.com>
    Cc: Jens Axboe <jaxboe@fusionio.com>
    Cc: linux-fsdevel@vger.kernel.org

    Signed-off-by: Paul Reioux <reioux@gmail.com>

    mmc: core: export mmc_host_may_gate_card function

    MMC Host driver might want to use the mmc_host_may_gate_card() API
    to know whether the clock can be gated to the card or not hence
    export this function for usage outside its current scope.

    Change-Id: I9ec4173063e2505eca179161cdf8cda033a3fd4b
    Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>

    mmc: msm_sdcc: fix clock gating handling using pwrsave control bit

    SDCC controller provides the PWRSAVE control bit to automatically
    disable the clock to card when there is no activity with card. SDCC
    host controller driver always enables this feature but few SDIO
    cards may require the clocks to be always running (even during
    inactivity period) to raise the interrupt notification to host so
    for such cards, enabling PWRSAVE fature may cause functional
failures.

    This change checks whether it is ok to gate the card clock before
    enabling the PWRSAVE feature.

    Change-Id: If36a6a20d59aeb555ece2a6959ab5407f90c787c
    Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>

    mmc: msm_sdcc: fix pwrsave bit handling

    SDCC controller provides the PWRSAVE control bit to automatically
    disable the clock to card when there is no activity with card.
    SDCC driver provides the compile time option to disable this pwrsave
    feature completely but some of the recent driver changes ignore this
    and may enable the pwrsave feature even when its not required. This
    change ensures that we always check if the pwrsave is allowed or not
    before really enabling it.

    CRs-Fixed: 490017
    Change-Id: Ica764565745ea0b54300e38157c58c0aa643291d
    Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>

    Conflicts:
    	drivers/mmc/host/msm_sdcc.c

    writeback: Fix occasional slow sync(1)

    In case when system contains no dirty pages,
wakeup_flusher_threads()
    will submit WB_SYNC_NONE writeback for 0 pages so wb_writeback()
exits
    immediately without doing anything. Thus sync(1) will write all the
    dirty inodes from a WB_SYNC_ALL writeback pass which is slow.

    Fix the problem by using get_nr_dirty_pages() in
    wakeup_flusher_threads() instead of calculating number of dirty
pages
    manually. That function also takes number of dirty inodes into
account.

    CC: stable@vger.kernel.org
    Reported-by: Paul Taysom <taysom@chromium.org>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Cristoforo Cataldo <cristoforo.cataldo@gmail.com>

    Asynchronous I/O latency to a solid-state disk greatly increased

    between the 2.6.32 and 3.0 kernels. By removing the plug from
    do_io_submit(), we observed a 34% improvement in the I/O latency.

    Unfortunately, at this level, we don't know if the request is to
    a rotating disk or not.

    jiffies conversions: Use compile time constants when possible

    Date	Fri, 04 Jan 2013 13:15:43 -0800

    Do the multiplications and divisions at compile time
    instead of runtime when the converted value is a constant.

    Make the calculation functions static __always_inline to jiffies.h.

    Add #defines with __builtin_constant_p to test and use the
    static inline or the runtime functions as appropriate.

    Prefix the old exported symbols/functions with __

    usb: gadget: mass_storage: added sysfs entry for cdrom to LUNs

    This patch adds a "cdrom" sysfs entry for each mass_storage LUN,
just
    like "ro" sysfs entry. This allows switching between USB and CD-ROM
    emulation without reinserting the module or recompiling the kernel.

    Change-Id: Idf83c74815b1ad370428ab9d3e5503d5f7bcd3b6

    mm: remove compressed copy from zram in-memory

    Swap subsystem does lazy swap slot free with expecting the page
would be
    swapped out again so we can avoid unnecessary write.

    But the problem in in-memory swap(ex, zram) is that it consumes
memory
    space until vm_swap_full(ie, used half of all of swap device)
condition
    meet.  It could be bad if we use multiple swap device, small in-
memory
    swap and big storage swap or in-memory swap alone.

    This patch makes swap subsystem free swap slot as soon as swap-read
is
    completed and make the swapcache page dirty so the page should be
    written out the swap device to reclaim it.  It means we never lose
it.

    I tested this patch with kernel compile workload.

    1. before

       compile time : 9882.42
       zram max wasted space by fragmentation: 13471881 byte
       memory space consumed by zram: 174227456 byte
       the number of slot free notify: 206684

    2. after

       compile time : 9653.90
       zram max wasted space by fragmentation: 11805932 byte
       memory space consumed by zram: 154001408 byte
       the number of slot free notify: 426972

    [akpm@linux-foundation.org: tweak comment text]
    [artem.savkov@gmail.com: fix BUG due to non-swapcache pages in
end_swap_bio_read()]
    [akpm@linux-foundation.org: invert unlikely() test, augment comment,
80-col cleanup]
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Signed-off-by: Minchan Kim <minchan@kernel.org>
    Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
    Cc: Nitin Gupta <ngupta@vflare.org>
    Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
    Cc: Shaohua Li <shli@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    Conflicts:
    	mm/page_io.c

    Change-Id: I8f11fb7f0391954435002e7f290352f311c907d4

    mmc: Make sure host is disabled on suspend

    Change-Id: Ie0bf2004e173cef8dad66722a152658d7727ab65
    Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

    PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()

    Use the observation that it is more efficient to check the wakeup
    variable once before the loop reporting tasks that were not
    frozen in try_to_freeze_tasks() than to do that in every step of
that
    loop.

    Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

    Conflicts:

    	kernel/power/process.c

    Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
    (cherry picked from commit a15cc22b56b803b8f943c57d9535bdb9953ff3ec)

    Change-Id: Ic41cd71a0ec49cd0c633c14aa3fce02025a4de3f
    Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>

    USB: msm72k_udc: Don't handle asynchronous interrupt

    USB enter low power mode after detecting the wall charger. When
    wall-charger is disconnected, USB hardware generate asynchronous
interrupt
    for notifying B-Session Valid low condition. OTG and UDC share the
same
    interrupt line. The OTG interrupt handler is called first and it
disable
    the IRQ and schedule the resume work. As the interrupt is received,
    the kernel will invoke all shared interrupt handlers though the IRQ
is
    disabled by the first handler.

    The UDC interrupt handler is accessing USB registers before clocks
are
    turned on. Avoid unclocked access by ignoring the asynchronous
interrupt.

    CRs-Fixed: 442012
    Change-Id: I58c6a6e192ce274ab265b5d7c8d95ad84dc55efd
    Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>

    msm: timer: Don't check state of clock while setting next timer
event

    The commit fd6681cd4d0782f6e6ac918ab337016f59c2520b introduced
    a silent bug that incorrectly checks state of the clock while
    setting the next timer event. The bug manifests only during
    failure code path of msm idle operation, which is very rare.
    Due to the bug, the driver isn't be able to reprogram the timer
    device.

    CRs-fixed: 468902
    Change-Id: I4ec14ea9c3a5d318ef98d2b13bd55efd89538df5
    Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>

    mmc: msm_sdcc: fix a type mismatch in msmsdccc_config_dma()

    msmsdcc_prep_xfer() function returns a signed integer value but
    caller function msmsdcc_config_dma() is storing this value in an
unsigned
    integer variable which is obviously not the correct thing to do.

    CRs-Fixed: 476578
    Change-Id: I8f11fb7f0391954435002e7f290352f311c907d4
    Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>

commit 2365e749c690c655d7d8cbc19c8a92baa0eb0110
Author: HandyMenny <handymenny@outlook.com>
Date:   Fri Dec 21 17:44:36 2012 -0800

    cpufreq: update ondemand and interactive

    cpufreq: interactive: sync android-3.0 with android-3.4

    Change-Id: I71443db4edbe43a08fe58a54a742b4c788ef11e3
    Signed-off-by: Todd Poynor <toddpoynor@google.com>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: Add cpu utilization statistics to aid decisions made by
userspace.

    Understanding system load as seen by cpufreq can help userspace
    algorithms make better decisions to improve system responsiveness.
    One such example would be the MP decision algorithm which mines
    various system info to make decisions on hotplugging in/out
    the additional cores.

    CRs-fixed: 344675
    Signed-off-by: Anitha Anand <anithas@codeaurora.org>
    (cherry picked from commit cbeef6aafc4964c4a6cfafd26b23eaccd40804b4)

    Change-Id: I7b4450ed7b3bf8196870717e1907fd93c5cfbe98
    Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>

    cpufreq: Add a boostpulse interface to ondemand
    For applications that require a one-shot increase in frequency,
    the boostpulse interface would help to scale to max for the time
    specified in boostime. This helps applications that currently
    increases scaling_min_freq and resets later after a fixed duration.
    Instead of changing scaling_min_freq applications can directly write
    to boostpulse and governer resets during regular timer after the
time
    expires.

    Change-Id: Ie5f490ff06b41364aa76dd468573433495da28a4
    Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>

    [CPUFREQ] CPUfreq ondemand: update sampling rate without waiting for
next sampling

    When a new sampling rate is shorter than the current one, (e.g., 1
sec
    --> 10 ms) regardless how short the new one is, the current ondemand
    mechanism wait for the previously set timer to be expired.

    For example, if the user has just expressed that the sampling rate
    should be 10 ms from now and the previous was 1000 ms, the new rate
may
    become effective 999 ms later, which could be not acceptable for the
    user if the user has intended to speed up sampling because the
system is
    expected to react to CPU load fluctuation quickly from __now__.

    In order to address this issue, we need to cancel the previously set
    timer (schedule_delayed_work) and reset the timer if resetting timer
is
    expected to trigger the delayed_work ealier.

    Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
    Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
    Signed-off-by: Dave Jones <davej@redhat.com>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    Conflicts:
    	drivers/cpufreq/cpufreq_ondemand.c

    msm: cpufreq: Fix the race between dbs_refresh and hotplug.

    The demand based switching responds to input events and schedules
    work items on all online cpus to increase the frequency. This will
    call the dbs_refresh_callback on respective cpu. If this work item
    kicks in while cpu1 is progressing its way through cpufreq_add_dev,
    there is a chance that work item grabs the cpu_policy_rwsem of cpu1
    and relases that of cpu0, when add device is working through releas-
    ing lock of cpu1 and reaquiring that of cpu0. This is locking out
    cpu1 when it tries to come up online next time. The fix is hold the
    hot plug lock while processing refresh work items.

    CRs-Fixed: 362444
    Change-Id: I57db7c7a9b58369bf059302896f3bf9eca2bc2bb
    Signed-off-by: Krishna Vanka <kvanka@codeaurora.org>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: Fix panic when setting sampling rate

    Kernel panics when trying to set the sampling rate before the
ondemand
    governor CPUFREQ_GOV_START notification is received.

    [<c078e500>] panic+0x15c
    [<c0012354>] die+0x19c
    [<c0018e60>] __do_kernel_fault+0x64
    [<c0793660>] do_page_fault+0x3b8
    [<c0008514>] do_DataAbort+0x134
    [<c0791c58>] __dabt_svc+0x38
    [<c02b5c68>] __list_add+0x38
    [<c078f1b0>] __mutex_lock_slowpath+0x128
    [<c078fc68>] mutex_lock+0x20
    [<c05409c4>] store_sampling_rate+0x98
    [<c02a6648>] kobj_attr_store+0x18
    [<c0183124>] sysfs_write_file+0x108
    [<c0131758>] vfs_write+0xac
    [<c013188c>] sys_write+0x3c
    [<c000e340>] ret_fast_syscall+0x0

    Initialize the mutex as part of cpufreq_gov_dbs_init().

    Change-Id: Ie9014407d724d7a0a81c076be47df5d08f513407
    Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: Add a boostpulse interface to ondemand

    For applications that require a one-shot increase in frequency,
    the boostpulse interface would help to scale to max for the time
    specified in boostime. This helps applications that currently
    increases scaling_min_freq and resets later after a fixed duration.
    Instead of changing scaling_min_freq applications can directly write
    to boostpulse and governer resets during regular timer after the
time
    expires.

    Change-Id: Ie5f490ff06b41364aa76dd468573433495da28a4
    Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: fix utilization statistics for sync cpus

    If the cpus are using related_cpus policy, then the
    current implementaion will overwrite the the calculated
    load for every iteration in the for loop. Hence, mpdecision
    will read incorrect value, if the cores are using related
    cpus policy. With this change mpdecision will read the
    sum of the loads of all cpu's, if related cpu policy is
    used.

    Change-Id: I242c8fe39fd75dc3e48750a5b78a5d218b536ddd
    Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
    Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: notify avg load for short sampling_rate

    If the sampling rate is less than 50ms reporting
    the actual load may lead to poor decision making
    at user space. So, for sampling rates less than 50ms
    report the average of load across two samples.

    Change-Id: I0d1cf00801732bee8e4380158d7e892758226594
    Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: boost the sampling rate on touch event

    For better Ux responsiveness ondemand sampling rate
    needs to be 20ms. But, a 20ms sampling rate increases power
    consumption. So, boost the sampling rate to 20ms on every
    touch event for 2.5 ms and later reset to default rate.
    Also, change sampling down factor proportional to the
    sampling rate.

    Change-Id: I111b1cf3b8ed133347149afc34d329d0384ecfcb
    Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: ondemand: Fix the boostpulse interface

      * Boostpulse was not working because no default frequency was set.
      * We don't need an input handler to push the freq to max,
userspace
        does a better job with the Power HAL.
      * Tweak boost time to 500ms

    Change-Id: Ice8c26b758747d265976263296a2da3380b864f7
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: interactive: allow arbitrary speed / delay mappings

    Accept a string of delays and speeds at which to apply the delay
before
    raising each step above hispeed. For example, "80000 1300000:200000
    1500000:40000" means that the delay at or above 1GHz, until 1.3GHz
is 80 msecs,
    the delay until 1.5GHz is 200 msecs and the delay at or above 1.5GHz
is 40
    msecs when hispeed_freq is 1GHz.

    [toddpoynor@google.com: add documentation]
    Change-Id: Ifeebede8b1acbdd0a53e5c6916bccbf764dc854f
    Signed-off-by: Minsung Kim <ms925.kim@samsung.com>

    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: interactive: fix crash on error paths in get_tokenized_data

    Use separate variable for error code, free proper pointer.

    Change-Id: Ia83cccb195997789ac6afbf5b8761f7b278196d6
    Reported-by: Arve Hjønnevåg <arve@android.com>
    Signed-off-by: Todd Poynor <toddpoynor@google.com>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: interactive: base above_hispeed_delay on target freq, not
current

    Time to wait should be based on the intended target speed, not the
    actual speed (which may be held high by another CPU).

    Change-Id: Ifc5bb55d06adddb9a02af90af05398a78f282272
    Reported-by: Arve Hjønnevåg <arve@android.com>
    Signed-off-by: Todd Poynor <toddpoynor@google.com>
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: interactive: Fix uninitialized spinlock

    Change-Id: I9959669e0f643ccd2bd1072fae440d8c20f1c9cc
    Signed-off-by: nobodyAtall <tsogkas@ceid.upatras.gr>

    cpufreq: interactive: reduce chance of zero time delta on load eval

    Reschedule load sampling timer after timestamp of sample start
taken,
    hold spinlock across entire sequence to avoid preemption.  Avoid the
    WARN for zero time delta in the load sampling timer function.

    Change-Id: Idc10a756f09141decb6df92669521a1ebf0dbc10
    Signed-off-by: Todd Poynor <toddpoynor@google.com>

    cpufreq: interactive: avoid underflow on active time calculation

    Check for idle time delta less than elapsed time delta, avoid
    underflow computing active time.

    Change-Id: I3e4c6ef1ad794eec49ed379c0c50fa727fd6ad28
    Signed-off-by: Minsung Kim <ms925.kim@samsung.com>

    cpufreq: interactive: fix race on cpufreq TRANSITION notifier

    The cpufreq TRANSTION notifier callback does not check the
    governor_enabled state on affected CPUS, which will case
    kernel panic in update_load because the policy object maybe
    NULL or invalid when governor_enabled is false.

    Change-Id: Ie0f1718124f61e2f9b5da57abc6981ada5b83908
    Signed-off-by: Lianwei Wang <a22439@motorola.com>

    cpufreq: interactive: fix show_target_loads and
show_above_hispeed_delay

    Remove a trailing whitespace from target_loads and
above_hispeed_delay. Problem
    happens when user-space program tried to restore parameters that
saved before
    changing parameters. In this case was returned error(EINVAL).

    Change-Id: I5a74e3824602cd6f2b74651adda5ec1b627e61e9
    Signed-off-by: Minsung Kim <ms925.kim@samsung.com>

    cpufreq: interactive: Allow 1 ms error in above_hispeed_delay
comparisons

    Allow for an error of 1 ms while taking into account
    above_hispeed_delay for a frequency

    Change-Id: I744e44387152e4efb5978df4f2b9533bf79d4582
    Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>

    cpufreq: interactive: Reset floor_validate_time if busy at max for
100ms

    When the interactive governor selects to run at max frequency it
doesn't
    re-schedule the timer until it hits an idle. This change checks if
the CPU
    has been continuously busy for last 100ms on hitting an idle start.
If yes,
    then floor_validate_time is reset so that the CPU stays at max
frequency
    for at least another 100 ms before stepping down.
    This is an important feature for detecting CPU intensive workloads
which
    require high frequencies for achieving better performance.

    Change-Id: I7d48ffbc3d50a80af9be3bf94667ee3d0120b763
    Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>

    cpufreq: interactive: fix compiling warnings

    The gcc warns like:

      cpufreq_interactive.c:745:6: warning: operation on 'ret' may be
    undefined [-Wsequence-point]

    It was introduced by commit
cf0fad49d17cb8273ce555dd5b7afab67d7923bf.

    Since sprintf(...) just return 1 (one character) in this case, ret
    should not changed.
    Just discarding the result of sprintf(...) leads to the result that
    the committer of cf0fad49d17cb8273ce555dd5b7afab67d7923bf wants.

    Change-Id: Ifed1cef6d6a31c3ed23dad03a567b3b9eddf3a57
    Signed-off-by: Chih-Wei Huang <cwhuang@android-x86.org>
    Signed-off-by: Dave Daynard <nardholio@gmail.com>

    cpufreq: interactive: Remove trace event from idle_start handler

    Removed the trace_cpufreq_interactive_idle_start.
    Also fix a crash resulting from accessing NULL policy before taking
    the pcpu->enable_sem lock. The policy can be NULL if the core is
    hotplugged out before the enable_sem lock is taken.

    Change-Id: I7e2809cc016b3b383a44cdf3c697013e2d2b5417
    Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
    (cherry picked from commit 3b7992b90216c74a9ae9ce0df90bc446687a2313)

commit 0e1b2b5f2703437e32448af02eed5fef0c5990e3
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 17:31:22 2014 +0000

    Samsung msm7x27: enable CPU_V6K support & fix compile

    The K extension is present on most msm7x27 chipsets used by
    Android devices. Restrict to Samsung boards, just in case.

    Fix "TLS_USERSPACE_EMUL" when CPU_USE_DOMAINS is disabled

    Change-Id: I24e727444703228550451aa5388cc7b7ebbb224e

commit 0a44c2d7e28f2b251504f98e64bc4acb158f961b
Author: Will Deacon <will.deacon@arm.com>
Date:   Tue Dec 17 19:50:16 2013 +0100

    ARM: 7928/1: kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS for
CPUv6+ && MMU

    Modern ARM CPUs can perform efficient unaligned memory accesses in
    hardware and this feature is relied up on by code such as the dcache
    word-at-a-time name hashing.

    This patch selects HAVE_EFFICIENT_UNALIGNED_ACCESS for these cores
and
    reworks the kconfig select logic for DCACHE_WORD_ACCESS to use the
new
    symbol.

    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    [steven@steven676.net: backport to 3.0: remove DCACHE_WORD_ACCESS
stuff,
    not present in 3.0]

    Change-Id: I156c40bf90de557c9d136b0312cf872e18becf9c

commit 0e029eb85f5c44ed1c7a7a5db93c456521d7c4d6
Author: Dave Martin <dave.martin@linaro.org>
Date:   Thu Nov 22 13:02:00 2012 +0100

    ARM: 7583/1: decompressor: Enable unaligned memory access for v6 and
above

    Modern GCC can generate code which makes use of the CPU's native
    unaligned memory access capabilities.  This is useful for the C
    decompressor implementations used for unpacking compressed kernels.

    This patch disables alignment faults and enables the v6 unaligned
    access model on CPUs which support these features (i.e., v6 and
    later), allowing full unaligned access support for C code in the
    decompressor.

    The decompressor C code must not be built to assume that unaligned
    access works if support for v5 or older platforms is included in
    the kernel.

    For correct code generation, C decompressor code must always use
    the get_unaligned and put_unaligned accessors when dealing with
    unaligned pointers, regardless of this patch.

    Change-Id: Ia32f95b47cb7149891ca96146ce66b70d9c86307
    Signed-off-by: Dave Martin <dave.martin@linaro.org>
    Acked-by: Nicolas Pitre <nico@linaro.org>

commit a0d748ffdae16a819c70ad80770212f2ee9c6777
Author: HandyMenny <handymenny@outlook.com>
Date:   Sun Nov 23 19:59:16 2014 +0100

    Use XZ compression for recovery builds

    Change-Id: I4e2d22cf37def4a781b70c2f6d6b9ce320bdf7a5

commit fa428197965905dd6a2a9cbe611d052504bd3ba4
Author: Imre Kaloz <kaloz@openwrt.org>
Date:   Mon Jan 28 13:43:09 2013 +0200

    ARM: 7001/2: Wire up support for the XZ decompressor

    Wire up support for the XZ decompressor

    Change-Id: Iba5c1d548a9bf7f5e54326865c427e6c13d81e37
    Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

commit 686666bec2d064d094edc0d71fa2dc4284a3deea
Author: AndroidMeda <hephappy@gmail.com>
Date:   Sat Jan 26 18:58:16 2013 +0200

    boot: Add march=armv6 flag

    Change-Id: Ie6c698f77d467bfc966c8aee5a8b84a5c55a9c9e

commit 31cd0163d0ff8358e4da0de37edc812d41d0927e
Author: Marco Milanese <marcomilanese7@gmail.com>
Date:   Tue Nov 18 15:38:56 2014 +0100

    Revert "msm7x27 configs: Disable VT, enable
MMC_BLOCK_DEFERRED_RESUME"

    This reverts commit 752aec8dc6daafc514b9b9f84d01baa09009bb4c.

    Change-Id: Ie7e7c14130375f5d1f56f8d3eb2563d3295f84fc

commit c7c8cacd4992e15d3bbca075f1c932a1a66f1bd0
Author: HandyMenny <handymenny@outlook.com>
Date:   Mon Nov 17 22:53:15 2014 +0100

    Add MSM FB samsung booting logo

    Change-Id: Ia83b84998b292d9759da91f68b4a20714318ee75

commit 9f5e526f1a0911c9061d5696d1aeb2f7e2e1a13a
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 17 07:07:37 2014 +0000

    samsung msm7x27 configs: disable MMC_BLOCK_DEFERRED_RESUME

    Seems to cause drivers errors during resume.

    Change-Id: I446f0fd0ec2e602294550fa9c26eb00d74dfdaa5

commit 752aec8dc6daafc514b9b9f84d01baa09009bb4c
Author: HandyMenny <handymenny@outlook.com>
Date:   Sun Nov 16 23:01:16 2014 +0100

    msm7x27 configs: Disable VT, enable MMC_BLOCK_DEFERRED_RESUME

    Drastically reduces the wake delay.

    Thanks to psyke83 for the hint.

    Change-Id: I88d5fb5e0034c937fe40af8f57b1094a6172865a

commit 33ff9468496c0e7f67e7e40f4d309ddf899996a4
Author: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Date:   Fri Nov 14 15:16:30 2014 +0100

    lib/lzo: huge LZO decompression speedup on ARM by using unaligned
access

    Change-Id: I4dc172b2822504c3f2db1913ed9404e031861d55
    Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>

commit 3d309d28fde3fd4b304b30f86c9445cb3366c43a
Author: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Date:   Fri Nov 14 15:16:21 2014 +0100

    lib/lzo: Update LZO compression to current upstream version

    This commit updates the kernel LZO code to the current upsteam
version
    which features a significant speed improvement - benchmarking the
Calgary
    and Silesia test corpora typically shows a doubled performance in
    both compression and decompression on modern i386/x86_64/powerpc
machines.

    Change-Id: Iaa6e560ebbc663aac382187b7cd9d52ba8a3329d
    Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>

commit 44d78d658c29739b60680d70f801437a81fbcd21
Author: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Date:   Fri Nov 14 15:16:08 2014 +0100

    lib/lzo: Rename lzo1x_decompress.c to lzo1x_decompress_safe.c

    Rename the source file to match the function name and thereby
    also make room for a possible future even slightly faster
    "non-safe" decompressor version.

    Change-Id: Ic6551cf65f1909e288b3857e841980a56a8c59b6
    Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>

commit 230113508bc0c721de1e70637579c12b0d081f4b
Author: Marco Milanese <marcomilanese7@gmail.com>
Date:   Tue Nov 4 21:31:15 2014 +0100

    samsung msm7x27: update configs

    Update configurations for new 3.0.31 kernel, merged from base &
    recommended android configs.

    See:
https://github.com/android/kernel_common/blob/android-3.0/android/configs/README

    Change-Id: I2185a8ea5d9d2b724ec0a7462cdfda2704586dff

commit 75c1c5259dcbc916e1527009c4d8b2bdab4209ac
Author: HandyMenny <handymenny@outlook.com>
Date:   Sat Nov 8 23:03:54 2014 +0100

    Import Samsung's leds-msm-pmic driver changes

    Change-Id: I9f0a0896598143043a544d2752d2078fcdc41b88

commit ec7656dc6ad0fa0df6c181fad498feb951e75108
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 07:02:55 2014 +0000

    Samsung msm7x27: enhance max8899 support and update merged board

    * Rework regulator code in all Samsung drivers to be compatible with
      MAX8899 IC
    * Revert all whitespace "fixes" to make it easier to track against
      vanilla CAF revision
    * Reorganize all I2C devices properly and merge all camera drivers
    * Fix issues causing boot failure on tass, gio.
    * Lots of fixes that were not properly merged from the various
      Samsung boards pre-merge.
    * Enable IRQ workaround for all synaptics drivers variants
    * Fix imbalanced regulator disables in vibrator driver

    Change-Id: I430e65d6299fd324ac667bdd953faa04d01e95e7

commit bb8b66167528f4961265932c6184fb78f035a013
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 21:18:04 2014 +0000

    mdp_dma_lcdc: Samsung msm7x27 power-on and polarity fixes

    Change-Id: I6299f2fa8a29b3ca2ca2972d2078a889af76e3e7

commit 7320a8b3673c93008ae7d48a762f23edb4f33e0f
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 19:45:20 2014 +0000

    Samsung msm7x27: reduce battery charge buffer logging

    Change-Id: Idcefc4b7c04dc76eebd95bcd50a24ee15225b121

commit 293496c9c46f4f35c74ab267cccd18a3349104db
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 16:29:28 2014 +0000

    lcdc_ta8566: reduce backlight logspam

    Change-Id: Ieb4ae4a194fbf2df1f467aa6f46c7379a2b6bbd7

commit 88fd2f7f2ce744883fbefe2bb0790488bb75ffe1
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 16:18:49 2014 +0000

    callisto_battery: reduce log spam

    Change-Id: Ica9cf9ad195502782eb01e0d69c3fa1e34077b48

commit 49d34a056ec64f74389cbb02320ec06921171873
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 06:58:52 2014 +0000

    lcdc_s6d04h0a_tass: fix build error on 3.0 kernel

    Change-Id: I179a225a41ccee96246c0a6227d904e92be1b356

commit 3d3d114829c80323f543096deb880fb10f9112fa
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 06:58:21 2014 +0000

    Samsung msm7x27: rename DECLARE_MUTEX to DEFINE_SEMAPHORE

    Change-Id: I359289a12d102032b010570472fc05a2ada67bfe

commit f44803b2d49c1c40064308106fbc123c10431b10
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 06:34:58 2014 +0000

    gp2a: fix build errors on 3.0 kernel

    Change-Id: Ic4bc8cfaeeced4f05de489954d97a75608c919d2

commit f9f2ed38ebc09e35281981336ad3c7f11847d41c
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Mon Nov 10 06:34:41 2014 +0000

    gpio_matrix: fix callisto build errors

    Change-Id: I7a48394584c8f7d45f3a35b8b0d6bb68f0eef84b

commit db69ca6edaac382acf6f66bfe57c8495104c0557
Author: HandyMenny <handymenny@outlook.com>
Date:   Sun Nov 9 21:21:43 2014 +0100

    cooper: fix power key

    Change-Id: I2a9a24f7efff230731a97de236bc7f19596c75b8

commit aa82f14873901b63a074cdaf1b314a0cf001af35
Author: HandyMenny <handymenny@outlook.com>
Date:   Sun Nov 9 15:33:47 2014 +0100

    Reduce kernel log spam

    Disable "Currnet Charging state" and msm_batt_check_event output.

    Change-Id: If3dd7774a1b9cbf511e67dc379cff0946762cff9

commit e7d77ce492d0110e9bc7402cf05a364b553876a6
Author: Marco Milanese <marcomilanese7@gmail.com>
Date:   Sun Nov 9 01:36:57 2014 +0100

    param: cleanup and add support for all samsung msm7x27 devices

    Change-Id: I92c471600197fe478e09c4f7195e31401540ebd1

commit 2f5433e2fc75ae62ec6c1c3f38707822b77925bb
Author: AndroidMeda <hephappy@gmail.com>
Date:   Fri Feb 15 13:37:55 2013 +0200

    Make genlock ICS compatible

    Change-Id: I939e9f3dc9babad44ffec940563be389addbb4ce

commit 23d8f90af8f87cea28340991f8f0f88d29b1aff4
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Nov 4 23:05:22 2014 +0000

    synaptics_i2c_rmi4/issp: set correct voltages per-board

    Change-Id: Id9215522564a9af035d1fdb63c6c18b6eeef4f6e

commit 7b577d730f588bad65a9993c0be2a2193fedd4d7
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Wed Nov 5 02:06:41 2014 +0000

    Kbuild: install headers required for Android userspace build

    Also install dummy msm_ion.h header.

    Change-Id: I974a43c3707004b6e9f3e21d36dd177b1e6cf768

commit 7c0c565f1e41d756663c730a5301d276f512e842
Author: Marco Milanese <marcomilanese7@gmail.com>
Date:   Tue Nov 4 22:31:46 2014 +0100

    Revert "lzo: This is a combination of 5 commits."

    This reverts commit e1ed88e7e27f916ac4aff63c78059f89afc24bda.

    Change-Id: Ibcdc45386bd1e01eee4bf5bd25e94c1b82171670

commit 78172a664f5cc7e247dafe28b73546eb0c1c8a71
Author: Marco Milanese <marcomilanese7@gmail.com>
Date:   Tue Nov 4 21:34:47 2014 +0100

    drivers/fsr: updates and fixes

    * Fix build when FSR is compiled built-in in the kernel
    * Fix FSR loading on Samsung MSM7x27 gingerbread devices

    Change-Id: I713de5e53285dbc26442ee4f7388f490a3740aa1

commit 439f4534af9a61347a2a940c20acdd8f9983cde8
Author: Marco Milanese <marcomilanese7@gmail.com>
Date:   Tue Nov 4 22:30:09 2014 +0100

    Revert "msm: acpuclock-7201: add AHB & CPU overclocking for msm7x27
boards"

    This reverts commit cf7ce8a3c32c06fce53b114255941e5726f42bc8.

    Change-Id: I60ccc2b971d5ca38b28f03c96fd8a0bec5210c96

commit 63e2577fd0ead6f4d9b4c1a1901d4f96495d9693
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Sat Nov 1 23:16:53 2014 +0000

    Switch remote spinlock to ldrex algorithm

    Warning: swp{b} use is deprecated for this architecture

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dht0008a/index.html

    Change-Id: I4e20d628a7ece9cfc158b0c59b1ad7853183d3a4

commit a062cfa5cb4677178379212987517a451b377d4f
Author: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Date:   Mon Aug 13 17:24:24 2012 +0200

    lzo: This is a combination of 5 commits.

    lib/lzo: Rename lzo1x_decompress.c to lzo1x_decompress_safe.c

    Rename the source file to match the function name and thereby
    also make room for a possible future even slightly faster
    "non-safe" decompressor version.

    Orig-Change-Id: I482ee415d43c5aaa77d34946ae1fa0af5465b007
    Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>

    lib/lzo: Update LZO compression to current upstream version

    This commit updates the kernel LZO code to the current upsteam
version
    which features a significant speed improvement - benchmarking the
Calgary
    and Silesia test corpora typically shows a doubled performance in
    both compression and decompression on modern i386/x86_64/powerpc
machines.

    Orig-Change-Id: Ifcde45460c856644097bdeb612f0d68c6429f03c
    Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>

    lib/lzo: huge LZO decompression speedup on ARM by using unaligned
access

    Orig-Change-Id: I4dc172b2822504c3f2db1913ed9404e031861d55
    Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>

    ARM: kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS for CPUv6+ &&
MMU

    Modern ARM CPUs can perform efficient unaligned memory accesses in
    hardware and this feature is relied up on by code such as the dcache
    word-at-a-time name hashing.

    [pawitp: adapt to kernel 3.0]

    Orig-Change-Id: I41559fc9255229e2601f4bef28aa8d48246156b7
    Signed-off-by: Will Deacon <will.deacon@arm.com>

    mm: remove compressed copy from zram in-memory

    Swap subsystem does lazy swap slot free with expecting the page
would be
    swapped out again so we can avoid unnecessary write.

    But the problem in in-memory swap(ex, zram) is that it consumes
memory
    space until vm_swap_full(ie, used half of all of swap device)
condition
    meet.  It could be bad if we use multiple swap device, small in-
memory
    swap and big storage swap or in-memory swap alone.

    This patch makes swap subsystem free swap slot as soon as swap-read
is
    completed and make the swapcache page dirty so the page should be
    written out the swap device to reclaim it.  It means we never lose
it.

    I tested this patch with kernel compile workload.

    1. before

       compile time : 9882.42
       zram max wasted space by fragmentation: 13471881 byte
       memory space consumed by zram: 174227456 byte
       the number of slot free notify: 206684

    2. after

       compile time : 9653.90
       zram max wasted space by fragmentation: 11805932 byte
       memory space consumed by zram: 154001408 byte
       the number of slot free notify: 426972

    [akpm@linux-foundation.org: tweak comment text]
    [artem.savkov@gmail.com: fix BUG due to non-swapcache pages in
end_swap_bio_read()]
    [akpm@linux-foundation.org: invert unlikely() test, augment comment,
80-col cleanup]
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    Signed-off-by: Minchan Kim <minchan@kernel.org>
    Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
    Cc: Nitin Gupta <ngupta@vflare.org>
    Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
    Cc: Shaohua Li <shli@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    Conflicts:
    	mm/page_io.c

    Change-Id: Iccb6adc92a9fc668e967dce05080f709b4895c02

commit cb432d22b0df1ae91189c6a0f1b2ca9a1ff0269e
Author: Rik van Riel <riel@redhat.com>
Date:   Thu Sep 1 19:26:50 2011 +0000

    add extra free kbytes tunable

    Add a userspace visible knob to tell the VM to keep an extra amount
    of memory free, by increasing the gap between each zone's min and
    low watermarks.

    This is useful for realtime applications that call system
    calls and have a bound on the number of allocations that happen
    in any short time period.  In this application, extra_free_kbytes
    would be left at an amount equal to or larger than than the
    maximum number of allocations that happen in any burst.

    It may also be useful to reduce the memory use of virtual
    machines (temporarily?), in a way that does not cause memory
    fragmentation like ballooning does.

    [ccross]
    Revived for use on old kernels where no other solution exists.
    The tunable will be removed on kernels that do better at avoiding
    direct reclaim.

    Orig-Change-Id: I765a42be8e964bfd3e2886d1ca85a29d60c3bb3e
    Signed-off-by: Rik van Riel<riel@redhat.com>
    Signed-off-by: Colin Cross <ccross@android.com>

    Change-Id: I16f4faa93deba66713d4188c73c325ebcb5ad9f0

commit eb29a61fbb6faca062b139e20d312caa940babd1
Author: androidmeda <hephappy@gmail.com>
Date:   Mon Feb 3 10:29:28 2014 +0200

    Upgrade ashmem to kk_3.5_rb1.21 from drivers/staging/android (4
commits)

    drivers: staging: android: Fix ashmem vm range comparison to stop
roll-over

    Every time ASHMEM_CACHE_INV_RANGE was sent to an IOCTL a roll-over
was
    occurring, causing the check to fail. This was comparing a start +
size
    range with a start + end range, and if the start + end was less than
the
    start + size the ioctl would fail. The end value was always equal to
    start + size from all tests I ran, and since the roll-over occurred
with
    start + end, it was always less than start. Setting the check to
compare
    start + size > end fixes this.

    Orig-Change-Id: I3e4356ab40d8c745fd91eb0cc6b1aaed73494140
    Signed-off-by: Matthew Trusten <mtrusten@codeaurora.org>

    staging: android: ashmem: get_name,set_name not to hold ashmem_mutex

    Problem:
    There exists a path in ashmem driver that could lead to acquistion
    of mm->mmap_sem, ashmem_mutex in reverse order. This could lead
    to deadlock in the system.
    For Example, assume that mmap is called on a ashmem region
    in the context of a thread say T1.
     sys_mmap_pgoff (1. acquires mm->mmap_sem)
      |
       --> mmap_region
     	|
             ----> ashmem_mmap (2. acquires asmem_mutex)
     Now if there is a context switch after 1 and before 2,
     and if another thread T2 (that shares the mm struct) invokes an
     ioctl say ASHMEM_GET_NAME, this can lead to the following path

    ashmem_ioctl
      |
      -->get_name (3. acquires ashmem_mutex)
    	|
    	---> copy_to_user (4. acquires the mm->mmap_sem)
    Note that the copy_to_user could lead to a valid fault if no
    physical page is allocated yet for the user address passed.
    Now T1 has mmap_sem and is waiting for ashmem_mutex.
    and T2 has the ashmem_mutex and is waiting for mmap_sem
    Thus leading to deadlock.

    Solution:
    Do not call copy_to_user or copy_from_user while holding the
    ahsmem_mutex. Instead copy this to a local buffer that lives
    in the stack while holding this lock. This will maintain data
    integrity as well never reverse the lock order.

    Testing:
    Created a unit test case to reproduce the problem.
    Used the same to test this fix on kernel version 3.4.0
    Ported the same patch to 3.8

    Orig-Change-Id: Ib66f6265da91691acfd3be9ea8f5c9332c978751
    CRs-Fixed: 600362
    Signed-off-by: Shankar Brahadeeswaran <shankoo77@gmail.com>
    Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
    Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Git-commit: e5834d620d61d01444c41958f1816d688a96433c
    Git-repo:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
    Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

    ashmem: avoid deadlock between read and mmap calls

    Avoid holding ashmem_mutex across code that can page fault.  Page
faults
    grab the mmap_sem for the process, which are also held by mmap calls
    prior to calling ashmem_mmap, which locks ashmem_mutex.  The
reversed
    order of locking between the two can deadlock.

    The calls that can page fault are read() and the ASHMEM_SET_NAME and
    ASHMEM_GET_NAME ioctls.  Move the code that accesses userspace pages
    outside the ashmem_mutex.

    Bug: 9261835
    Orig-Change-Id: If1322e981d29c889a56cdc9dfcbc6df2729a45e9
    CRs-Fixed: 600362
    Signed-off-by: Todd Poynor <toddpoynor@google.com>
    Git-repo: https://android.googlesource.com/kernel/common/
    Git-commit: 0a9dea28170c90a7265250b66cc0df1253b0c501
    Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

    staging: ashmem: Fix the build failure when OUTER_CACHE is enabled

    ashmem driver is failing to build when OUTER_CACHE is enabled
    through the CACHE_L2X0 option. Fix it with appropriate new
    offset routines.

    Orig-Change-Id: I298f9bb32899f20e17407b5210d0859d6308c035
    Signed-off-by: Trilok Soni <tsoni@codeaurora.org>

    Change-Id: I922e287d4ebb44b088e5ffe36d7b42b1430b54be

commit 8765efd0996932f24ed6b73c316f3735e9278037
Author: Brian Swetland <swetland@google.com>
Date:   Wed Jan 28 20:45:48 2009 -0800

    HACK stay compatible with the emulated TLS register HACK

    psyke83: wrap hack into CONFIG_TLS_USERSPACE_EMUL option

    Change-Id: Ia59b8f4422cb56a9954f06d7ac06338bbfe71e59
    Signed-off-by: Pankaj <pankaj.bharadiya@ti.com>

commit 0e2bfbc309b016f1f7495252e12a59d1892695b5
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Sat Nov 1 22:33:49 2014 +0000

    Revert "ARM: Force software TLS on ARMv6."

    This reverts commit 2f4e7779e74a68f882fa0d797c7831ca794602f8.

    Change-Id: Ic2ab15c29c1979d4c48f85e1b81736e48b32f155

commit b12590564c68f0729bc2e46ebb2e09ac5355b772
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Sat Nov 1 22:27:35 2014 +0000

    Move cyanogenmod defconfigs to simplify build system

    Change-Id: Ibb8f393eaf2466eb685fa0512314ed9d08eea4ec

commit dd7c9ee59b889f1d0140a99ae7cb1478424e3df5
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Sat Nov 1 22:25:41 2014 +0000

    fsr: rename prebuilt files to *.o_shipped

    Change-Id: I720a722c135f5109405a909c8e8dc6631ee5706a

commit 23d36463adf60fcee39b56834b13bb64f5968790
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Wed Apr 3 17:20:36 2013 -0300

    samsung-msm7x27: update regulator code/voltages

    Should fix mXT140_ts driver, and issues with mmc/wifi on some
    Samsung boards.

commit 6befa5101544a08166cc3d0832fcd58fe13accae
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Wed Apr 3 00:16:38 2013 -0300

    samsung-bluesleep: fix wakelock issue

    Bluetooth should no longer inhibit deep sleep.
    Small adjustment to Makefile to avoid potential build error.

commit 119eaff6dcf8b0e5cf3797f609a790518daeac34
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 19:02:28 2013 -0300

    Revert "msm: qdsp5: Add ION framework support for 7x27A & 8x25
targets"

    This reverts commit 0b5af3d79eb3882198f1caa7609c848150bbf79e.

commit f98414771e926d0b92db8fe34d1c70f143578db3
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 19:01:41 2013 -0300

    Revert "msm: QDSP5: audio: Migrate to ION"

    This reverts commit f63e4178d35df5bbff502002f9263dcc61e03527.

commit 2ec792cc1cb2e3dd8028e3e8f4a68476a4252ac4
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 19:01:15 2013 -0300

    Revert "msm: qdsp5: Fix for crash in mp3 driver"

    This reverts commit cf9b4c555036cc288151eaa0b0db1a04dc3f647c.

commit 3f249822161b446d9c2fa79047d162986f41d4e2
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 18:58:02 2013 -0300

    touchscreen: fix irq problem in synaptics_i2c_rmi4_europa (hack)

commit 9f2ec2e981ffd27aab8291388d086e16a6973352
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 18:55:35 2013 -0300

    Update galaxy5 cyanogenmod defconfig

commit bc748b6475376b4dd9354c54ac36bf61e48201df
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 18:52:41 2013 -0300

    staging: add snappy compression support & zram snappy support

    Adapted from reference patch:
https://github.com/zeevt/csnappy/blob/master/kernel_3_2_10.patch

commit a6633261d68b1ad786b0c827158f315de51bc676
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 18:46:13 2013 -0300

    mmc: msm_sdcc: fix build error with CONFIG_PM_RUNTIME=n

commit 313b65bf9a122dc69d65839230e7f2f089374e70
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 18:44:07 2013 -0300

    scripts/setlocalversion: don't append plus symbol to localversion

commit d5e42f240dc74faac12f6da51d624bb16bd6dc2b
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 18:42:38 2013 -0300

    board-samsung-msm7x27: add sdio wakeup irq support for SDC slot 2

commit 9fce52b3bf1b9482613fcc9e38d55311f82a614d
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 18:30:15 2013 -0300

    board-samsung-msm7x27: amend framebuffer allocation values

    * Amend MSM_FB_SIZE values using reference values from original
Samsung boards;
    * Re-calculate required sizes for triple buffering based on amended
values.

commit ce5c2d8f175ad6df40b322cf7aea67a0d27a041d
Author: Conn O'Griofa <connogriofa@gmail.com>
Date:   Tue Apr 2 18:26:38 2013 -0300

    msm: acpuclock-7201: add AHB & CPU overclocking for msm7x27 boards

Change-Id: Idb5b1d66106047f916bfb47d433e6cde533e67ba

Conflicts:
	Documentation/cpu-freq/governors.txt
	arch/arm/include/asm/tls.h
	drivers/bluetooth/hci_smd.c
	drivers/cpufreq/cpufreq_interactive.c
	drivers/cpufreq/cpufreq_ondemand.c
	drivers/input/touchscreen/ISSP/issp_driver_routines.c
	drivers/mmc/host/msm_sdcc.c
	drivers/staging/qcache/fmem.c
	drivers/staging/qcache/qcache-main.c
	drivers/staging/qcache/tmem.c
	drivers/staging/qcache/tmem.h
	drivers/video/msm/mdp_dma_lcdc.c
	include/trace/events/cpufreq_interactive.h
	net/bluetooth/l2cap_core.c
	net/netfilter/xt_qtaguid.c
	net/netfilter/xt_qtaguid_internal.h
	net/netfilter/xt_qtaguid_print.c
msm7x27 configs: Set SELinux to be permissive

Change-Id: If3b443184f241356f929254bd069868446da80b2