-
由 Keqian Zhu 提交于
stable inclusion from stable-5.10.4 commit 276c71eea8c74cb81ffb587f4a7abdcb808c5a1a bugzilla: 46903 -------------------------------- [ Upstream commit 8b7770b8 ] ARM virtual counter supports event stream, it can only trigger an event when the trigger bit (the value of CNTKCTL_EL1.EVNTI) of CNTVCT_EL0 changes, so the actual period of event stream is 2^(cntkctl_evnti + 1). For example, when the trigger bit is 0, then virtual counter trigger an event for every two cycles. While we're at it, rework the way we compute the trigger bit position by making it more obvious that when bits [n:n-1] are both set (with n being the most significant bit), we pick bit (n + 1). Fixes: 037f6377 ("drivers: clocksource: add support for ARM architected timer event stream") Suggested-by: NMarc Zyngier <maz@kernel.org> Signed-off-by: NKeqian Zhu <zhukeqian1@huawei.com> Acked-by: NMarc Zyngier <maz@kernel.org> Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20201204073126.6920-3-zhukeqian1@huawei.comSigned-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
820cf6f0