Revert "Add Boostpulse interface to ondemand original patch by Narayanan Gopalakrishnan"

This reverts commit 8086933bcaa4d7f5f1a0c3bc5210f623adbca4b7.
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>

Conflicts:

	drivers/cpufreq/cpufreq_ondemand.c
cpufreq: ondemand: Add duration for boosting

 * Keep default behavior of 500ms boost if "1" is given, otherwise use
   the value (microseconds) as the boost duration.

Change-Id: Id38adef1aece7b5609689e50d33cb11b74a352c5

Conflicts:

	drivers/cpufreq/cpufreq_ondemand.c
drivers: cpufreq: Add max duration for boosting

 * Don't allow boosting for more than 5 seconds.

Change-Id: Ib602c398ab117ee06c9fa113b1dc9042f1255a8f
iosched: prevent aliased requests from starving other I/O

Hi, Jens,

If you recall, I posted an RFC patch for this back in July of last year:
http://lkml.org/lkml/2010/7/13/279

The basic problem is that a process can issue a never-ending stream of
async direct I/Os to the same sector on a device, thus starving out
other I/O in the system (due to the way the alias handling works in both
cfq and deadline).  The solution I proposed back then was to start
dispatching from the fifo after a certain number of aliases had been
dispatched.  Vivek asked why we had to treat aliases differently at all,
and I never had a good answer.  So, I put together a simple patch which
allows aliases to be added to the rb tree (it adds them to the right,
though that doesn't matter as the order isn't guaranteed anyway).  I
think this is the preferred solution, as it doesn't break up time slices
in CFQ or batches in deadline.  I've tested it, and it does solve the
starvation issue.  Let me know what you think.

Cheers,
Jeff

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
lib: genalloc: Change chunk allocation to vmalloc

Change the chunk allocation from kmalloc to vmalloc for
allocations greater than a page. This allows large
chunks to be allocated from physically non-contiguous
memory and increases the chance of the allocation
succeeding.

CRs-fixed: 387655
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit 0614b96dc8e4c8a0dd0db41aec5a79daa3bdf091)

Conflicts:

	lib/genalloc.c

Change-Id: Ic0dedbad9d277d0842591b1f075ce3b80c8c05de
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
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: Linus Torvalds <torvalds@linux-foundation.org>
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: David S. Miller <davem@davemloft.net>
CC: linux-crypto@vger.kernel.org
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 export for removed "optimized" SHA1 routines

This fixes the sha_transform exported twice compilation warning.
clk: add helper functions clk_prepare_enable and clk_disable_unprepare

It's for migrating to generic clk framework API.

The helper functions  help cases clk_enable/clk_disable is used
in non-atomic context.
For example, Call clk_enable in probe and clk_disable in remove.

Change-Id: If4023d1856ecc07f332f072c1b4831ad3cba82de
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: cpufreq: Release cpumask_var_t on all cases

Release cpufreq 'mask' variable when it fails to qualify for changing
cpu frequency.

CRs-fixed: 348827
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
(cherry picked from commit fdf788b79589280622f1fb7f761194234442d2ef)

Change-Id: I38e4de8fee99a68c05df423d19339ba033064eef
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: memory: Use standard cache routines

Convert custom clean, flush, and invalidate cache routines to use
standard ARM cache routines.

Change-Id: Ida0c539b89e1b6c98542221f847a9bcd7fc32a2e
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
(cherry picked from commit 29bb4d5fa7a285c8fb5d5db55225dab700b80419)

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
arm: mm: Check if movable zone has a nonzero size

If CONFIG_FIX_MOVABLE_ZONE is enabled but the
the movable zone is not set up, vmalloc_min
will become 0 and the kernel will crash.

This change checks that movable_reserved_size
is nonzero before doing anything.

Change-Id: I3d3cb2482fde20fbd1dd0668dbbd414e42eda995
Signed-off-by: Jack Cheung <jackc@codeaurora.org>
arm: mm: Compare phys address instead of virt

Doing __va(movable_reserved_start) can overflow if
movable_reserved_start is a very high address. This
will cause the comparison to evaluate incorrectly.

This change instead compares the physical addresses, which
cannot overflow/underflow.

Change-Id: I6c82df16b77a905617aa6f59c2eeaf7acb36c76d
Signed-off-by: Jack Cheung <jackc@codeaurora.org>
msm: improve handling of DONT_MAP_HOLE_AFTER_MEMBANK0

The code to avoid mapping the hole after memory bank 0
located the start and size of this hole after running
generic initialization code which needed to convert
physical addresses to virtual ones and vice-versa
beyond this hole.

While this didn't prevent the kernel from booting, this
isn't clean, and in fact it was giving us more vmalloc
space than the config file specified (and as a result
there was less lowmem than expected).

The code to locate the hole now runs before this
initialization code.

CRs-Fixed: 352258
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 31a949b5c5004f017e4adfa86f4a136025acdcd4)

Change-Id: Ia80c5db63c214ab86084ef68e29429fbac622434
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
(cherry picked from commit af20a668c96a6869d89bc9430bee748fb43f52d2)
msm: allow memory pools to be created from multiple memory banks

On platforms which require very large memory pools, it
might not be possible to create such a memory pool from
a single memory bank (even though there may be several
contiguous memory banks of the same memory type), and
the memory pool created would then be smaller than requested.

Allow multiple contiguous memory banks to be used in the
creation of memory pools, making it more likely that a
large memory pool can be created of the desired size.

CRs-Fixed: 333361
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 48e4f5f31c19f1b9e5f54cdba61beeec434c8c56)

Change-Id: I51a033e65bd42bd65f85b09c0d1700f142be2108
Signed-off-by: Yen-Pin Hsiao <yphsiao@codeaurora.org>
pmem: Check for valid virtual address while flushing

Return invalid error if a NULL virtual address is
passed for pmem cache maintenance ioctl's

Change-Id: I18c369d4c2ac790b622408a988d171d6f75c4cd3
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
pmem: Fix a possible NULL pointer dereference

Fix a possible Null pointer dereference when allocating the
garbage page and fixed potential leaks caused in the error path.
Fixed potential leaks in pmem_remove

Change-Id: I7d4fa0798553691ed80e5024b19ba363249576b3
CRs-Fixed: 313700
Signed-off-by: Vipul Gandhi <vgandhi@codeaurora.org>
(cherry picked from commit f752bf6a2822801d5fdf9178bfe2b257b8d49778)
arm: mm: merge derp
msm: camera: Discontinue use of clk_set_min_rate()

Support for the proprietary clk_set_min_rate() will soon be removed.
Move away from it. Call clk_set_rate() directly with an exact rate
where possible, and use clk_round_round() in conjunction with
clk_set_rate() when an exact rate is not known.

Change-Id: I030c93c976f516a3ec91844ce2e5d752f56cdb9a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>