clocksource/arm_arch_timer: Improve Allwinner A64 timer workaround
authorSamuel Holland <samuel@sholland.org>
Sat, 15 May 2021 02:14:39 +0000 (21:14 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:59 +0000 (09:44 +0200)
commit5a5ebf5d48229b4d227dae8b5eeef996bfce20b6
tree24dd76035c145838b4992244f55590907d7b3dab
parentb5e26be407e642dc0ff00fd09387c48d36725a0a
clocksource/arm_arch_timer: Improve Allwinner A64 timer workaround

commit 8b33dfe0ba1c84c1aab2456590b38195837f1e6e upstream.

Bad counter reads are experienced sometimes when bit 10 or greater rolls
over. Originally, testing showed that at least 10 lower bits would be
set to the same value during these bad reads. However, some users still
reported time skips.

Wider testing revealed that on some chips, occasionally only the lowest
9 bits would read as the anomalous value. During these reads (which
still happen only when bit 10), bit 9 would read as the correct value.

Reduce the mask by one bit to cover these cases as well.

Cc: stable@vger.kernel.org
Fixes: c950ca8c35ee ("clocksource/drivers/arch_timer: Workaround for Allwinner A64 timer instability")
Reported-by: Roman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210515021439.55316-1-samuel@sholland.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clocksource/arm_arch_timer.c