defconfig: jb: set NVMAP_PAGE_POOLS, CPA and unset NVMAP_VPR
block: introduce the BFQ-v4 I/O sched for 2.6.38

Add the BFQ-v4 I/O scheduler to 2.6.38.
The general structure is borrowed from CFQ, as much code. A (bfq_)queue is
associated to each task doing I/O on a device, and each time a scheduling
decision has to be taken a queue is selected and it is 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 very low latency.

    - Latency guarantees are preserved also in presence of NCQ.

    - High throughput with flash-based devices, while still preserving
      latency guarantees.

    - Useful features borrowed from CFQ: cooperating-queues merging (with
      some additional optimizations with respect to the original CFQ version),
      static fallback queue for OOM.

    - BFQ supports full hierarchical scheduling, exporting a cgroups
      interface.  Each node has a full scheduler, so each group can
      be assigned its own ioprio and an ioprio_class.

    - If the cgroups interface is used, weights can be explictly assigned,
      otherwise ioprio values are mapped to weights using 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 weights 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>

-patched from:
 26-Jul-2012 16:32
 http://algo.ing.unimo.it/people/paolo/disk_sched/patches/2.6.38-v4/

-bfq-iosched:
     remove second parameter in __blk_run_queue
video: tegra-ics: remove *3dctx*

-reference:
 http://nv-tegra.nvidia.com/gitweb/?p=linux-2.6.git;a=patch;h=377a7a53f0798e35c0a294f72fe25e9166097352
video: tegra: host: Fix error case memory leaks

When a submit fails, the related nvhost_job is not freed. Add an
explicit free. Also, 3D is mapping the save buffer, but it is not
unmapped.

Bug 991972

Change-Id: Ie335adb5e64f54557e76d12dfb6a9a1557781e8d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/106871
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ryan Wong <ryanw@nvidia.com>
Tested-by: Ryan Wong <ryanw@nvidia.com>

-apply to dev.c
video: tegra: host: Do not panic on hardware timeout

nvhost panics if hardware does not respond within 30 seconds. Remove
this behavior, as it causes problems in emulation and simulation.
Panic should be used only to prevent corruption.

Submits are now given a default timeout of 30 seconds. The clients
can still override with their own timeout value.

MPE doesn't provide the number of slots for context save/restore.
This information is needed to be able to use the submit timeout for
MPE.

Bug 982946

Change-Id: I0f54d639df0fb726cc3163b317bf9c90bf56798b
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/100246
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

-apply to dev.c
-carry over MAX_STUCK_CHECK_COUNT of 17
Revert "video: tegra: dc: remove bandwidth efficiency"

This reverts commit 24b28f075ab1ca075055a166b3278baabecabce4.
defconfig: jb: reduce TEGRA_EMC_TO_DDR_CLOCK to 2
video: tegra-ics: dc: allow 6 underflows before reset