Page MenuHomeFreeBSD

LinuxKPI: pm: add SET_SYSTEM_SLEEP_PM_OPS() and device_can_wakeup()
ClosedPublic

Authored by bz on May 25 2024, 12:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 23, 5:17 PM
Unknown Object (File)
Wed, Oct 23, 5:17 PM
Unknown Object (File)
Wed, Oct 23, 5:17 PM
Unknown Object (File)
Wed, Oct 23, 5:03 PM
Unknown Object (File)
Oct 1 2024, 4:15 PM
Unknown Object (File)
Sep 30 2024, 11:03 AM
Unknown Object (File)
Sep 26 2024, 2:33 PM
Unknown Object (File)
Sep 24 2024, 5:14 PM

Details

Summary

Add the SET_SYSTEM_SLEEP_PM_OPS() by factoring some other macro code
out in order to set the suspend/resume functions when the struct is
already given. Such is the case in iwlwifi d3.

Also add an initial implementation of device_can_wakeup(). Though
this is likely all we need we have no way of setting the flag for it
yet so leave a pr_debug() and a comment there as well. Until we want
to support WoWLAN thi is likely not needed for wireless.

Both help to make an updated iwlwifi d3 compile.

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 57910
Build 54798: arc lint + arc unit

Event Timeline

bz requested review of this revision.May 25 2024, 12:08 AM
sys/compat/linuxkpi/common/include/linux/pm.h
62

This looks odd here but :set list in vi shows tabs.

I was about to commit that but then realized I probably cannot? This is needed. I need to bump priority here.
Otherwise I'll change the return into a false, leave the pr_debug() message (adding the review) and remove the struct field for now?

sys/compat/linuxkpi/common/include/linux/pm.h
52

@imp @manu @wulf ; I know Warner has fixed allocations of these changes in the past to get KBI for older versions back.

Here's the problem: struct dev_pm_info is embedded at the end of struct device so this would only "append at the end". Fine.
BUT struct pci_dev has struct device embedded right at the top so all of struct pci_dev is changed.

HOW do we deal with this? How are we ever supposed to change the size of the structs without breaking (external) kmods?

This revision was not accepted when it landed; it landed in state Needs Review.Jun 7 2024, 11:49 PM
This revision was automatically updated to reflect the committed changes.