]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - drivers/clocksource/arm_arch_timer.c
clocksource: arm_arch_timer: rework PPI selection
authorFu Wei <fu.wei@linaro.org>
Wed, 18 Jan 2017 13:25:30 +0000 (21:25 +0800)
committerMark Rutland <mark.rutland@arm.com>
Mon, 10 Apr 2017 13:29:54 +0000 (14:29 +0100)
commit4502b6bb720d7a519c4cea76cf68a2425b481a45
tree6e184182d79ce4882691b30e5c638bde1f100082
parent097cd143dd871bfceacf4ed252b177cf515a1888
clocksource: arm_arch_timer: rework PPI selection

Currently, the arch timer driver uses ARCH_TIMER_PHYS_SECURE_PPI to mean
the driver will use the secure PPI *and* potentially also use the
non-secure PPI. This is somewhat confusing.

For arm64 it never makes sense to use the secure PPI, but we do anyway,
inheriting this behaviour from 32-bit arm. For ACPI, we may not even
have a valid secure PPI, so we need to be able to only request the
non-secure PPI.

To that end, this patch reworks the timer driver so that we can request
the non-secure PPI alone. The PPI selection is split out into a new
function, arch_timer_select_ppi(), and verification of the selected PPI
is shifted out to callers (as DT may select the PPI by other means and
must handle this anyway).

We now consistently use arch_timer_has_nonsecure_ppi() to determine
whether we must manage a non-secure PPI *in addition* to a secure PPI.
When we only have a non-secure PPI, this returns false.

Signed-off-by: Fu Wei <fu.wei@linaro.org>
Tested-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
[Mark: reword commit message]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
drivers/clocksource/arm_arch_timer.c