Page MenuHomeFreeBSD

LinuxKPI: re-implement pm_runtime.h
Needs ReviewPublic

Authored by bz on Sat, Jul 11, 2:52 PM.

Details

Reviewers
None
Group Reviewers
linuxkpi
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 Passed
Unit
No Test Coverage
Build Status
Buildable 74725
Build 71608: arc lint + arc unit

Event Timeline

bz requested review of this revision.Sat, Jul 11, 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.Sat, Jul 11, 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