Re: git: c84bfaa25318 - stable/14 - LinuxKPI: timer KPI *_timer -> timer_*

From: Yoshihiro Takahashi <nyan_at_FreeBSD.org>
Date: Sat, 31 Jan 2026 05:19:53 UTC
This broke binary compatibility for the drm module.

kernel: link_elf_obj: symbol del_timer_sync undefined
kernel: linker_load_file: /boot/modules/drm.ko - unsupported file type
kernel: KLD i915kms.ko: depends on drmn - not available or version mismatch
kernel: linker_load_file: /boot/modules/i915kms.ko - unsupported file type

In article <696a9448.c84c.3cbc39d4@gitrepo.freebsd.org>
"Bjoern A. Zeeb" <bz@FreeBSD.org> writes:

> The branch stable/14 has been updated by bz:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=c84bfaa2531870a023fa9b267a765b9518ed3350
> 
> commit c84bfaa2531870a023fa9b267a765b9518ed3350
> Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
> AuthorDate: 2025-09-04 20:24:26 +0000
> Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
> CommitDate: 2026-01-16 19:37:48 +0000
> 
>     LinuxKPI: timer KPI *_timer -> timer_*
>     
>     del_timer() got renamed to timer_delete() approximately in Linux 6.2
>     (similar for *_sync and likely others).
>     Keep the old functions as compat; unclear when we can gc them.
>     We should also re-define them with a linuxkpi_ prefix to avoid possible
>     conflicts in the future if we do a full pass over this at some point.
>     
>     Sponsored by:   The FreeBSD Foundation (intiially)
>     Reviewed by:    dumbbell
>     Differential Revision:  https://reviews.freebsd.org/D52074
>     
>     (cherry picked from commit 5cb64a1d3fe75526fb879ef4dce5860bbb4e4aea)
>     (cherry picked from commit 88198564dbd82a97d655e73459c03eccf7031331)
> ---
>  sys/compat/linuxkpi/common/include/linux/timer.h | 16 ++++++++++++++--
>  sys/compat/linuxkpi/common/src/linux_compat.c    | 11 ++---------
>  2 files changed, 16 insertions(+), 11 deletions(-)
> 
> diff --git a/sys/compat/linuxkpi/common/include/linux/timer.h b/sys/compat/linuxkpi/common/include/linux/timer.h
> index fe0e084cb790..9ab30f3003ac 100644
> --- a/sys/compat/linuxkpi/common/include/linux/timer.h
> +++ b/sys/compat/linuxkpi/common/include/linux/timer.h
> @@ -84,11 +84,23 @@ extern unsigned long linux_timer_hz_mask;
>  extern int mod_timer(struct timer_list *, int);
>  extern void add_timer(struct timer_list *);
>  extern void add_timer_on(struct timer_list *, int cpu);
> -extern int del_timer(struct timer_list *);
> -extern int del_timer_sync(struct timer_list *);
> +
> +extern int timer_delete(struct timer_list *);
>  extern int timer_delete_sync(struct timer_list *);
>  extern int timer_shutdown_sync(struct timer_list *);
>  
> +static inline int
> +del_timer(struct timer_list *tl)
> +{
> +	return (timer_delete(tl));
> +}
> +
> +static inline int
> +del_timer_sync(struct timer_list *tl)
> +{
> +	return (timer_delete_sync(tl));
> +}
> +
>  #define	timer_pending(timer)	callout_pending(&(timer)->callout)
>  #define	round_jiffies(j)	\
>  	((int)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask))
> diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c
> index a2c2d18c8185..e5e3d7929759 100644
> --- a/sys/compat/linuxkpi/common/src/linux_compat.c
> +++ b/sys/compat/linuxkpi/common/src/linux_compat.c
> @@ -2052,7 +2052,7 @@ add_timer_on(struct timer_list *timer, int cpu)
>  }
>  
>  int
> -del_timer(struct timer_list *timer)
> +timer_delete(struct timer_list *timer)
>  {
>  
>  	if (callout_stop(&(timer)->callout) == -1)
> @@ -2061,7 +2061,7 @@ del_timer(struct timer_list *timer)
>  }
>  
>  int
> -del_timer_sync(struct timer_list *timer)
> +timer_delete_sync(struct timer_list *timer)
>  {
>  
>  	if (callout_drain(&(timer)->callout) == -1)
> @@ -2069,13 +2069,6 @@ del_timer_sync(struct timer_list *timer)
>  	return (1);
>  }
>  
> -int
> -timer_delete_sync(struct timer_list *timer)
> -{
> -
> -	return (del_timer_sync(timer));
> -}
> -
>  int
>  timer_shutdown_sync(struct timer_list *timer)
>  {
>