__cxl_pci_mbox_send_cmd(9)
π __cxl_pci_mbox_send_cmd(9) β Kernel API Manual, but make it make sense
okay so bestie, grab your iced matcha π because we're diving into the Kernel API Manual and today's main character is __cxl_pci_mbox_send_cmd β aka the function that literally just executes a mailbox command. That's it, that's the vibe. β¨
β¨ NAME β¨
__cxl_pci_mbox_send_cmd β execute a mailbox command π
π SYNOPSIS π
int __cxl_pci_mbox_send_cmd (struct cxl_mailbox *cxl_mbox , struct
cxl_mbox_cmd *mbox_cmd );
like, it takes two pointers and gives you back an int. no cap. π«Ά
π¦ ARGUMENTS π¦
cxl_mboxβ the CXL mailbox context, aka the whole entire setting, the stage, the environment πΈmbox_cmdβ the command you're sending to the memory device. this is the actual message, the ~content~ π
π CONTEXT π
Any context. literally any. Any context. but β and this is the important part, bestie β it expects mbox_mutex to be held. so like, hold the lock or perish π₯ (not literally perish but you know what I mean).
π RETURN π
-ETIMEDOUTβ if a timeout occurred waiting for completion π like it was waiting and waiting and the clock ran out0β on success π slay
β οΈ okay so this is the part people always skip and I cannot let you skip it: the caller should check the return code inmbox_cmdto make sure it succeeded. yes, even if this function returns0. yes, both. check the one insidembox_cmd. iykyk π
π DESCRIPTION π
so this is the generic form of the CXL mailbox send command β meaning it only uses the registers defined by the mailbox capability ID, specifically CXL 2.0 8.2.8.4. iconic spec energy πβ¨
Memory devices, and perhaps other types of CXL devices, may have further information available upon error conditions π like they might have β¨extra teaβ¨ to spill when something goes wrong.
Driver facilities that wish to send mailbox commands should use the wrapper command. not this raw one. use the wrapper. be a wrapper girlie π
aaaand now the lore π§: the CXL spec allows for up to two mailboxes. the intention is:
- the primary mailbox β OS controlled π₯οΈ
- the secondary mailbox β used by system firmware π§
this is so the OS and the firmware can communicate with the device and not need to coordinate with each other β like two besties texting the same group chat without ever planning it π«Ά
and the driver? the driver only uses the primary mailbox. periodt. π
β SEE ALSO β
- Kernel file
./drivers/cxl/pci.c cxlpci(9)
okay that's the whole page, you ate that π go forth and hold your mutex bestie. this was the Kernel API Manual, ./drivers/cxl, October 2026 β mwah, see you in the next manpage πππ¦
π¦ 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