msm: mdm: Fix error value for SHUTDOWN_CHARM ioctl

SHUTDOWN_CHARM should write the error value to the parameter
passed, but in this case as no error value is updated.

(cherry picked from commit d1ed37b3fff7e67c933868f6dd263624c8d91e22)

Change-Id: Iad9e4ffb024f888e243723616a28eaf1b8ab1bb0
CRs-Fixed: 424291
Signed-off-by: Taniya Das <tdas@codeaurora.org>
msm: event_timer: Fix potential race condition

There is a possible race condition which could happen in the following
scenario:

Core 0 PC: lock_hrtimer_base

 lock_hrtimer_base
 hrtimer_get_remaining
 get_next_event_time
 msm_pm_idle_prepare
 msm_cpuidle_enter

Core 1 PC: generic_exec_single

 generic_exec_single
 smp_call_function_single
 setup_event_timer
 mdp_update_pm

If core0 idle thread runs before core1 has had the chance to make the
smp_call_function_single, then idle thread could end up spinning on
lock_hrtimer_base() since setup_event_timer adds an event to the event
queue but the smp cross call is the one that initializes the event timer.
So Core0 could spin on lock_hrtimer_base() since CPU1's SMP call won't be
handled as idle thread runs in noirq context.

To prevent this scenario make a change to the code flow to do the queue
operations and the timer operations on the same CPU. Meaning
setup_event_timer will only make an SMP cross call to re-organize the event
queue and reset the event timer all of which will be run on CPU0.

CRs-fixed: 425587
Change-Id: I53fc551d18f350c47e05a94976b56a5fd2e9050b
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
(cherry picked from commit e73869cb18ee79bd0b951fd7effd6565ce7ccfb4)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: acpuclock-krait: Add a debugfs interface

Add a debugfs interface to peek at acpuclock driver state. Also
include support for enabled and disabling CPU and L2 hardware
clock gating, which is sometimes useful when performing clock
measurements.

Change-Id: Ia80b8f0b0ef85280ea93d145a049cdab15d4116e
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>