Revert qualcomm's contributions on mutex.h

Related commit is 3f2bc4d6eb5.

Change-Id: Ia92b90b44bf92b7e40ec984e428379ee1a6c047b
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+

The open-coded mutex implementation for ARMv6+ cores suffers from a
severe lack of barriers, so in the uncontended case we don't actually
protect any accesses performed during the critical section.

Furthermore, the code is largely a duplication of the ARMv6+ atomic_dec
code but optimised to remove a branch instruction, as the mutex fastpath
was previously inlined. Now that this is executed out-of-line, we can
reuse the atomic access code for the locking (in fact, we use the xchg
code as this produces shorter critical sections).

This patch uses the generic xchg based implementation for mutexes on
ARMv6+, which introduces barriers to the lock/unlock operations and also
has the benefit of removing a fair amount of inline assembly code.

Cc: <stable@vger.kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Reported-by: Shan Kang <kangshan0910@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
ARM: 7495/1: mutex: use generic atomic_dec-based implementation for ARMv6+

Commit a76d7bd96d65 ("ARM: 7467/1: mutex: use generic xchg-based
implementation for ARMv6+") removed the barrier-less, ARM-specific
mutex implementation in favour of the generic xchg-based code.

Since then, a bug was uncovered in the xchg code when running on SMP
platforms, due to interactions between the locking paths and the
MUTEX_SPIN_ON_OWNER code. This was fixed in 0bce9c46bf3b ("mutex: place
lock in contended state after fastpath_lock failure"), however, the
atomic_dec-based mutex algorithm is now marginally more efficient for
ARM (~0.5% improvement in hackbench scores on dual A15).

This patch moves ARMv6+ platforms to the atomic_dec-based mutex code.

Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: decrease go_hispeed_load to 85.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Revert "Revert "suspend: remove disable/enable cpus every time suspend is called (which is called every damn 5 seconds -.-).""

This reverts commit 33dac936dd839354359e2f0002136749d1e0339e.
Revert "drivers: bcmdhd: filter only unicast packets during suspend, hopefully to reduce the wlan_rx wakelock specially during very crowded Wi-Fi networks."

This reverts commit 6076d5a4d5724b6f941a0ca86d62708786cdab84.
mako_hotplug: queue the screen on/off works to a dedicated workqueue instead of pushing them to the global system queue. Also increase the minimum online time of a CPU from 1 second to 2 second.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
load_stats: small optimization to save 2 calls and inline both functions.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
charger: be quiet please.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Gamma: WIP DO NOT MERGE DO NOT MERGE.
Just pushing this here for safety as I wanna come back here soon. This was just used for debugging, its nowhere near anything ready for users to play.

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