commit:     dd598a156a3398299767e276b40f57319a1cb73f
Author:     Evgeny Grin (Karlson2k) <k2k <AT> drgrin <DOT> dev>
AuthorDate: Wed Sep 24 18:21:11 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct  5 23:24:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd598a15

net-misc/r8125: Fix PTP with kernel >=6.16

Closes: https://bugs.gentoo.org/963364
Signed-off-by: Evgeny Grin (Karlson2k) <k2k <AT> drgrin.dev>
Part-of: https://github.com/gentoo/gentoo/pull/43929
Closes: https://github.com/gentoo/gentoo/pull/43929
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/r8125-9.016.00-ptp-linux-6.16.patch      | 30 ++++++++++++++++++++++
 net-misc/r8125/r8125-9.016.00.ebuild               |  1 +
 net-misc/r8125/r8125-9.016.01.ebuild               |  1 +
 3 files changed, 32 insertions(+)

diff --git a/net-misc/r8125/files/r8125-9.016.00-ptp-linux-6.16.patch 
b/net-misc/r8125/files/r8125-9.016.00-ptp-linux-6.16.patch
new file mode 100644
index 000000000000..b8bfd4a645ff
--- /dev/null
+++ b/net-misc/r8125/files/r8125-9.016.00-ptp-linux-6.16.patch
@@ -0,0 +1,30 @@
+From 2f8c3c336aba02cfd8a0ebf2c4f348d6196906c2 Mon Sep 17 00:00:00 2001
+From: "Evgeny Grin (Karlson2k)" <[email protected]>
+Date: Wed, 24 Sep 2025 20:02:20 +0200
+Subject: [PATCH] Fix build with PTP with kernels >=6.16
+
+---
+ src/r8125_ptp.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/r8125_ptp.c b/src/r8125_ptp.c
+index 457fa6d..41cc2a2 100644
+--- a/src/r8125_ptp.c
++++ b/src/r8125_ptp.c
+@@ -1213,8 +1213,13 @@ void rtl8125_ptp_init(struct rtl8125_private *tp)
+         switch (tp->HwSuppPtpVer) {
+         case 3:
+                 tp->pps_enable = 0;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,13,0)
++                hrtimer_setup(&tp->pps_timer, rtl8125_phy_hrtimer_for_pps, 
CLOCK_MONOTONIC,
++                              HRTIMER_MODE_REL);
++#else
+                 hrtimer_init(&tp->pps_timer, CLOCK_MONOTONIC, 
HRTIMER_MODE_REL);
+                 tp->pps_timer.function = rtl8125_phy_hrtimer_for_pps;
++#endif
+                 break;
+         default:
+                 break;
+-- 
+2.49.1
+

diff --git a/net-misc/r8125/r8125-9.016.00.ebuild 
b/net-misc/r8125/r8125-9.016.00.ebuild
index e8215e86d218..4e176def0eb4 100644
--- a/net-misc/r8125/r8125-9.016.00.ebuild
+++ b/net-misc/r8125/r8125-9.016.00.ebuild
@@ -18,6 +18,7 @@ IUSE="down-speed-100 fiber hw-acceleration hw-optim-tx +eee 
+giga-lite +multi-tx
 
 PATCHES=(
        "${FILESDIR}/${P}-fix-build-with-firmware.patch"
+       "${FILESDIR}/${P}-ptp-linux-6.16.patch" # Gentoo bug 963364
 )
 
 CONFIG_CHECK="~!R8169"

diff --git a/net-misc/r8125/r8125-9.016.01.ebuild 
b/net-misc/r8125/r8125-9.016.01.ebuild
index cb73bf3b96a9..440a8e79fb8f 100644
--- a/net-misc/r8125/r8125-9.016.01.ebuild
+++ b/net-misc/r8125/r8125-9.016.01.ebuild
@@ -18,6 +18,7 @@ IUSE="dash down-speed-100 fiber hw-acceleration hw-optim-tx 
+eee +giga-lite +mul
 
 PATCHES=(
        "${FILESDIR}/${PN}-9.016.00-fix-build-with-firmware.patch"
+       "${FILESDIR}/${PN}-9.016.00-ptp-linux-6.16.patch" # Gentoo bug 963364
 )
 
 CONFIG_CHECK="~!R8169"

Reply via email to