__fw_devlink_relax_cycles(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, buckle up, because this one is genuinely the peacemaker of the device-link world 🌈


✨ NAME ✨

__fw_devlink_relax_cycles β€” relax and mark dependency cycles. that's it, that's the whole vibe check πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

bool __fw_devlink_relax_cycles (struct fwnode_handle *con_handle ,
struct fwnode_handle *sup_handle );

πŸ’– ARGUMENTS πŸ’–

  • con_handle β€” the potential consumer device's fwnode πŸ‘€ like, who's maybe gonna be depending on someone.
  • sup_handle β€” the potential supplier's fwnode 🫢 the one who might be getting depended on.

🌸 DESCRIPTION 🌸

okay so first things first, biggest rule ever: this function needs to be called with fwnode_lock and device link lock held πŸ”’πŸ”’ no cap, both of them, or it's not gonna go well for you.

So what it does: it checks whether sup_handle, or literally any of its ancestors or its suppliers (directly or indirectly), depends on con. And the way it works, it can detect multiple cycles between sup_handle and con β€” not just one, she's thorough πŸ’…

When it finds those dependency cycles, it converts all device links created solely by fw_devlink into SYNC_STATE_ONLY device links. And it also marks all the fwnode links in the cycle with FWLINK_FLAG_CYCLE, so that when they get converted into a device link later on in the future, they get created as SYNC_STATE_ONLY device links too. iconic forward planning, honestly πŸ‘‘

Like, think of it as the equivalent of doing fw_devlink=permissive but just between the devices in the cycle. And the reason we have to do this? At this point, fw_devlink literally can't tell which of these dependencies is a real dependency versus which one's just lying 😭 so she relaxes her grip on the whole friend group instead of picking sides.

  • Returns true if one or more cycles were found πŸ”₯
  • Otherwise, returns false πŸŒ™

⭐ RETURN VALUE ⭐

(yes this is folded into the description above, but to recap, bestie:) true = cycles found, false = no cycles found. periodt.


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file: ./drivers/base/core.c β€” and the whole extended friend group, everyone gets a shoutout 🫢


lowkey a whole group chat in here, but every single one of them said hi πŸ’œ

and that's the page, bestie!! 🌸 this lil beauty lives in ./drivers/base, it's stamped October 2026, and it's serving Kernel API Manual energy all the way through πŸŽ€πŸ’– slay, go hold those locks. πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from