STRUCT DEV_PM_DOMAIN(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct dev_pm_domain(9) β€” aka the kernel API manual, but make it make sense πŸŽ€

okay bestie, so this one's from the kernel API manual and it's literally all about struct dev_pm_domain β€” the power management domain representation. yes, that's a whole thing and yes, you're gonna get it. sit down, hydrate, let's go ✨


🌸 NAME 🌸

struct dev_pm_domain β€” power management domain representation. that's it, that's the vibe. it's a struct that represents a PM domain. periodt πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

like, this is the shape of it, no cap. copy it exactly how it is, don't freestyle:

struct dev_pm_domain {
    struct dev_pm_ops       ops;
    int (*start)(struct device *dev);
    void (*detach)(struct device *dev, bool power_off);
    int (*activate)(struct device *dev);
    void (*sync)(struct device *dev);
    void (*dismiss)(struct device *dev);
    int (*set_performance_state)(struct device *dev, unsigned int state);
};

look at all those function pointers. she's got range πŸ‘‘


✨ Members ✨

okay so here's the cast of characters, and honestly each one is a main character in their own right:

  • ops β€” the power management operations tied to this domain. the whole ops situation. it's giving struct dev_pm_ops energy, iykyk 🫢
  • start β€” gets called when a user needs to start the device via the domain. like, the user wants the device going, and the domain handles the starting. iconic.
  • detach β€” called when you're removing a device from the domain. bye bestie πŸ‘‹ it takes struct device *dev and a bool power_off, so it knows which device and whether to power it off.
  • activate β€” this one fires before the probe routines run for bus types and drivers. so it's the pre-game. the warm-up. the hype moment before the actual probe πŸŽ€
  • sync β€” called after a successful driver probe. so the probe said slay and then sync shows up to align everything. πŸ’–
  • dismiss β€” called after an unsuccessful driver probe, and also after driver removal. so when things don't work out, or when the driver leaves, dismiss is there. 😭 nothing but respect for her.
  • set_performance_state β€” called to request a new performance state. signature is int (*set_performance_state)(struct device *dev, unsigned int state); β€” you pass the device and the unsigned int state you want. very much a "make it faster/slower please" request πŸ”₯

🌈 Description 🌈

so here's the tea: power domains hand you callbacks that get executed during system suspend, hibernation, system resume, and during runtime PM transitions β€” and they run instead of the subsystem-level and driver-level callbacks. not alongside. instead. that's the whole point, and it's honestly kind of a serve πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

go look at these if you want the full lore:

  • the kernel file ./include/linux/pm.h
  • struct dev_pm_ops(9)

⚠️ friendly reminder bestie: keep every name, path and signature exactly as written β€” no renaming, no "improving", no vibes-based refactoring. the kernel does not accept your creative choices πŸ™ˆ

and that's the page! πŸ’œ source-wise it lives under ./include/linux, dated October 2026, and it's the struct dev_pm_domain(9) page. mwah, go forth and manage those power domains πŸ§šβ€β™€οΈβ­πŸ“

πŸ“¦ where this page comes from