From 9206e82863592f7786ec6c51656f4d778efc4582 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Tue, 18 Nov 2025 16:55:45 -0600 Subject: [PATCH] Add conditional compilation for changes with timer symbols in kernel 6.16 Link: https://git.kernel.org/torvalds/c/41cb08555c416 Signed-off-by: Mario Limonciello --- QDMA/linux-kernel/driver/libqdma/qdma_mbox.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/QDMA/linux-kernel/driver/libqdma/qdma_mbox.c b/QDMA/linux-kernel/driver/libqdma/qdma_mbox.c index 6438c6a21..e647f9c2b 100755 --- a/QDMA/linux-kernel/driver/libqdma/qdma_mbox.c +++ b/QDMA/linux-kernel/driver/libqdma/qdma_mbox.c @@ -308,7 +308,11 @@ static int mbox_rcv_one_msg(struct qdma_mbox *mbox) static inline void mbox_timer_stop(struct qdma_mbox *mbox) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0) del_timer(&mbox->timer); +#else + timer_delete_sync(&mbox->timer); +#endif } static inline void mbox_timer_start(struct qdma_mbox *mbox) @@ -432,7 +436,9 @@ static void mbox_timer_handler(struct timer_list *t) static void mbox_timer_handler(unsigned long arg) #endif { -#if KERNEL_VERSION(4, 15, 0) <= LINUX_VERSION_CODE +#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 16, 0) + struct qdma_mbox *mbox = timer_container_of(mbox, t, timer); +#elif KERNEL_VERSION(4, 15, 0) <= LINUX_VERSION_CODE struct qdma_mbox *mbox = from_timer(mbox, t, timer); #else struct qdma_mbox *mbox = (struct qdma_mbox *)arg;