Re: [PATCH v2 6/7] clocksource/drivers/exynos_mct: Add module support
From: John Stultz
Date: Tue Apr 15 2025 - 20:49:08 EST
On Tue, Apr 15, 2025 at 9:50 AM Daniel Lezcano
<daniel.lezcano@xxxxxxxxxx> wrote:
> On Wed, Apr 02, 2025 at 04:33:57PM -0700, Will McVicker wrote:
> > From: Donghoon Yu <hoony.yu@xxxxxxxxxxx>
> >
> > On Arm64 platforms the Exynos MCT driver can be built as a module. On
> > boot (and even after boot) the arch_timer is used as the clocksource and
> > tick timer. Once the MCT driver is loaded, it can be used as the wakeup
> > source for the arch_timer.
>
> From a previous thread where there is no answer:
>
> https://lore.kernel.org/all/c1e8abec-680c-451d-b5df-f687291aa413@xxxxxxxxxx/
>
> I don't feel comfortable with changing the clocksource / clockevent drivers to
> a module for the reasons explained in the aforementionned thread.
I wasn't CC'ed on that, but to address a few of your points:
> I have some concerns about this kind of changes:
>
> * the core code may not be prepared for that, so loading / unloading
> the modules with active timers may result into some issues
That's a fair concern, but permanent modules (which are loaded but not
unloaded) shouldn't suffer this issue. I recognize having modules be
fully unloadable is generally cleaner and preferred, but I also see
the benefit of allowing permanent modules to be one-way loaded so a
generic/distro kernel shared between lots of different platforms
doesn't need to be bloated with drivers that aren't used everywhere.
Obviously any single driver doesn't make a huge difference, but all
the small drivers together does add up.
> * it may end up with some interactions with cpuidle at boot time and
> the broadcast timer
Do you have more details as to your concerns here? I know there can be
cases of issues if the built in clockevent drivers are problematic and
the working ones don't load until later, you can have races where if
the system goes into idle before the module loads it could stall out
(there was a recent issue with an older iMac TSC halting in idle and
it not reliably getting disqualified before it got stuck in idle). In
those cases I could imagine folks reasonably arguing for including the
working clock as a built in, but I'm not sure I'd say forcing
everything to be built in is the better approach.
> * the timekeeping may do jump in the past [if and] when switching the
> clocksource
? It shouldn't. We've had tests in kselftest that switch between
clocksources checking for inconsistencies for awhile, so if such a
jump occurred it would be considered a bug.
> * the GKI approach is to have an update for the 'mainline' kernel and
> let the different SoC vendors deal with their drivers. I'm afraid this
> will prevent driver fixes to be carry on upstream because they will stay
> in the OoT kernels
I'm not sure I understand this point? Could you expand on it a bit?
While I very much can understand concerns and potential downsides of
the GKI approach, I'm not sure how that applies to the submission
here, as the benefit would apply to classic distro kernels as much as
GKI.
I realize in the time since I started this reply, Will has already
covered much of the above! So apologies for being redundant. That
said, there are some non-modularization changes in this series that
should be considered even if the modularization logic is a continued
sticking point.
-john