Re: [PATCH net-next v6 3/4] net: phy: realtek: add PTP clock support for RTL8127a
From: Nicolai Buchwitz
Date: Sat Dec 05 2026 - 06:19:28 EST
Hi Javen
On 4.12.2026 03:11, javen wrote:
[...]
+static int rtl8127a_ptp_adjfine(struct ptp_clock_info *info, long scaled_ppm)
+{
+ struct rtl8127a_ptp *ptp = container_of(info, struct rtl8127a_ptp, info);
+ int pm, ret;
+ u64 diff;
+ u32 rate;
+
+ if (diff_by_scaled_ppm(1ULL << 32, scaled_ppm, &diff))
+ rate = -(u32)diff;
+ else
+ rate = diff;
Looks like my suggestion broke an edge case here, sorry!
scaled_ppm = 32000000 passes the max_adj check but gives 0x200000,
which sets the sign bit. max_adj = 488280 should fix it.
[...]
Thanks
Nicolai