Thread (18 messages) 18 messages, 6 authors, 2025-10-30

Re: [PATCH 2/4] clocksource/drivers/arm_arch_timer: Add standalone MMIO driver

From: Marc Zyngier <maz@kernel.org>
Date: 2025-08-14 12:42:40
Also in: linux-acpi, lkml

On Thu, 14 Aug 2025 13:23:26 +0100,
Steven Price [off-list ref] wrote:
No - CLOCKSOURCE_MASK() turns into GENMASK_ULL so a simple truncation to
unsigned long would be ULONG_MAX (all 1s). So an unsigned long cast
should be fine. My suggestion of MIN(, ULONG_MAX) was just to make that
more clear.
Huh. yes, Can't think today. Sorry for the noise.
quoted
quoted
But it also means that the per-cpu timer also gets truncated the same
way, and that has interesting impacts on how often the timer is
reprogrammed.
That question still stand, and I wonder whether we have ugly bugs
lurking on 32bit platforms because of that... I'll try and have a
look.
I don't know whether there are other bugs due to the capping to
ULONG_MAX, but I don't think there's an (additional) bug here, it's
"just" a ugly warning.
It really isn't about the warning, but how we express the maximum
deadline to the core infrastructure. The MMIO driver is the least of
our worries, and the CPU timer is the thing I'm concerned about, as it
uses the same construct.

	M.

-- 
Without deviation from the norm, progress is not possible.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help