From nobody Mon Sep 07 20:32:30 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hdzJz6K2Qz6s0tj for ; Mon, 07 Sep 2026 20:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hdzJt2XJ9z3Psj for ; Mon, 07 Sep 2026 20:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788813150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=isz/yUk4Z2Oz6EetouBtd5Zg2H3ODafVWWTULdg0Kyo=; b=j5yOkqNVS5N8fZXMks7l00+q7DcddRZoDnESieKZGF44pE6wI9ENrUhFznsqpTWJ7DbO43 oVspYUggPWjhdVOvP3lrRi9fsslgIhifj/3EX5LrKs3AEFlmYugTNxCDc4aveNiroRpnOs HxI6i+E+/zJBLWhHcBaSCUW1keQWg7I3EtmpYMDiqJeV7dD3IubdhWeNgIiUdF2VcfNtg0 vXqObif+9dmRtqMzBLMhdrhM/BTe0l8OHDzW45oXM8HrBoq7uu/QgeHxuilV/uVDGykD9H pnhypy4aC5GE6tw/Oc0L8bSLg/YfrVW9/OJ1gTw2zjosT1d0s1u2JngU0Fp+Rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788813150; a=rsa-sha256; cv=none; b=fDv2+LY2lcJDma30J0ekpupwHr1mQHTWsKeZTr/aOvt3cXClH0/zf44NTG92XUJRCElS92 SFgYe4TO+ecs5ZZoAwjudbJviAJv8UK2zKWMZgplWxQLg2+sIW/RnV8RJq6vhQQRqFbMHJ F+3pze1hZx5b0ar8M6rROHHOvpjEMVsl30YKHTx2EhUautF0rhHJxl0h0+VW/xiqQ1QWXL JnUXVKi39Fie9mjgSHEI0gfy6+pMdkpgQMs5HakeBqP1U0SuxSdI75GN3c5PEwBlZl+n7C uqHbiFele1b3vLnEKHVXzVmYLnnxI18l141BLjnZsGitZhde90tt0q6amfOc4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788813150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=isz/yUk4Z2Oz6EetouBtd5Zg2H3ODafVWWTULdg0Kyo=; b=PiZg+cW/WnVLbztI9JgpnSuP8MVsTB6X7GSUmnU8cMkmBGIb1jX8rUv1OumZyzs6VpE7L5 2dz9xMhs+sTjJG+G1brCoRAEAuFCLFoguQj/9+TxigGLGqHPW2Z0SJuo4x2f5eXo9zcmVT Rk4YKl9sk2vxmMqftn0g2A2/lSt8AZLpiEpo3nKLNoRJbsC5Li+fmFOpeHS2rTb9SqxqwW UmvovBEwvD++9ceE+xsH5AZrhoJvxAin861Km5Kk5ySnfjOkLGnRAA/0Sa0SZnAl/HBeFd Su4kIcyhbyedgVy3WAFX2aylU2ZF0jCxTR3JyfySnwOME70tkyv+N8lOjRgM0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hdzJt196MzZkK for ; Mon, 07 Sep 2026 20:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44870 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 07 Sep 2026 20:32:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: 9273fe8ed2ad - main - linuxkpi: Add `hrtimer_setup()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9273fe8ed2addad2179227d444f9f8ab63b942a1 Auto-Submitted: auto-generated Date: Mon, 07 Sep 2026 20:32:30 +0000 Message-Id: <6a9f1f5e.44870.22ea0aa@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=9273fe8ed2addad2179227d444f9f8ab63b942a1 commit 9273fe8ed2addad2179227d444f9f8ab63b942a1 Author: Jean-Sébastien Pédron AuthorDate: 2026-08-15 18:31:05 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-09-07 20:31:39 +0000 linuxkpi: Add `hrtimer_setup()` `hrtimer_setup()` replaces `hrtimer_init()` in Linux 6.15. The API and the role are the same, except: * it takes the `function` callback as argument * if `function` is NULL, it assigns a default callback At the same time, we hide `hrtimer_init()` if LINUXKPI_VERSION is greater than or equal to 61500 because it was dropped in Linux 6.15. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58757 --- sys/compat/linuxkpi/common/include/linux/hrtimer.h | 19 +++++++++++++++++++ sys/compat/linuxkpi/common/src/linux_hrtimer.c | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/hrtimer.h b/sys/compat/linuxkpi/common/include/linux/hrtimer.h index 88f9487d0b85..14977431ade6 100644 --- a/sys/compat/linuxkpi/common/include/linux/hrtimer.h +++ b/sys/compat/linuxkpi/common/include/linux/hrtimer.h @@ -55,11 +55,20 @@ struct hrtimer { #define hrtimer_try_to_cancel(hrtimer) linux_hrtimer_try_to_cancel(hrtimer) #define hrtimer_cancel(hrtimer) linux_hrtimer_cancel(hrtimer) +/* hrtimer_init() is replaced by hrtimer_setup() in Linux 6.15. */ +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION < 61500 #define hrtimer_init(hrtimer, clock, mode) do { \ CTASSERT((clock) == CLOCK_MONOTONIC); \ CTASSERT((mode) == HRTIMER_MODE_REL); \ linux_hrtimer_init(hrtimer); \ } while (0) +#endif + +#define hrtimer_setup(hrtimer, restart, clock, mode) do { \ + CTASSERT((clock) == CLOCK_MONOTONIC); \ + CTASSERT((mode) == HRTIMER_MODE_REL); \ + linuxkpi_hrtimer_setup(hrtimer, restart); \ +} while (0) #define hrtimer_set_expires(hrtimer, time) \ linux_hrtimer_set_expires(hrtimer, time) @@ -81,10 +90,20 @@ struct hrtimer { bool linux_hrtimer_active(struct hrtimer *); int linux_hrtimer_try_to_cancel(struct hrtimer *); int linux_hrtimer_cancel(struct hrtimer *); +/* + * The corresponding `hrtimer_init()` was dropped in Linux 6.15, thus the "#if + * LINUXKPI_VERSION < 61500" above. We keep this prototype here though because + * the underlying `linux_hrtimer_init()` is used by `linuxkpi_hrtimer_setup()`. + */ void linux_hrtimer_init(struct hrtimer *); +void linuxkpi_hrtimer_setup(struct hrtimer *hrtimer, + enum hrtimer_restart (*function)(struct hrtimer *)); void linux_hrtimer_set_expires(struct hrtimer *, ktime_t); void linux_hrtimer_start(struct hrtimer *, ktime_t); void linux_hrtimer_start_range_ns(struct hrtimer *, ktime_t, int64_t); void linux_hrtimer_forward_now(struct hrtimer *, ktime_t); +enum hrtimer_restart linuxkpi_hrtimer_dummy_timeout(struct hrtimer *unused); +#define hrtimer_dummy_timeout(hrtimer) linuxkpi_hrtimer_dummy_timeout(hrtimer) + #endif /* _LINUXKPI_LINUX_HRTIMER_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_hrtimer.c b/sys/compat/linuxkpi/common/src/linux_hrtimer.c index dca5d5cf709b..bbd99dec2d83 100644 --- a/sys/compat/linuxkpi/common/src/linux_hrtimer.c +++ b/sys/compat/linuxkpi/common/src/linux_hrtimer.c @@ -105,6 +105,23 @@ linux_hrtimer_init(struct hrtimer *hrtimer) callout_init_mtx(&hrtimer->callout, &hrtimer->mtx, 0); } +enum hrtimer_restart +linuxkpi_hrtimer_dummy_timeout(struct hrtimer *unused __unused) +{ + return (HRTIMER_NORESTART); +} + +void +linuxkpi_hrtimer_setup(struct hrtimer *hrtimer, + enum hrtimer_restart (*function)(struct hrtimer *)) +{ + linux_hrtimer_init(hrtimer); + if (function != NULL) + hrtimer->function = function; + else + hrtimer->function = linuxkpi_hrtimer_dummy_timeout; +} + void linux_hrtimer_set_expires(struct hrtimer *hrtimer, ktime_t time) {