update defconfig

Signed-off-by: thirdzcee <thirdzcee@gmail.com>
optimize vfp

Signed-off-by: thirdzcee <thirdzcee@gmail.com>
SQUASH: BFQ

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

block: introduce the BFQ-v7r2 I/O sched for 3.4

Add the BFQ-v7r2 I/O scheduler to 3.4.
The general structure is borrowed from CFQ, as much of the code for
handling I/O contexts. Over time, several useful features have been
ported from CFQ as well (details in the changelog in README.BFQ). A
(bfq_)queue is associated to each task doing I/O on a device, and each
time a scheduling decision has to be made a queue is selected and served
until it expires.

    - Slices are given in the service domain: tasks are assigned
      budgets, measured in number of sectors. Once got the disk, a task
      must however consume its assigned budget within a configurable
      maximum time (by default, the maximum possible value of the
      budgets is automatically computed to comply with this timeout).
      This allows the desired latency vs "throughput boosting" tradeoff
      to be set.

    - Budgets are scheduled according to a variant of WF2Q+, implemented
      using an augmented rb-tree to take eligibility into account while
      preserving an O(log N) overall complexity.

    - A low-latency tunable is provided; if enabled, both interactive
      and soft real-time applications are guaranteed a very low latency.

    - Latency guarantees are preserved also in the presence of NCQ.

    - Also with flash-based devices, a high throughput is achieved
      while still preserving latency guarantees.

    - BFQ features Early Queue Merge (EQM), a sort of fusion of the
      cooperating-queue-merging and the preemption mechanisms present
      in CFQ. EQM is in fact a unified mechanism that tries to get a
      sequential read pattern, and hence a high throughput, with any
      set of processes performing interleaved I/O over a contiguous
      sequence of sectors.

    - BFQ supports full hierarchical scheduling, exporting a cgroups
      interface.  Since each node has a full scheduler, each group can
      be assigned its own weight.

    - If the cgroups interface is not used, only I/O priorities can be
      assigned to processes, with ioprio values mapped to weights
      with the relation weight = IOPRIO_BE_NR - ioprio.

    - ioprio classes are served in strict priority order, i.e., lower
      priority queues are not served as long as there are higher
      priority queues.  Among queues in the same class the bandwidth is
      distributed in proportion to the weight of each queue. A very
      thin extra bandwidth is however guaranteed to the Idle class, to
      prevent it from starving.

Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
(cherry picked from commit 733d880f30de46cdab84260e19812d758e064a42)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

block, bfq: add Early Queue Merge (EQM) to BFQ-v7r2 for 3.4.0

A set of processes may happen  to  perform interleaved reads, i.e., requests
whose union would give rise to a  sequential read  pattern.  There are two
typical  cases: in the first  case,   processes  read  fixed-size chunks of
data at a fixed distance from each other, while in the second case processes
may read variable-size chunks at  variable distances. The latter case occurs
for  example with  KVM, which  splits the  I/O generated  by the  guest into
multiple chunks,  and lets these chunks  be served by a  pool of cooperating
processes,  iteratively  assigning  the  next  chunk of  I/O  to  the first
available  process. CFQ  uses actual  queue merging  for the  first type of
rocesses, whereas it  uses preemption to get a sequential  read pattern out
of the read requests  performed by the second type of  processes. In the end
it uses  two different  mechanisms to  achieve the  same goal: boosting the
throughput with interleaved I/O.

This patch introduces  Early Queue Merge (EQM), a unified mechanism to get a
sequential  read pattern  with both  types of  processes. The  main idea is
checking newly arrived requests against the next request of the active queue
both in case of actual request insert and in case of request merge. By doing
so, both the types of processes can be handled by just merging their queues.
EQM is  then simpler and  more compact than the  pair of mechanisms used in
CFQ.

Finally, EQM  also preserves the  typical low-latency properties of BFQ, by
properly restoring the weight-raising state of  a queue when it gets back to
a non-merged state.

Signed-off-by: Mauro Andreolini <mauro.andreolini@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
Reviewed-by: Paolo Valente <paolo.valente@unimore.it>
(cherry picked from commit a1f70901820bd683fdc8d78f81903b8c4fc96582)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

block: cgroups, kconfig, build bits for BFQ-v7r2-3.4

Update Kconfig.iosched and do the related Makefile changes to include
kernel configuration options for BFQ. Also add the bfqio controller
to the cgroups subsystem.

Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>

Conflicts:
	block/Makefile

Conflicts:
	Makefile

Conflicts:
	Makefile

(cherry picked from commit 60e8c70dd770f01b0d428ec2973d8215b44779ab)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	Makefile
	block/Makefile

block: cgroups, kconfig, build bits for BFQ-v7r2-3.4

Update Kconfig.iosched and do the related Makefile changes to include
kernel configuration options for BFQ. Also add the bfqio controller
to the cgroups subsystem.

Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
(cherry picked from commit 49a032d457ab11c31b2b4f4fb4dd7c37d79503a0)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

bfq: add BFQ README & COPYING

(cherry picked from commit fd5c0b61b1adcf0eda7225b1356784eaeedeab1c)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

BFQ: update to v7r3

(cherry picked from commit b7f24a629aefd415913174d78551fb16828af4b4)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Tweak BFQ for Flash Media/Batlash Media, battery, and performance

(cherry picked from commit 1a2a5beae2541c8b4ccc27d2d3b976b3a70f1fb1)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

More BFQ adjustments

(cherry picked from commit 8f12ed4580c6e8f3c9e2e1587eea0bcff63fb984)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Tweak BFQ again

(cherry picked from commit 15fedd3b578f65fbdd2f438b87d6218633cf34b9)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Upgrade to BFQv7r4

CHANGELOG

v7r4:
. BUGFIX. Modified the code so as to be robust against late detection of
  NCQ support for a rotational device.
. BUGFIX. Removed a bug that hindered the correct throughput distribution
  on flash-based devices when not every process had to receive the same
  fraction of the throughput. This fix entailed also a little efficiency
  improvement, because it implied the removal of a short function executed
  in a hot path.
. CODESTYLE IMPROVEMENT: removed quoted strings split across lines.

v7r3:
. IMPROVEMENT: Improved throughput boosting with NCQ-capable HDDs and
  random workloads. The mechanism that further boosts throghput with
  these devices and workloads is activated only in the cases where it
  does not cause any violation of throughput-distribution and latency
  guarantees.
. IMPROVEMENT: Generalized the computation of the parameters of the
  low-latency heuristic for interactive applications, so as to fit also
  slower storage devices. The purpose of this improvement is to preserve
  low-latency guarantees for interactive applications also on slower
  devices, such as portable hard disks, multimedia and SD cards.
. BUGFIX: Re-added MODULE_LICENSE macro.
. CODE IMPROVEMENTS: Small code cleanups; introduced a coherent naming
  scheme for all identifiers related to weight raising; refactored and
  optimized a few hot paths.

v7r2:
. BUGFIX/IMPROVEMENT. One of the requirements for an application to be
  deemed as soft real-time is that it issues its requests in batches, and
  stops doing I/O for a well-defined amount of time before issuing a new
  batch. Imposing this minimum idle time allows BFQ to filter out I/O-bound
  applications that may otherwise be incorrectly deemed as soft real-time
  (under the circumstances described in detail in the comments to the
  function bfq_bfqq_softrt_next_start()). Unfortunately, BFQ could however
  start counting this idle time from two different events: either from the
  expiration of the queue, if all requests of the queue had also been already
  completed when the queue expired, or, if the previous condition did not
  hold, from the first completion of one of the still outstanding requests.
  In the second case, an application had more chances to be deemed as soft
  real-time.
  Actually, there was no reason for this differentiated treatment. We
  addressed this issue by defining more precisely the above requirement for
  an application to be deemed as soft real-time, and changing the code
  consequently: a well-defined amount of time must elapse between the
  completion of *all the requests* of the current pending batch and the
  issuing of the first request of the next batch (this is, in the end, what
  happens with a true soft real-time application). This change further
  reduced false positives, and, as such, improved responsiveness and reduced
  latency for actual soft real-time applications.
. CODE IMPROVEMENT. We cleaned up the code a little bit and addressed
  some issues pointed out by the checkpatch.pl script.

v7r1:
. BUGFIX. Replace the old value used to approximate 'infinity', with
  the correct one to use in case times are compared through the macro
  time_is_before_jiffies(). In fact, this macro, designed to take
  wraparound issues into account, easily returns anomalous results if
  its argument is equal to the value that we used as an approximation
  of 'infinity', namely ((unsigned long) (-1)).  The consequence was
  that the logical expression used to determine whether a queue
  belongs to a soft real-time application often yielded an incorrect
  result. In the end, some application happened to be incorrectly
  deemed as soft real-time and hence weight-raised. This affected both
  throughput and latency guarantees.
. BUGFIX. Fixed a scriverner's error made in an attempt to use the
  above macro in a logical expression.
. IMPROVEMENT/BUGFIX. On the expiration of a queue, use a more general
  condition to allow a weight-raising period to start if the queue is
  soft real-time.  The previous condition could prevent an empty,
  soft-real time queue from being correctly deemed as soft real-time.
. IMPROVEMENT/MINOR BUGFIX. Use jiffies-comparison macros also in the
  following cases:
  . to establish whether an application initially deemed as interactive
    is now meeting the requirements for being classified as soft
    real-time;
  . to determine if a weight-raising period must be ended.
. CODE IMPROVEMENT. Change the type of the time quantities used in the
  weight-raising heuristics to unsigned long, as the type of the time
  (jiffies) is unsigned long.

v7:
- IMPROVEMENT: In the presence of weight-raised queues and if the
  device is NCQ-enabled, device idling is now disabled for non-raised
  readers, i.e., for their associated sync queues. Hence a sync queue
  is expired immediately if it becomes empty, and a new queue is
  served.  As explained in detail in the papers about BFQ, not idling
  the device for sync queues when the latter become empty causes BFQ to
  assign higher timestamps to these queues when they get backlogged
  again, and hence to serve these queues less frequently. This fact,
  plus to the fact that, because of the immediate expiration itself,
  these queues get less service while they are granted access to the
  disk, reduces the relative rate at which the processes associated to
  these queues ask for requests from the I/O request pool. If the pool
  is saturated, as it happens in the presence of write hogs, reducing
  the above relative rate increases the probability that a request is
  available (soon) in the pool when a weight-raised process needs it.
  This change does seem to mitigate the typical starvation problems
  that occur in the presence of write hogs and NCQ, and hence to
  guarantee a higher application and system responsiveness in these
  hostile scenarios.
- IMPROVEMENT/BUGFIX: Introduced a new classification rule to the soft
  real-time heuristic, which takes into account also the isochronous
  nature of such applications. The computation of next_start has been
  fixed as well. Now it is correctly done from the time of the last
  transition from idle to backlogged; the next_start is therefore
  computed from the service received by the queue from its last
  transition from idle to backlogged. Finally, the code which
  preserved weight-raising for a soft real-time queue even with no
  idle->backlogged transition has been removed.
- IMPROVEMENT: Add a few jiffies to the reference time interval used to
  establish whether an application is greedy or not. This reference
  interval was, by default, HZ/125 seconds, which could generate false
  positives in the following two cases (especially if both cases occur):
  1) If HZ is so low that the duration of a jiffie is comparable to or
     higher than the above reference time interval. This happens, e.g.,
     on slow devices with HZ=100.
  2) If jiffies, instead of increasing at a constant rate, may stop
     increasing for some time, then suddenly 'jump' by several units to
     recover the lost increments. This seems to happen, e.g., in virtual
     machines.
  The added number of jiffies has been found experimentally. In particular,
  according to our experiments, adding this number of jiffies seems to make
  the filter quite precise also in embedded systems and KVM/QEMU virtual
  machines. Also contributed by
  Alexander Spyridakis <a.spyridakis@virtualopensystems.com>.
- IMPROVEMENT/BUGFIX: Keep disk idling also for NCQ-provided
  rotational devices, which boosts the throughput on NCQ-enabled
  rotational devices.
- BUGFIX: The budget-timeout condition in the bfq_rq_enqueued() function
  was checked only if the request is large enough to provoke an unplug. As
  a consequence, for a process always issuing small I/O requests the
  budget timeout was never checked. The queue associated to the process
  therefore expired only when its budget was exhausted, even if the
  queue had already incurred a budget timeout from a while.
  This fix lets a queue be checked for budget timeout at each request
  enqueue, and, if needed, expires the queue accordingly even if the
  request is small.
- BUGFIX: Make sure that weight-raising is resumed for a split queue,
  if it was merged when already weight-raised.
- MINOR BUGFIX: Let bfq_end_raising_async() correctly end weight-raising
  also for the queues belonging to the root group.
- IMPROVEMENT: Get rid of the some_coop_idle flag, which in its turn
  was used to decide whether to disable idling for an in-service
  shared queue whose seek mean decreased. In fact, disabling idling
  for such a queue turned out to be useless.
- CODE IMPROVEMENT: The bfq_bfqq_must_idle() function and the
  bfq_select_queue() function may not change the current in-service
  queue in various cases. We have cleaned up the involved conditions,
  by factoring out the common parts and getting rid of the useless
  ones.
- MINOR CODE IMPROVEMENT: The idle_for_long_time condition in the
  bfq_add_rq_rb() function should be evaluated only on an
  idle->backlogged transition. Now the condition is set to false
  by default, evaluating it only if the queue was not busy on a
  request insertion.
- MINOR CODE IMPROVEMENT: Added a comment describing the rationale
  behind the condition evaluated in the function
  bfq_bfqq_must_not_expire().

v6r2:
- Fairness fix: the case of queue expiration for budget timeout is
  now correctly handled also for sync queues, thus allowing also
  the processes corresponding to these queues to be guaranteed their
  reserved share of the disk throughput.
- Fixed a bug that prevented group weights from being correctly
  set via the sysfs interface.
- Fixed a bug that cleared a previously-set group weight if the
  same value was re-inserted via the sysfs interface.
- Fixed an EQM bug that allowed a newly-started process to skip
  its initial weight-raising period if its queue was merged before
  its first request was inserted.
- Fixed a bug that preserved already-started weight-raising periods
  even if the low_latency tunable was disabled.
- The raising_max_time tunable now shows, more user-friendly, the
  maximum raising time in milliseconds.

v6r1:
- Fix use-after-free of queues in __bfq_bfqq_expire(). It may happen that
  a call to bfq_del_bfqq_busy() puts the last reference taken on a queue
  and frees it. Subsequent accesses to that same queue would result in a
  use-after-free. Make sure that a queue that has just been deleted from
  busy is no more touched.
- Use the uninitialized_var() macro when needed. It may happen that a
  variable is initialized in a function that is called by the function
  that defined it. Use the uninitialized_var() macro in these cases.

v6:
- Replacement of the cooperating-queue merging mechanism borrowed from
  CFQ with Early Queue Merge (EQM), a unified mechanism to get a
  sequential read pattern, and hence a high throughput, with any set of
  processes performing interleaved I/O. EQM also preserves low latency.
  (see http://algogroup.unimore.it/people/paolo/disk_sched/description.php
  for more details). Contributed by Mauro Andreolini and Arianna Avanzini.
  The code for detecting whether two queues have to be merged is a
  slightly modified version of the CFQ code for detecting whether two
  queues belong to cooperating processes and whether the service of a
  queue should be preempted to boost the throughput.
- Fix a bug that caused the peak rate of a disk to be computed as zero
  in case of multiple I/O errors. Subsequent estimations of the weight
  raising duration caused a division-by-zero error.

v5r1:
- BUG FIX: Fixed stall occurring when the active queue is moved to
  a different group while idling (this caused the idling timer to be
  cancelled and hence no new queue to be selected, and no new
  request to be dispatched).
- BUG FIX: Fixed wrong assignment of too high budgets to queues during
  the first few seconds after initialization.
- BUG FIX: Added proper locking to the function handling the "weights"
  tunable.

v5:
- Added an heuristic that, if the tunable raising_max_time is set to
  0, automatically computes the duration of the weight raising
  according to the estimated peak rate of the device. This enables
  flash-based devices to reach maximum throughput as soon as possible,
  without sacrificing latency.

v4:
- Throughput-boosting for flash-based devices: improved version of commits
  a68bbdd and f7d7b7a, which boosts the throughput while still preserving
  latency guarantees for interactive and soft real-time applications.
- Better identification of NCQ-capable disks: port of commit e459dd0.

v3-r4:
- Bugfixes
  * Removed an important memory leak: under some circumstances the process references
    to a queue were not decremented correctly, which prevented unused shared bfq_queue
    to be correctly deallocated.
  * Fixed various errors related to hierarchical scheduling:
	* Removed an error causing tasks to be attached to the bfqio cgroup
	  controller even when BFQ was not the active scheduler
	* Corrected wrong update of the budgets from the leaf to the root upon
	  forced selection of a service tree or a bfq_queue
	* Fixed the way how active leaf entities are moved to the root group before
	  the group entity is deactivated when a cgroup is destroyed
- Throughput-boosting improvement for cooperating queues: close detection is now based
  on a fixed threshold instead of the queue's average seek. This is a port of one of
  the changes in the CFQ commit 3dde36d by Corrado Zoccolo.

v3-r3:
- Bugfix: removed an important error causing occasional kernel panics when
  moving a process to a new cgroup. The panic occurred if:
  1) the queue associated to the process was idle when the process was moved
     and
  2) a new disk request was inserted into the queue just after the move.
- Further latency improvement through a better treatment of low-bandwidth
  async queues.

v3-r2:
- Bugfix: added a forgotten condition that prevents weights of low-bw async
  queues from being raised when low_latency is off.
- Latency improvement: low-bw async queues are now better identified.

v3-r1:
- Fixed an important request-dispatch bug causing occasional IO hangs.
- Added a new mechanism to reduce the latency of low-bw async queues.
  This reduces the latency of also the sync queues synchronized with
  the above async queues.
- Fixed a minor bug in iocontext locking (port of commits 9b50902 and 3181faa
  from CFQ).

v3:

- Improved low-latency mechanisms, including a more accurate criterion to
  distinguish between greedy-but-seeky and soft real-time applications.
  Interactive applications now enjoy noticeably lower latencies.

- Switch to the simpler one-request-dispatch-at-a-time scheme as in CFQ.

- Ported cooperating-queues merging from CFQ (6d048f5, 1afba04,
  d9e7620, a36e71f, 04dc6e7, 26a2ac0, 3ac6c9f, f2d1f0a, 83096eb,
  2e46e8b, df5fe3e, b3b6d04, e6c5bc7, c0324a0, f04a642, 8682e1f,
  b9d8f4c, 2f7a2d8, ae54abe, e9ce335, 39c01b2, d02a2c0, c10b61f).
  Contributed by Arianna Avanzini. Queues of processes performing IO
  on interleaved, yet contiguous disk zones are merged to boost the
  throughput. Some little optimizations to get a more stable throughput
  have been added to the original CFQ version.

- Added static fallback queue for extreme OOM conditions (porting of
  CFQ commits d5036d7, 6118b70, b706f64, 32f2e80). Port contributed by
  Francesco Allertsen.

- Ported CFQ commits b0b78f8, 40bb54d, 30996f4, dddb745, ad5ebd2, cf7c25c;
  mainly code cleanup and fix of minor bugs. Port contributed by
  Francesco Allertsen.

v2:

- An issue that may cause little throughput loss on fast disks has been solved.
  BFQ-v1 and CFQ may suffer from this problem.
- The disk-idling timeout has been better tuned to further file latency
  (especially for the idle- or light-loaded-disk scenarios).
- One of the parameters of the low-latency heuristics has been tuned a little
  bit more, so as to reduce the probability that a disk-bound process may
  hamper the reduction of the latency of interactive and soft real-time
  applications.

  - Same low-latency guarantees with and without NCQ.

  - Latency for interactive applications about halved with respect to BFQ-v1.

  - When the low_latency tunable is set, also soft real-time applications
    now enjoy reduced latency.

  - A very little minimum bandwidth is now guaranteed to the
    Idle IO-scheduling class also when the other classes are
    backlogged, just to prevent them from starving.

v1:

This is a new version of BFQ with respect to the versions you can
find on Fabio's site: http://feanor.sssup.it/~fabio/linux/bfq.
Here is what we changed with respect to the previous versions:

1) re-tuned the budget feedback mechanism: it is now slighlty more
biased toward assigning high budgets, to boost the aggregated
throughput more, and more quickly as new processes are started

2) introduced more tolerance toward seeky queues (I verified that the
phenomena described below used to occur systematically):

   2a: if a queue is expired after having received very little
       service, then it is not punished as a seeky queue, even if it
       occurred to consume that little service too slowly; the
       rationale is that, if the new active queue has been served for
       a too short time interval, then its possible sequential
       accesses may not yet prevail on the initial latencies for
       moving the disk head on the first sector requested

   2b: the waiting time (disk idling) of a queue detected as seeky as
       a function of the position of the requests it issued is reduced
       to a very low value only after the queue has consumed a minimum
       fraction of the assigned budget; this prevents processes
       generating (partly) seeky workloads from being too ill-treated

   2c: if a queue has consumed 'enough' budget upon a budget timeout, then,
       even if it did not consume all of its budget, that queue is not punished
       as any seeky queue; the rationale is that, depending on the disk zones,
       a queue may be served at a lower rate than the estimated peak rate.

   Changes 2a and 2b have been critical in lowering latencies, whereas
   change 2c, in addition to change 1, helped a lot increase the disk
   throughput.

3) slightly changed the peak rate estimator: a low-pass filter is now
used instead of just keeping the highest rate sampled; the rationale
is that the peak rate of a disk should be quite stable, so the filter
should converge more or less smoothly to the right value; it seemed to
correctly catch the peak rate with all disks we used

4) added the low latency mechanism described in detail in
http://algogroup.unimore.it/people/paolo/disk_sched/description.php.

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
(cherry picked from commit 9777a59ea57d6961d2ab531a507d1d3568e0fe01)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

block: Update BFQ from v7r4 to v7r5

v7r5:
. IMPROVEMENT: Improve throughput boosting by idling the device
  only for processes that, in addition to perform sequential I/O,
  are I/O-bound (apart from weight-raised queues, for which idling
  is always performed to guarantee them a low latency).
. IMPROVEMENT: Improve throughput boosting by depriving processes
  that cooperate often of weight-raising.
. CODE IMPROVEMENT: Pass of improvement of the readability of both
  comments and actual code.

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
(cherry picked from commit c9d223fddd2ef432bbcbfbaa5b8764e549f1ef6a)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
SQUASH: GPU OC/UC

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

GPU oc

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	arch/arm/configs/torched_elite_defconfig
	arch/arm/mach-msm/Kconfig

Conflicts:
	arch/arm/configs/cyanogen_d2dcm_defconfig
	arch/arm/mach-msm/Kconfig

(cherry picked from commit d3dfbac6b55f6074ad9de7cd08c518da28560f75)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

gpu underclocked to 96mhz, and overclocked to 500mhz, also fixed a little derp in the gpu table, was wondering why fps never reached 30+... lol

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

moar GPU OC

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

GPU:why 480 when we can go up to 512....

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

GPU: OC to 600mhz,,,
dafuq am i tryin to do here

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

some more gpu clocks added

Signed-off-by: thirdzcee <thirdzcee@gmail.com>
tcp: network speed tweak

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

(cherry picked from commit b36335157915ba37b95d2d89b0f6ac30fe10f390)
(cherry picked from commit 16ba577ac0c3ac6102f14e2f8956e3482724dc6d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
mpdec: tweak hotlplug values

Signed-off-by: thirdzcee <thirdzcee@gmail.com>
SQUASH:bit sliced AES using NEON instructions

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

ARM: add support for bit sliced AES using NEON instructions

Bit sliced AES gives around 45% speedup on Cortex-A15 for encryption
and around 25% for decryption. This implementation of the AES algorithm
does not rely on any lookup tables so it is believed to be invulnerable
to cache timing attacks.

This algorithm processes up to 8 blocks in parallel in constant time. This
means that it is not usable by chaining modes that are strictly sequential
in nature, such as CBC encryption. CBC decryption, however, can benefit from
this implementation and runs about 25% faster. The other chaining modes
implemented in this module, XTS and CTR, can execute fully in parallel in
both directions.

The core code has been adopted from the OpenSSL project (in collaboration
with the original author, on cc). For ease of maintenance, this version is
identical to the upstream OpenSSL code, i.e., all modifications that were
required to make it suitable for inclusion into the kernel have been made
upstream. The original can be found here:

    http://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=6f6a6130

Note to integrators:
While this implementation is significantly faster than the existing table
based ones (generic or ARM asm), especially in CTR mode, the effects on
power efficiency are unclear as of yet. This code does fundamentally more
work, by calculating values that the table based code obtains by a simple
lookup; only by doing all of that work in a SIMD fashion, it manages to
perform better.

Cc: Andy Polyakov <appro@openssl.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>

Conflicts:
	arch/arm/crypto/Makefile

(cherry picked from commit 067c68533a55c21897cba5d11d069402dee08fe3)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	arch/arm/crypto/Makefile

crypto: create generic version of ablk_helper

Create a generic version of ablk_helper so it can be reused
by other architectures.

Acked-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	crypto/Kconfig
	crypto/Makefile

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit 1637484027efe7cf922c4247d6f2d0f5056e49fb)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

crypto: ablk_helper - Replace memcpy with struct assignment

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   48e6dc1b2a1ad8186d48968d5018912bdacac744
commit: a62b01cd6cc1feb5e80d64d6937c291473ed82cb [20/24] crypto: create generic version of ablk_helper

coccinelle warnings: (new ones prefixed by >>)

>> crypto/ablk_helper.c:97:2-8: Replace memcpy with struct assignment
>> crypto/ablk_helper.c:78:2-8: Replace memcpy with struct assignment

Please consider folding the attached diff :-)

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit b4a97eec373e42156f57b995b8fad4025de98c39)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

ARM: move AES typedefs and function prototypes to separate header

Put the struct definitions for AES keys and the asm function prototypes in a
separate header and export the asm functions from the module.
This allows other drivers to use them directly.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit d9577d4891e8913b54e02b3a631b8ac2af8980c4)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

ARM: pull in <asm/simd.h> from asm-generic

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit 846aab8934e7f1273698af6f892e9ffc91585d60)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

ARM: 7626/1: arm/crypto: Make asm SHA-1 and AES code Thumb-2 compatible

This patch fixes aes-armv4.S and sha1-armv4-large.S to work
natively in Thumb.  This allows ARM/Thumb interworking workarounds
to be removed.

I also take the opportunity to convert some explicit assembler
directives for exported functions to the standard
ENTRY()/ENDPROC().

For the code itself:

  * In sha1_block_data_order, use of TEQ with sp is deprecated in
    ARMv7 and not supported in Thumb.  For the branches back to
    .L_00_15 and .L_40_59, the TEQ is converted to a CMP, under the
    assumption that clobbering the C flag here will not cause
    incorrect behaviour.

    For the first branch back to .L_20_39_or_60_79 the C flag is
    important, so sp is moved temporarily into another register so
    that TEQ can be used for the comparison.

  * In the AES code, most forms of register-indexed addressing with
    shifts and rotates are not permitted for loads and stores in
    Thumb, so the address calculation is done using a separate
    instruction for the Thumb case.

The resulting code is unlikely to be optimally scheduled, but it
should not have a large impact given the overall size of the code.
I haven't run any benchmarks.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Tested-by: David McCullough <ucdevel@gmail.com> (ARM only)
Acked-by: David McCullough <ucdevel@gmail.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit 47914eb291abfeb8e1e8e01d11642e29e14b71d0)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

ARM: 7837/3: fix Thumb-2 bug in AES assembler code

Patch 638591c enabled building the AES assembler code in Thumb2 mode.
However, this code used arithmetic involving PC rather than adr{l}
instructions to generate PC-relative references to the lookup tables,
and this needs to take into account the different PC offset when
running in Thumb mode.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit d3794c0a953db3587228d1ef132a8b831e4f5e4c)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

ARM: 7723/1: crypto: sha1-armv4-large.S: fix SP handling

Make the SHA1 asm code ABI conformant by making sure all stack
accesses occur above the stack pointer.

Origin:
http://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=1a9d60d2

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit 0390b076fbcdce7f3620b50b856ad04a3a307a58)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

ARM: add .gitignore entry for aesbs-core.S

This avoids this file being incorrectly added to git.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit 648544d2c9a6f47741fa6883780ee3cc238c5790)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
SQUASH: Bacon interactive gov

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Bacon interactive governor

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

cpufreq: add generic get_cpuidle_time to the cpufreq headers so that we don't need to implement this everytime we need it.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
(cherry picked from commit 7d1f89e750fefe98d5777efea9827f8d4c8e892a)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

cpufreq: create a helper function to get CPU utilization. Picked from @stratosk

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit 8bb7a2dca3b50b8aa45d3434e4660baa257475d4)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

cpufreq: Introduce new relation for freq selection

Introduce CPUFREQ_RELATION_C for frequency selection.
It selects the frequency with the minimum euclidean distance
to target. In case of equal distance between 2 frequencies,
it will select the greater freq.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
(cherry picked from commit 439596fba2789487bbe5787a61fb27fe2713b53d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

things i had to do to get it to work it mpdecision

Signed-off-by: thirdzcee <thirdzcee@gmail.com>
OC up to 1.8ghz

Signed-off-by: thirdzcee <thirdzcee@gmail.com>