summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@kernel.org>2026-03-04 19:49:29 +0100
committerThomas Gleixner <tglx@kernel.org>2026-03-05 17:41:06 +0100
commit53007d526e17d29f0e5b81c07eb594a93bc4d29c (patch)
treed2f8c544a354a60125fea0ebb7ea59c26b19ff34 /tools/perf/scripts/python
parent9d5e25b361b7228b422fd32bd1c327fd7fb919b4 (diff)
clocksource: Update clocksource::freq_khz on registration
Borislav reported a division by zero in the timekeeping code and random hangs with the new coupled clocksource/clockevent functionality. It turned out that the TSC clocksource is not always updating the freq_khz field of the clocksource on registration. The coupled mode conversion calculation requires the frequency and as it's not initialized the resulting factor is zero or a random value. As a consequence this causes a division by zero or random boot hangs. Instead of chasing down all clocksources which fail to update that member, fill it in at registration time where the caller has to supply the frequency anyway. Except for special clocksources like jiffies which never can have coupled mode. To make this more robust put a check into the registration function to validate that the caller supplied a frequency if the coupled mode feature bit is set. If not, emit a warning and clear the feature bit. Fixes: cd38bdb8e696 ("timekeeping: Provide infrastructure for coupled clockevents") Reported-by: Borislav Petkov <bp@alien8.de> Reported-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Tested-by: Borislav Petkov <bp@alien8.de> Tested-by: Nathan Chancellor <nathan@kernel.org> Link: https://patch.msgid.link/87cy1jsa4m.ffs@tglx Closes: https://lore.kernel.org/20260303213027.GA2168957@ax162
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions