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
Unknown Object (File)
Fri, Sep 11, 1:36 PM
Unknown Object (File)
Fri, Sep 11, 3:25 AM
Unknown Object (File)
Wed, Sep 9, 7:36 PM
Unknown Object (File)
Wed, Sep 9, 4:58 PM
Unknown Object (File)
Wed, Sep 9, 8:30 AM
Unknown Object (File)
Wed, Sep 9, 12:03 AM
Unknown Object (File)
Tue, Sep 8, 1:50 PM
Unknown Object (File)
Tue, Sep 8, 9:39 AM

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.Wed, Aug 26, 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.