cxl_decoder_add_locked(9)
π 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β thecxldecoder, and it has to be the one allocated bycxl_<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:
cxl core(9)devm_cxl_add_port(9)devm_cxl_add_dport(9)devm_cxl_add_rch_dport(9)cxl_add_ep(9)find_cxl_port_by_dport(9)find_cxl_port_by_uport(9)cxl_decoder_init(9)cxl_root_decoder_alloc(9)cxl_switch_decoder_alloc(9)cxl_endpoint_decoder_alloc(9)cxl_decoder_add(9)__cxl_driver_register(9)cxl_endpoint_get_perf_coordinates(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms