Page MenuHomeFreeBSD

LinuxKPI: Added jiffies64_to_msecs for amdkfd compatibility.
ClosedPublic

Authored by siri_racha.ca on Jul 7 2026, 7:19 AM.
Referenced Files
F174792233: D58075.diff
Tue, Oct 6, 12:46 AM
F174684454: D58075.id186297.diff
Mon, Oct 5, 4:28 AM
Unknown Object (File)
Mon, Oct 5, 1:21 AM
Unknown Object (File)
Sun, Oct 4, 3:38 PM
Unknown Object (File)
Sun, Oct 4, 1:15 PM
Unknown Object (File)
Sun, Oct 4, 4:08 AM
Unknown Object (File)
Sat, Oct 3, 8:59 PM
Unknown Object (File)
Sat, Oct 3, 7:18 PM

Details

Summary

jiffies64_to_msecs is used by kfd_process.c in the amd/amdkfd driver from
Linux kernel 6.12.

Sponsored By: FreeBSD Foundation

Test Plan

Built kernel, and booted with no issues.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

siri_racha.ca edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jul 9 2026, 10:02 PM

Patch does not apply:

$ git arc patch -c D58075
Applying D58075...
 INFO  Base commit is not in local repository; trying to fetch.
Checking patch sys/compat/linuxkpi/common/include/linux/jiffies.h...
error: while searching for:
extern unsigned long jiffies;  /* defined in sys/kern/subr_ticks.S */
#define        jiffies_64              jiffies /* XXX-MJ wrong on 32-bit platforms */
#define        jiffies_to_msecs(x)     ((unsigned int)(((int64_t)(int)(x)) * 1000 / hz))

#define        MAX_JIFFY_OFFSET        ((LONG_MAX >> 1) - 1)


error: patch failed: sys/compat/linuxkpi/common/include/linux/jiffies.h:39
Applying patch sys/compat/linuxkpi/common/include/linux/jiffies.h with 1 reject...
Rejected hunk #1.

 Patch Failed! 
Usage Exception: Unable to apply patch!

It looks like the patch is on top of a version of this file where tabs have been converted to spaces. Can you please re-generate with whitespace unchanged?

Should be updated with the fixed tabs @emaste

This revision now requires review to proceed.Aug 26 2026, 4:15 AM

Let's just hope x * 1000 will never overflow.

This change builds fine too when applied on top of 74c539fd1cefdbc993411274c613434c3f23b4b1

This revision was not accepted when it landed; it landed in state Needs Review.Wed, Sep 9, 8:01 PM
This revision was automatically updated to reflect the committed changes.