cxl_decoder_add_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cxl_decoder_add_locked(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so real talk, this is a page from the Kernel API Manual (cxl_decoder_add_locked(9), yes that's the manual name, we're being official today ✨) and it's about adding a decoder with targets. let's get into it πŸ¦‹


✨ NAME ✨

cxl_decoder_add_locked β€” literally just add a decoder with targets, that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

int cxl_decoder_add_locked (struct cxl_decoder *cxld );

πŸŽ€ ARGUMENTS πŸŽ€

  • cxld β€” the cxl decoder, and it has to be the one allocated by cxl_<type>_decoder_alloc. no substitutions, no "i found this one lying around" energy, okay? πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

so like… certain types of decoders might not have any targets at all. wild, i know. the main example is an endpoint device β€” iconic, zero targets, thriving πŸ’€

and then there's the more awkward example: a hostbridge whose root ports get hot added. technically possible, though unlikely. ngl it's giving "we don't talk about that one" 😭

also pls note: this is the locked variant of cxl_decoder_add. that's the whole personality trait. πŸ”₯


🧚 CONTEXT 🧚

process context, bestie. and it expects the device lock of the port that owns the cxld to be held β€” like, the lock is non-negotiable, hold it fr fr πŸ”’


⭐ RETURN ⭐

  • negative error code if the decoder wasn't properly configured 😭 (a fail, a flop, we don't love that)
  • else returns 0 β€” slay, success, we ate πŸ‘‘

🌈 SEE ALSO 🌈

kernel file ./drivers/cxl/core/port.c, plus the whole friend group:

iykyk 🫢


k that's the page!! shoutout to ./drivers/cxl/core for hosting this whole situation, October 2026 edition β€” dated and slaying, mwah πŸ’œπŸ§šβ€β™€οΈβœ¨
πŸ“¦ where this page comes from