arm: remove the arch_barrier_extra() hook

CONFIG_ARCH_HAS_BARRIERS makes this redundant.

Change-Id: I6c1bb565138ad9651b94bd988d55e5e91c62c281
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
ARM: sched_clock: provide common infrastructure for sched_clock()

Provide common sched_clock() infrastructure for platforms to use to
create a 64-bit ns based sched_clock() implementation from a counter
running at a non-variable clock rate.

This implementation is based upon maintaining an epoch for the counter
and an epoch for the nanosecond time.  When we desire a sched_clock()
time, we calculate the number of counter ticks since the last epoch
update, convert this to nanoseconds and add to the epoch nanoseconds.

We regularly refresh these epochs within the counter wrap interval.
We perform a similar calculation as above, and store the new epochs.

We read and write the epochs in such a way that sched_clock() can easily
(and locklessly) detect when an update is in progress, and repeat the
loading of these constants when they're known not to be stable.  The
one caveat is that sched_clock() is not called in the middle of an
update.  We achieve that by disabling IRQs.

Finally, if the clock rate is known at compile time, the counter to ns
conversion factors can be specified, allowing sched_clock() to be tightly
optimized.  We ensure that these factors are correct by providing an
initialization function which performs a run-time check.

Acked-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Will Deacon <will.deacon@arm.com>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Tested-by: Eric Miao <eric.y.miao@gmail.com>
Tested-by: Olof Johansson <olof@lixom.net>
Tested-by: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: sched_clock: allow init_sched_clock() to be called early

sched_clock is supposed to be initialized early - in the recently added
init_early platform hook.  However, in doing so we end up calling
mod_timer() before the timer lists are initialized, resulting in an
oops.

Split the initialization in two - the part which the platform calls
early which starts things off.  The addition of the timer can be
delayed until after we have more of the kernel initialized - when the
normal time sources are initialized.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
input: mt: Break out slots handling

In preparation for common code to handle a larger set of MT slots
devices, move the slots handling over to a separate file.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
usb: msm: Migrate to clock rate voting

Use the clock api, instead of pm_qos, to vote on the EBI1 rate.

The transformation is as follows:

 pm_qos_add_request() -> clk_get()

 pm_qos_update_request(*, 0) -> clk_disable()

 pm_qos_update_request(*, <nonzero>) -> clk_enable()

 pm_qos_remove_request() -> clk_put()

The rate a driver requests is almost always the same and can be
set with clk_set_rate() after the clk_get() call.

Change-Id: I951647f4b90db8af43620d22e475a6516656788d
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
video: vidc: Migrate to clock rate voting

Use the clock api, instead of pm_qos, to vote on the EBI1 rate.

The transformation is as follows:

 pm_qos_add_request() -> clk_get() and clk_enable()

 pm_qos_update_request(*, *) -> clk_set_rate()

 pm_qos_remove_request() -> clk_disable() and clk_put()

Change-Id: I9ecaa8b0b5026958e034910b44a2ea489d0a149d
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm_fb: Migrate to clock rate voting

Use the clock api, instead of pm_qos, to vote on the EBI1 rate.

The transformation is as follows:

 pm_qos_add_request() -> clk_get()

 pm_qos_update_request(*, 0) -> clk_disable()

 pm_qos_update_request(*, <nonzero>) -> clk_enable()

 pm_qos_remove_request() -> clk_put()

The rate a driver requests is almost always the same and can be
set with clk_set_rate() after the clk_get() call.

Change-Id: Id7f4d1fef62d9ce1e49f88daae1ca56608d3cd7d
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>