From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Johan Hovold <johan@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Marc Zyngier <maz@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] clocksource/drivers/nxp-pit: Prevent driver unbind
Date: Wed, 12 Nov 2025 16:20:26 +0100 [thread overview]
Message-ID: <a964500b-3363-456a-bfcc-38ec289cc57f@linaro.org> (raw)
In-Reply-To: <aRRpFWfgz0OYpdWy@hovoldconsulting.com>
On 11/12/25 12:01, Johan Hovold wrote:
> On Wed, Nov 12, 2025 at 11:00:05AM +0100, Daniel Lezcano wrote:
>> On 11/11/25 16:32, Johan Hovold wrote:
>>> The driver does not support unbinding (e.g. as clockevents cannot be
>>> deregistered) so suppress the bind attributes to prevent the driver from
>>> being unbound and rebound after registration (and disabling the timer
>>> when reprobing fails).
>>>
>>> Even if the driver can currently only be built-in, also switch to
>>> builtin_platform_driver() to prevent it from being unloaded should
>>> modular builds ever be enabled.
>>>
>>> Fixes: bee33f22d7c3 ("clocksource/drivers/nxp-pit: Add NXP Automotive s32g2 / s32g3 support")
>>> Signed-off-by: Johan Hovold <johan@kernel.org>
>>> ---
>>> drivers/clocksource/timer-nxp-pit.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/clocksource/timer-nxp-pit.c b/drivers/clocksource/timer-nxp-pit.c
>>> index 2d0a3554b6bf..d1740f18f718 100644
>>> --- a/drivers/clocksource/timer-nxp-pit.c
>>> +++ b/drivers/clocksource/timer-nxp-pit.c
>>> @@ -374,9 +374,10 @@ static struct platform_driver nxp_pit_driver = {
>>> .driver = {
>>> .name = "nxp-pit",
>>> .of_match_table = pit_timer_of_match,
>>> + .suppress_bind_attrs = true,
>>> },
>>> .probe = pit_timer_probe,
>>> };
>>> -module_platform_driver(nxp_pit_driver);
>>> +builtin_platform_driver(nxp_pit_driver);
>>
>> Do not use builtin_platform here. You can add the tristate Kconfig
>> option for this driver, I tested it.
>
> As I just commented on the cover letter, that's not relevant here;
> builtin_platform_driver() only prevents unloading a driver built as a
> module (which is something we want to prevent for these drivers).
I see your point, I agree. That is something we want to prevent for
drivers having a clockevent.
Even if the core framework will prevent the module to be unloaded, we
can consider these changes an additional guard.
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2025-11-12 15:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 15:32 [PATCH 0/3] clocksource/drivers: Prevent clockevent " Johan Hovold
2025-11-11 15:32 ` [PATCH 1/3] clocksource/drivers/arm_arch_timer_mmio: Prevent " Johan Hovold
2025-11-11 15:45 ` Marc Zyngier
2025-11-26 14:40 ` [tip: timers/clocksource] " tip-bot2 for Johan Hovold
2025-11-11 15:32 ` [PATCH 2/3] clocksource/drivers/nxp-pit: " Johan Hovold
2025-11-12 10:00 ` Daniel Lezcano
2025-11-12 11:01 ` Johan Hovold
2025-11-12 15:20 ` Daniel Lezcano [this message]
2025-11-26 14:40 ` [tip: timers/clocksource] " tip-bot2 for Johan Hovold
2025-11-11 15:32 ` [PATCH 3/3] clocksource/drivers/nxp-stm: " Johan Hovold
2025-11-26 14:40 ` [tip: timers/clocksource] " tip-bot2 for Johan Hovold
2025-11-12 9:48 ` [PATCH 0/3] clocksource/drivers: Prevent clockevent " Daniel Lezcano
2025-11-12 11:00 ` Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a964500b-3363-456a-bfcc-38ec289cc57f@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®