Revert "ARM tegra:  Fix some serious and annoying bugs"

This reverts commit 5f4c7d79ea8863bc9faa6385d68b1c1601f8cab8.
drivers cpufreq:  Fixup governors to run better with tegra devices
drivers: cpufreq: make unlock_policy_rwsem_write/read non static

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Revert "sched: disable GENTLTE_FAIR_SLEEPERS for better performance on Android"

This reverts commit 05f084c5c70c92c03bdf8ca1ae45b63c4fc451f8.
Revert "sched: don't call task_group() many times in set_task_rq()"

This reverts commit 8509caadeeaf9b7e8185d87067519fa59c82efcd.
mach-tegra: tegra_sleep_stats: fix runqueue stats info

Replace tegra_sleep_stats.c with the qualcom original (which it was
derived from anyway) and fix the tick-sched hooks which were not
present at all.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>

Conflicts:

	arch/arm/mach-tegra/tegra_rq_stats.c
	kernel/time/tick-sched.c

Conflicts:

	arch/arm/mach-tegra/tegra_rq_stats.c
	kernel/time/tick-sched.c
mach-tegra: cpu-tegra: fix compiling

squashed 2 commits

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>

Conflicts:
	arch/arm/mach-tegra/cpu-tegra.c
	kernel/sys.c
Revert "sched: Folding nohz load accounting more accurate"

This reverts commit cc4de172dbf9e18060e9ede3f271f1e04b906eb1.
Revert "SCHEDULER: Autogroup patch group by current user android UID instead of task ID"

This reverts commit ae2092a8a78bb89b454b8415b9b97a8168f19560.
mach-tegra: compile tegra_rq_stats.o

squashed 2 commits

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>

Conflicts:
	arch/arm/mach-tegra/Makefile
update defconfig with new changes.  wip!
grouper defconfig:  use XZ kernel compression
New kernel cflags wip!
block: Add Zen I/O scheduler.  Similar to SIO, primarily based on no-op and deadline. Intended to be mostly FCFS. Simpler than SIO in many ways, one of them being write requests/read requests have mostly the same priority.

Conflicts:
	block/Kconfig.iosched
	block/Makefile
Enable CIFS and zen I/O scheduler
drm/i915: Fix misplaced intel_mark_page_flip_active()

In commit 28c4566d30b8, backport of commit e7d841ca03b7 ('drm/i915:
Close race between processing unpin task and queueing the flip') I
somehow added two calls to intel_mark_page_flip_active() from
intel_gen4_queue_flip() and none from intel_gen6_queue_flip().  There
should of course be one from each.

Reported-by: Julien Cristau <jcristau@debian.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sched/rt: Use root_domain of rt_rq not current processor

commit aa7f67304d1a03180f463258aa6f15a8b434e77d upstream.

When the system has multiple domains do_sched_rt_period_timer()
can run on any CPU and may iterate over all rt_rq in
cpu_online_mask.  This means when balance_runtime() is run for a
given rt_rq that rt_rq may be in a different rd than the current
processor.  Thus if we use smp_processor_id() to get rd in
do_balance_runtime() we may borrow runtime from a rt_rq that is
not part of our rd.

This changes do_balance_runtime to get the rd from the passed in
rt_rq ensuring that we borrow runtime only from the correct rd
for the given rt_rq.

This fixes a BUG at kernel/sched/rt.c:687! in __disable_runtime
when we try reclaim runtime lent to other rt_rq but runtime has
been lent to a rt_rq in another rd.

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Mike Galbraith <bitbucket@online.de>
Cc: peterz@infradead.org
Link: http://lkml.kernel.org/r/1358186131-29494-1-git-send-email-sbohrer@rgmadvisors.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Bluetooth: Fix handling of unexpected SMP PDUs

commit 8cf9fa1240229cbdd888236c0c43fcbad680cf00 upstream.

The conn->smp_chan pointer can be NULL if SMP PDUs arrive at unexpected
moments. To avoid NULL pointer dereferences the code should be checking
for this and disconnect if an unexpected SMP PDU arrives. This patch
fixes the issue by adding a check for conn->smp_chan for all other PDUs
except pairing request and security request (which are are the first
PDUs to come to initialize the SMP context).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Revert "Bluetooth: Fix handling of unexpected SMP PDUs"

This reverts commit 93322d7fee4bc923dfede42f78cad115027bfcd3.
nilfs2: fix fix very long mount time issue

commit a9bae189542e71f91e61a4428adf6e5a7dfe8063 upstream.

There exists a situation when GC can work in background alone without
any other filesystem activity during significant time.

The nilfs_clean_segments() method calls nilfs_segctor_construct() that
updates superblocks in the case of NILFS_SC_SUPER_ROOT and
THE_NILFS_DISCONTINUED flags are set.  But when GC is working alone the
nilfs_clean_segments() is called with unset THE_NILFS_DISCONTINUED flag.
As a result, the update of superblocks doesn't occurred all this time
and in the case of SPOR superblocks keep very old values of last super
root placement.

SYMPTOMS:

Trying to mount a NILFS2 volume after SPOR in such environment ends with
very long mounting time (it can achieve about several hours in some
cases).

REPRODUCING PATH:

1. It needs to use external USB HDD, disable automount and doesn't
   make any additional filesystem activity on the NILFS2 volume.

2. Generate temporary file with size about 100 - 500 GB (for example,
   dd if=/dev/zero of=<file_name> bs=1073741824 count=200).  The size of
   file defines duration of GC working.

3. Then it needs to delete file.

4. Start GC manually by means of command "nilfs-clean -p 0".  When you
   start GC by means of such way then, at the end, superblocks is updated
   by once.  So, for simulation of SPOR, it needs to wait sometime (15 -
   40 minutes) and simply switch off USB HDD manually.

5. Switch on USB HDD again and try to mount NILFS2 volume.  As a
   result, NILFS2 volume will mount during very long time.

REPRODUCIBILITY: 100%

FIX:

This patch adds checking that superblocks need to update and set
THE_NILFS_DISCONTINUED flag before nilfs_clean_segments() call.

Reported-by: Sergey Alexandrov <splavgm@gmail.com>
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Tested-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>