kgsl: re-create simple_laziness sysfs to fool fauxclcok into supporting Simple
mm: remove compressed copy from zram in-memory

Swap subsystem does lazy swap slot free with expecting the page would be
swapped out again so we can avoid unnecessary write.

But the problem in in-memory swap(ex, zram) is that it consumes memory
space until vm_swap_full(ie, used half of all of swap device) condition
meet.  It could be bad if we use multiple swap device, small in-memory
swap and big storage swap or in-memory swap alone.

This patch makes swap subsystem free swap slot as soon as swap-read is
completed and make the swapcache page dirty so the page should be
written out the swap device to reclaim it.  It means we never lose it.

I tested this patch with kernel compile workload.

1. before

   compile time : 9882.42
   zram max wasted space by fragmentation: 13471881 byte
   memory space consumed by zram: 174227456 byte
   the number of slot free notify: 206684

2. after

   compile time : 9653.90
   zram max wasted space by fragmentation: 11805932 byte
   memory space consumed by zram: 154001408 byte
   the number of slot free notify: 426972

[akpm@linux-foundation.org: tweak comment text]
[artem.savkov@gmail.com: fix BUG due to non-swapcache pages in end_swap_bio_read()]
[akpm@linux-foundation.org: invert unlikely() test, augment comment, 80-col cleanup]
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
Cc: Shaohua Li <shli@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Change-Id: I8f11fb7f0391954435002e7f290352f311c907d4

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	mm/page_io.c
mako_hotplug: remove WQ_UNBOUND. If the queued work stays on the CPU that was queued by we will benefit from local caching and get better performance.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: re-add memory barriers. Lack of these was causing some hw_resets.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: decrease input boost freq from max to 1242MHz for a extra bit of battery during prolonged use of the device.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Implement kexec-hardboot

"Allows hard booting (i.e., with a full hardware reboot) to a kernel
previously loaded in memory by kexec.  This works around the problem of
soft-booted kernel hangs due to improper device shutdown and/or
reinitialization."
More info in /arch/arm/Kconfig.

Original author: Mike Kasick <mike@kasick.org>

Vojtech Bocek <vbocek@gmail.com>:
  I've ported it to mako and flo, it is based of my grouper port, which is
  based of Asus TF201 patche ported by Jens Andersen <jens.andersen@gmail.com>

  I've moved atags copying from guest to the host kernel, which means there
  is no need to patch the guest kernel, assuming the --mem-min in kexec call
  is within the first 256MB of System RAM, otherwise it will take a long time
  to load. I've also fixed /proc/atags entry, which would give the kexec-tools
  userspace binary only the first 1024 bytes of atags,
  see arch/arm/kernel/atags.c for more details.

  Other than that, memory-reservation code for the hardboot page and
  some assembler to do the watchdog reset on MSM chip are new for this device.

ayysir <dresadd09691@gmail.com>:
  kexec: use mem_text_write_kernel_word to set reboot_code_buffer args
  in order to avoid protection faults (writes to read-only
  kernel memory) when CONFIG_STRICT_MEMORY_RWX is enabled.

Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Conflicts:
	arch/arm/configs/mako_defconfig
msm: thermal: increase the threshold to 70ºC and decrease the threshold delta to 5ºC after the device is throttled.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
drivers: thermal: add a panic thermal throttle level. Also properly throttle the CPU policies if the CPU is pegged to 100% load for a long time because just by adjusting the limits would throttle the CPUs just by itself unless the frequency dropped by <= throttled frequency.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
drivers: thermal: protect against race conditions. Won't get the policy if the cpu is offline and it won't decrease the current freq if the max is <= throttled freq. Also block any hotplug work during thermal throttling phase.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
drivers: thermal: temporarily remove a piece of code - needs more work that I thought.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
msm: pm: send notification only for SPC and PC

Currently the pm notification is sent for all the low power
modes of each CPU. Generally the subscriber to this notification
expects to be notified for core power collapse. For example
interrupt controller subscribes this notification to save
and restore its context when entering and exit power collapse
respectively. So this is not necessary for shallow power modes
like WFI and Retention.

This change is to send the notification for only standalone
power collapse of each core and idle power collapse of core0.

Change-Id: I39fb6a6bfb47ca49d6ec8df8cad1fd74424140a0
Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>

Conflicts:
	arch/arm/mach-msm/cpuidle.c
drivers: input: ditch the old touch boost implementation. Compared to Ondemand touch boost this had a bit of latency. With the syscalls header we have access to functions to write directly to userspace files, which makes it easier since Google's boostpulse implementation relies on writing 1 to a certain file to boost the frequency on touch. Google relies on a userspace powerHal to do this (Mako and Flo don't touch boost through the PowerHal). In this case we rely solely on the Kernel side, so when theres a touch it writes to boostpulse. This is the touch driver part, next commit is needed to make this work.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: push this governor to Google's latest code which has the boostpulse interface from where we benefit from the previous commit.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Revert "perf/arm: Fix armpmu_map_hw_event()"

This reverts commit 2868acefb331bd3376474118b3cb12dd7be6f00a.
Revert "drivers/char/random.c: fix priming of last_data"

This reverts commit 7a66053ec9b667d2465260b8b11003953216ef45.
Revert "random: prime last_data value per fips requirements"

This reverts commit d1fa5e7261cd5c16c3cc9cf091b87a2a484e562c.
Revert "random: mix in architectural randomness in extract_buf()"

This reverts commit 4a6479e2824a330724e0fd435447cb793b8f80d9.
defconfig: disable Intelli-thermal and enable msm_thermal