git: d7eb529adc6f - stable/15 - mlx4: apply upstream changes to convert to timer_setup() Linux KPI
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 19 Sep 2026 14:40:19 UTC
The branch stable/15 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=d7eb529adc6f62088b8206d30fe8ebf1a6790ad1
commit d7eb529adc6f62088b8206d30fe8ebf1a6790ad1
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-09-14 22:39:03 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-09-19 09:34:08 +0000
mlx4: apply upstream changes to convert to timer_setup() Linux KPI
Apply Linux change 55c0fcc3de460 "Convert timers to use timer_setup()"
to get us out of Linux version 4.15 (and earlier) KPIs.
Also apply 41cb08555c416 from_timer -> timer_container_of.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D59679
(cherry picked from commit 272138c279dd1954f3fb88d9e0b2874db74597a3)
---
sys/dev/mlx4/mlx4_core/mlx4_catas.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/sys/dev/mlx4/mlx4_core/mlx4_catas.c b/sys/dev/mlx4/mlx4_core/mlx4_catas.c
index 165b8faa2896..3856147d1b53 100644
--- a/sys/dev/mlx4/mlx4_core/mlx4_catas.c
+++ b/sys/dev/mlx4/mlx4_core/mlx4_catas.c
@@ -226,10 +226,10 @@ static void dump_err_buf(struct mlx4_dev *dev)
i, swab32(readl(priv->catas_err.map + i)));
}
-static void poll_catas(unsigned long dev_ptr)
+static void poll_catas(struct timer_list *t)
{
- struct mlx4_dev *dev = (struct mlx4_dev *) dev_ptr;
- struct mlx4_priv *priv = mlx4_priv(dev);
+ struct mlx4_priv *priv = timer_container_of(priv, t, catas_err.timer);
+ struct mlx4_dev *dev = &priv->dev;
u32 slave_read;
if (mlx4_is_slave(dev)) {
@@ -272,7 +272,7 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev)
phys_addr_t addr;
INIT_LIST_HEAD(&priv->catas_err.list);
- init_timer(&priv->catas_err.timer);
+ timer_setup(&priv->catas_err.timer, poll_catas, 0);
priv->catas_err.map = NULL;
if (!mlx4_is_slave(dev)) {
@@ -288,8 +288,6 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev)
}
}
- priv->catas_err.timer.data = (unsigned long) dev;
- priv->catas_err.timer.function = poll_catas;
priv->catas_err.timer.expires =
round_jiffies(jiffies + MLX4_CATAS_POLL_INTERVAL);
add_timer(&priv->catas_err.timer);