ARM: 7822/1: add workaround for ambiguous C99 stdint.h types

The C99 types uintXX_t that are usually defined in 'stdint.h' are not as
unambiguous on ARM as you would expect. For the types below, there is a
difference on ARM between GCC built for bare metal ARM, GCC built for glibc
and the kernel itself, which results in build errors if you try to build with
-ffreestanding and include 'stdint.h' (such as when you include 'arm_neon.h'
in order to use NEON intrinsics)

As the typedefs for these types in 'stdint.h' are based on builtin defines
supplied by GCC, we can tweak these to align with the kernel's idea of those
types, so 'linux/types.h' and 'stdint.h' can be safely included from the same
source file (provided that -ffreestanding is used).

                   int32_t         uint32_t               uintptr_t
bare metal GCC     long            unsigned long          unsigned int
glibc GCC          int             unsigned int           unsigned int
kernel             int             unsigned int           unsigned long

Acked by: Dave Martin <dave.martin@arm.com>

Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
*fixing header files*
block: *fixing CAF merge derp*

CAF did apply following patches:

2012-02-08: "block: separate out blk_rq_merge_ok() and blk_try_merge() from elevator functions" (https://www.codeaurora.org/cgit/quic/la/kernel/msm/commit/block/elevator.c?h=msm-3.4&id=050c8ea80e3e90019d9e981c6a117ef614e882ed)

After that they applied:

2012-05-24: "block: ioctl support for sanitize in eMMC 4.5" (https://www.codeaurora.org/cgit/quic/la/kernel/msm/commit/block/elevator.c?h=msm-3.4&id=73937f5face75e05ec2a72966d04f4e20aa18379)
(this commit if faulty already after the commit from 2012-02-08!)

And then they merged:

2012-06-07: "Merge commit 'AU_LINUX_ANDROID_ICS.04.00.04.00.126' into msm-3.4" (https://www.codeaurora.org/cgit/quic/la/kernel/msm/commit/block/elevator.c?h=msm-3.4&id=f132c6cf77251e011e1dad0ec88c0b1fda16d5aa)
(this totally screwed the patch from 2012-02-08)

Now it's fixed and like it's supposed like :-)

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
bootmem: fix wrong call parameter for free_bootmem()

It is strange that alloc_bootmem() returns a virtual address and
free_bootmem() requires a physical address.  Anyway, free_bootmem()'s
first parameter should be physical address.

There are some call sites for free_bootmem() with virtual address.  So fix
them.

[akpm@linux-foundation.org: improve free_bootmem() and free_bootmem_pate() documentation]
Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
acpuclock-7627.c: fixing table selection in select_freq_plan()

In the function 'select_freq_plan()' there's a check to select
the correct table for 1008Mhz CPU's, because there's a conflict
between 7627AA and 8625 chips.

However this check is wrong:
	if (pll_mhz[ACPU_PLL_2] == 245)

It should be:
	if (pll_mhz[ACPU_PLL_1] == 245)

We don't want to check PLL_2 but PLL_1 being '245' or not.

Due of this bug the wrong frequency table is getting selected
for 1GHz 8625 chips with PLL_2=245.

Previously-detected-by: Peter Jung <peter.jung@lge.com>
Signed-off-by: moddingg33k <moddingg33k@t-online.de>
block, I/O scheduler: add SIO, FIOPS, ROW
crypto: cleanup - remove unneeded crypto_alg.cra_list initializations

Initialization of cra_list is currently mixed, most ciphers initialize this
field and most shashes do not. Initialization however is not needed at all
since cra_list is initialized/overwritten in __crypto_register_alg() with
list_add(). Therefore perform cleanup to remove all unneeded initializations
of this field in 'crypto/'.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
mm: remove swap token code

The swap token code no longer fits in with the current VM model.  It
does not play well with cgroups or the better NUMA placement code in
development, since we have only one swap token globally.

It also has the potential to mess with scalability of the system, by
increasing the number of non-reclaimable pages on the active and
inactive anon LRU lists.

Last but not least, the swap token code has been broken for a year
without complaints, as reported by Konstantin Khlebnikov.  This suggests
we no longer have much use for it.

The days of sub-1G memory systems with heavy use of swap are over.  If
we ever need thrashing reducing code in the future, we will have to
implement something that does scale.

Signed-off-by: Rik van Riel <riel@redhat.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Hugh Dickins <hughd@google.com>
Acked-by: Bob Picco <bpicco@meloft.net>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
removing deprecated APIs

msm: remove fmem support

      This functionality is deprecated and no longer supported.

ARM: removed VCM framework

      This framework wasn't accepted upstream and is not used.

PM / tracing: remove deprecated power trace API

      The text in Documentation said it would be removed in 2.6.41;
      the text in the Kconfig said removal in the 3.1 release.  Either
      way you look at it, we are well past both, so push it off a cliff.

      Note that the POWER_CSTATE and the POWER_PSTATE are part of the
      legacy tracing API.  Remove all tracepoints which use these flags.
      As can be seen from context, most already have a trace entry via
      trace_cpu_idle anyways.

      Also, the cpufreq/cpufreq.c PSTATE one is actually unpaired, as
      compared to the CSTATE ones which all have a clear start/stop.
      As part of this, the trace_power_frequency also becomes orphaned,
      so it too is deleted.

      Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

msm: avs: Remove vestigial software based AVS

      Older targets like 8x50 had the first version of Apdaptive Voltage
      Scaling done in software. This feature was never enabled and supported.
      Remove the code and the associated config items.

      Change-Id: If3bdab7d0bdb5d51e099f7c37f56592826edc102
      Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>

msm: Remove old unused sdio related code

      Cleanup mach-msm by removing unused sdio related code.

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

ARM: 7388/1: Kconfig: Remove duplicate IRQ Kconfig entries

      These kconfig entries are already defined in kernel/irq/Kconfig
      so select them instead of redefining them.

      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/cpufreq: conservative: simplified SAMPLING_TIME determination

...because simple things can be good things, too.

This commit introduces MIN_SAMPLING_RATE & DEF_SAMPLING_RATE
which are used to directly set the driver's minimum and default
sampling rate rather than doing any calculation before.

DEF_FREQUENCY_DOWN_THRESHOLD gets increased to a more reasonable value.
refactoring -> drivers: power: Detect device suspend/resume lockup and log event in pstore

    Rather than hard-lock the kernel, dump the suspend/resume thread stack and
    panic() to capture a message in pstore when a driver takes too long to
    suspend/resume. Default suspend/resume watchdog timeout is set to 12
    seconds to be longer than the usbhid 10 second timeout, but could be
    changed at compile time.

    Exclude from the watchdog the time spent waiting for children that
    are resumed asynchronously and time every device, whether or not they
    resumed synchronously.

    This patch is targeted for mobile devices where a suspend/resume lockup
    could cause a system reboot. Information about failing device can be
    retrieved in subsequent boot session by mounting pstore and inspecting
    the log. Laptops with EFI-enabled pstore could also benefit from
    this feature.

    The hardware watchdog timer is likely suspended during this time and
    couldn't be relied upon. The soft-lockup detector would eventually tell
    that tasks are not scheduled, but would provide little context as to why.
    The patch hence uses system timer and assumes it is still active while the
    devices are suspended/resumed.

    This feature can be enabled/disabled during kernel configuration.

    Cc: Android Kernel Team <kernel-team@android.com>
    Cc: Colin Cross <ccross@android.com>
    Cc: Todd Poynor <toddpoynor@google.com>
    Cc: San Mehat <san@google.com>
    Original-author: San Mehat <san@google.com>
    Signed-off-by: Benoit Goby <benoit@android.com>
    [zoran.markovic@linaro.org: Changed printk(KERN_EMERG,...) to pr_emerg(...),
    tweaked commit message. Moved call to dpm_wd_set() before device_lock() in
    device_resume(). Minor changes to add compile-time inclusion of the feature.
    Renamed 'dpm_wd...' to 'dpm_watchdog...'.]
    Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>
touchscreen: adding fuzz to improve ovation sensitivity

Adding a fuzz factor to improve X/Y touch registration.
USB: OTG: Vote against APP's idle PC in USB Host Mode

In USB Host mode, When the target is going to APP's
idle PC and coming out with any peripheral device
connected, target is crashing. Fix this issue by
not allowing Idle PC in USB Host Mode.

Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
(cherry picked from commit 9d672c8f341fc2bbee2c6ee0108d7d8eedbe999f)

Change-Id: If590888fdc4dd52b4a3014c77f2d14ad7a30b4da
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
USB: OTG: Restore autodection in OTG peripheral mode
SOUND: *updating to MSM-3.4 drivers*
ADSP: QDSP5: *squashing updates*

msm: adsp: qdsp5: Allow MOD_READY event in ENABLING state

      JPEGTASK is receiving MOD_READY event after it is disabled
      which is not expected. When JPEGTASK enable fails with
      ETIMEDOUT error, this module is disabled immediately.
      But MOD_READY event for this module is sent by RPC to
      Apps ADSP Driver even after it is disabled. Ignore this
      event incase module state is not in ENABLING state.

      CRs-Fixed: 395420
      Change-Id: I0bd637f8bee84e811a400ac107f81d3df7a64a07
      Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>

qdsp5: audio: Add support for adsp dump mechanism

      Whenever timeout happens at apps while waiting for response
      from ADSP services, dsp or audmgr apps initiates command to
      collect cache coherent dumps to modem ADSP services to collect
      dump. This will help in debugging the timeout issue.

      Change-Id: Ic48d2815611afea8fed38c2c235e539619bed0ea
      Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>

msm: audio: qdsp5: Add support for MIDI method

      Currenly CAD driver only supports VOICE method when setting volume.
      For applying dynamic PMIC gain MIDI method is used. Changes are made
      to support MIDI method also.

      Change-Id: Id2d4868c88ef1fc08bbdbd3757905edc5435923c
      Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>

qdsp5: mvs: Allow only single instance of mvs session

      During MVS open, mvs driver calls msm_rpc_connect to establish
      rpc connection with modem mvs server without checking for
      current state of mvs driver. This causes modem oncrpc memory
      pool to exhaust if back to back open is called without closing
      the mvs driver.

      Added check to call rpc connect only if mvs driver is in
      closed state.

      CRs-Fixed: 433208
      Change-Id: Id8274318096ba3e774925451999670eebe0a66c1
      Signed-off-by: Manish Dewangan <manish@codeaurora.org>

msm: audio: qdsp5: Fix for wrong device values sent to acdb

      Wrong device values are being sent acdb driver callback function.
      This is because for a new audio manager session which gets registered,
      device info is sent only when there is change in device configuration
      or sample rate configuration. Due to this, not all sessions are updated
      with the current device info and wrong values are sent to acdb.
      Avoid this by maintaining a common device info across all sessions
      to send correct device values.

      CRs-Fixed: 420467
      Change-Id: I1d5555252aa56fddf28f06df5b60df6579f1ed7d
      Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>

qdsp5: audio: Allow audio preprocessing only from acdb driver

      audio pp(preprocessing) features enabled via acdb (Audio calibration
      database) driver gets disabled by audio pcm encoder driver if audio
      record enable acknowledgement comes after applying pp parameter
      via acdb.

      Fix this by allowing audio pp enable from pcm driver only
      if acdb support is not available.

      CRs-Fixed: 436891
      Change-Id: I2882752f55ac1c3ac3160d28c081dd9940b9f83e
      Signed-off-by: Manish Dewangan <manish@codeaurora.org>

msm: audio: qdsp5: Allow postprocessing only from acdb if present

      Audio postprocessing(audio pp) features enabled via acdb (Audio calibration
      database) driver gets disabled by audio postprocessing driver during
      open.
      Fix this by allowing legacy audio pp feature enable from postprocessing
      driver only if acdb support is not available. Acdb driver maintains wrong
      state due to improper update of stream id which is used to maintain
      number of active sessions. Due to this postprocessing features are
      enabled even before audpp task is enabled in adsp.

      Change-Id: I817263b0134f0302e64093148bafbe559cbc100a
      CRs-Fixed: 409488
      Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>

msm: audio: qdsp5: Add wake up in audio manager callback

      Audio manager enable is failing on timeout in few cases.
      In audio manager callback for codec config, wake up is missing
      in cases where CAD(Common Application Device) is not present.
      Due to this timeout happens in enable call while waiting on
      above condition. Add wake up in such case to avoid issues.

      CRs-Fixed: 439047
      Change-Id: I2c176513dd2aadf17190228e60bf042a794d8daf
      Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>

qdsp5: audio: Avoid race condition by using mutex lock

      There is chance of race condtion if audpp(audio postprocessing)
      callback registration function is called concurrently
      by more than one clients.

      Avoid this by serializing audpp callback function using
      mutex lock.

      CRs-Fixed: 441525
      Change-Id: Ic7524d83b32d54b09ba77648a266585957f49648
      Signed-off-by: Manish Dewangan <manish@codeaurora.org>

qdsp5: mvs: Fix kernel panic due to early closure of endpont

      MVS driver closes the RPC endpoint while it sends reply to the
      RPC read sometimes. The RPC write for this reply results in
      crash as endpoint is already closed.
      Wait for RPC read and reply to complete before closing the
      endpoint.

      CRs-Fixed: 443706
      Change-Id: Ia1918082118f23ab9aefec1c3a04908d8d8c1199
      Signed-off-by: Sriranjan Srikantam <cssrika@codeaurora.org>

msm: audio: qdsp5: Add support of dynamic re-enable of post proc

      DSP can disable the post processing features due to unavailability
      of MIPS during video playback. As a result difference in audio
      quality is observed after video playback. Add support to re-enable
      the post processing features once video playback ends and MIPS are
      available.
      DSP sends a message whenever post processing features are disabled
      due to unavailability of MIPS and sends another message once the
      MIPS are available. AUDPP driver broadcasts these messages to all
      the relavant clients which keeps track of disabled features and
      re-enables them when re-enable message is received from DSP.

      Change-Id: Ic4cad4e7b0afe4377006055417ba193b01cce930
      Signed-off-by: Sriranjan Srikantam <cssrika@codeaurora.org>

qdsp5: audio: Release wake_lock resources at exit

      Wake_lock resources acquired during module init are not
      released during exit. This leads to corruption in list
      maintained by wake_lock driver and cause crash.
      Release the resources before exiting the module.

      CRs-Fixed: 405797
      Change-Id: I6340fff390af677c47c59264e01f6cd723fea357
      Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>

qdsp5: audio: Check for earlysuspend support.

      Declaration of audac3_post_event is not currently
      guarded by an ifdef check for CONFIG_HAS_EARLYSUSPEND
      (the function's definition is), causing builds without
      early suspend to fail. Use the ifdef check for the
      declaration to avoid this.

      Change-Id: I5a5758df6b543d100351644b20795b30f74e556b
      Signed-off-by: Anurag Singh <anursing@codeaurora.org>

msm: Remove all references to pmem from audio files

      PMEM is no longer supported. Remove all references to it.

      Change-Id: If68c41901b8fb0b9382650c3123a68958f769761
      Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

qdsp5: memset stack buffer allocation.

      This is needed to avoid garbage data in uninitialized variables.

      Change-Id: I3a043a4ce4e14d8e0c24b434181dff484eddac72
      Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
drivers/radio-tavarua: *syncing with CodeAurora*
ZRAM / ZSMALLOC: *squashing updates*

backported for kernel 3.4.y

currently following patches are missing due of missing compatibility:
(they don't improve functionality though)

  -> "block: Abstract out bvec iterator"
  -> "block: Convert bio_for_each_segment() to bvec_iter"

-----------------------------------------------------------------------------

zram: drop `init_done' struct zram member

      Introduce init_done() helper function which allows us to drop `init_done'
      struct zram member.  init_done() uses the fact that ->init_done == 1
      equals to ->meta != NULL.

      Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: Minchan Kim <minchan@kernel.org>
      Acked-by: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

zram: use atomic64_t for all zram stats

      This is a preparation patch for stats code duplication removal.

      1) use atomic64_t for `pages_zero' and `pages_stored' zram stats.

      2) `compr_size' and `pages_zero' struct zram_stats members did not

	follow the existing device attr naming scheme: zram_stats.ATTR has
	ATTR_show() function.  rename them:

	-- compr_size -> compr_data_size
	-- pages_zero -> zero_pages

      Minchan Kim's note:
      If we really have trouble with atomic stat operation, we could
      change it with percpu_counter so that it could solve atomic overhead and
      unnecessary memory space by introducing unsigned long instead of 64bit
      atomic_t.

      Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: Minchan Kim <minchan@kernel.org>
      Acked-by: Jerome Marchand <jmarchan@redhat.com>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

zram: remove good and bad compress stats

      Remove `good' and `bad' compressed sub-requests stats.  RW request may
      cause a number of RW sub-requests.  zram used to account `good' compressed
      sub-queries (with compressed size less than 50% of original size), `bad'
      compressed sub-queries (with compressed size greater that 75% of original
      size), leaving sub-requests with compression size between 50% and 75% of
      original size not accounted and not reported.  zram already accounts each
      sub-request's compression size so we can calculate real device compression
      ratio.

      Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: Minchan Kim <minchan@kernel.org>
      Acked-by: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

zram: remove zram stats code duplication

      Introduce ZRAM_ATTR_RO macro that generates device_attribute and default
      ATTR show() function for existing atomic64_t zram stats.

      Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: Minchan Kim <minchan@kernel.org>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

zram: report failed read and write stats

      zram accounted but did not report numbers of failed read and write
      queries.  make these stats available as failed_reads and failed_writes
      attrs.

      Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: Minchan Kim <minchan@kernel.org>
      Acked-by: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

zram: drop not used table `count' member

      struct table `count' member is not used.

      Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Acked-by: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

zram: move zram size warning to documentation

      Move zram warning about disksize and size of memory correlation to zram
      documentation.

      Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: Minchan Kim <minchan@kernel.org>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

zram: delete zram_init_device()

      allocate new `zram_meta' in disksize_store() only for uninitialised zram
      device, saving a number of allocations and deallocations in case if
      disksize_store() was called on currently used device.  at the same time
      zram_meta stack variable is not necessary, because we can set ->meta
      directly.  there is also no need in setting QUEUE_FLAG_NONROT queue on
      every disksize_store(), set it once during device creation.

      [minchan@kernel.org: handle zram->meta alloc fail case]
      [minchan@kernel.org: prevent lockdep spew of init_lock]
      Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: Minchan Kim <minchan@kernel.org>
      Acked-by: Jerome Marchand <jmarchan@redhat.com>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

zram: support REQ_DISCARD (modified!)

  Changes in function: static void zram_bio_discard
  From: size_t n = bio->bi_iter.bi_size;
  To: size_t n = bio->bi_size;

      zram is ram based block device and can be used by backend of filesystem.
      When filesystem deletes a file, it normally doesn't do anything on data
      block of that file.  It just marks on metadata of that file.  This
      behavior has no problem on disk based block device, but has problems on
      ram based block device, since we can't free memory used for data block.
      To overcome this disadvantage, there is REQ_DISCARD functionality.  If
      block device support REQ_DISCARD and filesystem is mounted with discard
      option, filesystem sends REQ_DISCARD to block device whenever some data
      blocks are discarded.  All we have to do is to handle this request.

      This patch implements to flag up QUEUE_FLAG_DISCARD and handle this
      REQ_DISCARD request.  With it, we can free memory used by zram if it isn't
      used.

      [akpm@linux-foundation.org: tweak comments]
      Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

zram: do not pass rw argument to __zram_make_request()

      Do not pass rw argument down the __zram_make_request() -> zram_bvec_rw()
      chain, decode it in zram_bvec_rw() instead.  Besides, this is the place
      where we distinguish READ and WRITE bio data directions, so account zram
      RW stats here, instead of __zram_make_request().  This also allows to
      account a real number of zram READ/WRITE operations, not just requests
      (single RW request may cause a number of zram RW ops with separate
      locking, compression/decompression, etc).

      Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: Minchan Kim <minchan@kernel.org>
      Acked-by: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
staging/android: *squashing updates*

Signed-off-by: moddingg33k <moddingg33k@t-online.de>
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.

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