Page MenuHomeFreeBSD

LinuxKPI: re-implement pm_runtime.h
ClosedPublic

Authored by bz on Jul 11 2026, 2:52 PM.
Referenced Files
Unknown Object (File)
Sun, Oct 11, 6:17 AM
Unknown Object (File)
Sat, Oct 3, 9:09 PM
Unknown Object (File)
Sat, Oct 3, 9:09 PM
Unknown Object (File)
Thu, Oct 1, 8:25 AM
Unknown Object (File)
Tue, Sep 29, 1:13 PM
Unknown Object (File)
Sun, Sep 27, 11:01 PM
Unknown Object (File)
Sep 12 2026, 9:00 AM
Unknown Object (File)
Sep 9 2026, 3:01 AM

Details

Summary

The original implementation was based on OpenBSD under public domain
but just defined the functions to void.
FreeBSD later extended the file with more inline functions or dealing
with differences in Linux versions.

This rework tries to group some functions, adds properly typed arguments
and return values in some cases.
It further adjusts return values based on the !CONFIG_PM expectiations.

Lastly pr_debug() calls are added so we could see if/how much these
functions are used in new/other works rather than code just compiling
but the functions entirely being ignored without the knowledge of the
person porting code.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

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

Event Timeline

bz requested review of this revision.Jul 11 2026, 2:52 PM
WARNING: this does change some return values; we should review those cases; it was unclear how previous ones were always chosen.

I am currently trying to compile as many drm-kmod branches on main as I can to make sure this does not break any.

bz planned changes to this revision.Jul 11 2026, 6:08 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/pm_runtime.h
125

Something went wrong here. Duplicate pm_runtime_put but with an int.

Remove duplicate pm_runtime_put().

The duplicate was suppoed to be a pm_runtime_resume(); re-add.

Modulo LINT and LKPI_PAGE changes for older branches: master, 6.12-lts, 6.6-lts and 6.1-lts seemed fine

Ah found another one which seems ready for review @dumbbell @emaste

Anyone on this fairly simple review?

I’m sorry for the delay to accept the patch. Again, I’m fairly sure I already reviewed it, but apparently don’t know how to click on buttons…

This revision is now accepted and ready to land.Wed, Sep 30, 12:06 PM
This revision was automatically updated to reflect the committed changes.