]> git.ipfire.org Git - thirdparty/linux.git/commit
clocksource/drivers/timer-sp804: Fix read_current_timer() issue when clock source...
authorStephen Eta Zhou <stephen.eta.zhou@gmail.com>
Sun, 25 May 2025 08:43:28 +0000 (16:43 +0800)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 26 Nov 2025 10:24:32 +0000 (11:24 +0100)
commit640594a04f119338019b0aeed70c7301216595b3
tree13c0c34a036ad8557980d7b99f6d6a19177ea9fc
parent576c564ec3bb60e571c705a71907d7c0c039e6c0
clocksource/drivers/timer-sp804: Fix read_current_timer() issue when clock source is not registered

Register a valid read_current_timer() function for the
SP804 timer on ARM32.

On ARM32 platforms, when the SP804 timer is selected as the clocksource,
the driver does not register a valid read_current_timer() function.
As a result, features that rely on this API—such as rdseed—consistently
return incorrect values.

To fix this, a delay_timer structure is registered during the SP804
driver's initialization. The read_current_timer() function is implemented
using the existing sp804_read() logic, and the timer frequency is reused
from the already-initialized clocksource.

Signed-off-by: Stephen Eta Zhou <stephen.eta.zhou@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/20250525-sp804-fix-read_current_timer-v4-1-87a9201fa4ec@gmail.com
drivers/clocksource/timer-sp804.c