ANDROID: clocksource/arm_arch_timer: Add workaround for erratum 858921
ARM64_ERRATUM_858921 is presently broken if an affected
CPU is a secondary CPU. You may find more details here [1].
Till upstream converges to a acceptable solution, this
patch introduces device tree level workaround
"qcom,erratum-858921" for impacted QCOM SoCs.
The downside of course is that workaround gets applied to
non impacted CPUs as well on such systems. This would be
reverted with proper fix, once it is concluded at [1].
1. https://lore.kernel.org/linux-arm-kernel/20230113111648.1977473-1-maz@kernel.org/
Bug: 265374093
Bug: 266273130
Bug: 270014945
Change-Id: I0b17df3d7650787c58dd448455e3a5529bc2a671
Signed-off-by: Srinivasarao Pathipati <quic_spathi@quicinc.com>
(cherry picked from commit 6499c5e952cb9e3271d52273bdb8f306280a6072)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index be6d741..652a647 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -478,6 +478,13 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
.read_cntpct_el0 = arm64_858921_read_cntpct_el0,
.read_cntvct_el0 = arm64_858921_read_cntvct_el0,
},
+ {
+ .match_type = ate_match_dt,
+ .id = "qcom,erratum-858921",
+ .desc = "erratum 858921",
+ .read_cntpct_el0 = arm64_858921_read_cntpct_el0,
+ .read_cntvct_el0 = arm64_858921_read_cntvct_el0,
+ },
#endif
#ifdef CONFIG_SUN50I_ERRATUM_UNKNOWN1
{