hl_fw_send_cpu_message(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’Œ hl_fw_send_cpu_message(9) β€” or, how to slide into your device CPU's DMs

okay so bestie, welcome to the Kernel API Manual ✨ this one's a kernel function, hl_fw_send_cpu_message, and its whole personality is: send a CPU message to the device. that's it. that's the vibe. let's get into it 🫢


✨ SYNOPSIS ✨

int hl_fw_send_cpu_message (struct hl_device *hdev , u32 hw_queue_id ,
u32 *msg , u16 size , u32 timeout_us , u64 *result );

like, look at her. six params, one int return, zero notes. iconic behavior fr fr πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • hdev β€” pointer to hl_device structure. literally the device, the whole main character πŸ‘‘
  • hw_queue_id β€” the HW queue ID πŸ¦‹ (yes she has a queue number, respect it)
  • msg β€” raw data of the message/packet. no makeup, no filter, just raw bytes πŸ’€
  • size β€” size of msg in bytes. it's a u16, keep it cute πŸŽ€
  • timeout_us β€” timeout in usec to wait for CPU reply on the message. the "how long do I sit by my phone waiting for a text back" window ⏳
  • result β€” return code reported by FW. the receipts, basically 🧾

🌸 DESCRIPTION 🌸

send message to the device CPU. that's literally the entire description, she's a woman of few words and honestly? obsessed 🎯 no cap, that's the whole functionality β€” you're passing a message to the device CPU, that's the assignment.


πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” slay πŸ’–
  • non-zero for failure β€” and here's the specific breakdown, iykyk:
    • -ENOMEM β€” memory allocation failure 😭 the malloc said no
    • -EAGAIN β€” CPU is disabled (try again when enabled) πŸ™ˆ she's not taking calls rn, try later
    • -ETIMEDOUT β€” timeout waiting for FW response ⏰ left on read, tragic
    • -EIO β€” protocol error πŸ’€ something got miscommunicated in the group chat
ngl, that -EAGAIN one is important β€” it's not a dead end, it's a "not right now." try again when the CPU is enabled, bestie 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/accel/habanalabs/common/firmware_if.c β€” that's where she lives 🏠

and the whole friend group, in order:

hl_fw_version_cmp(9), extract_u32_until_given_char(9), hl_get_sw_major_minor_subminor(9), hl_get_preboot_major_minor(9), hl_release_firmware(9), hl_fw_copy_fw_to_device(9), hl_fw_copy_msg_to_device(9), hl_fw_load_fw_to_device(9), hl_fw_preboot_update_state(9), hl_fw_dynamic_report_error_status(9), hl_fw_dynamic_send_cmd(9), hl_fw_dynamic_extract_fw_response(9), hl_fw_dynamic_wait_for_status(9), hl_fw_dynamic_send_clear_cmd(9), hl_fw_dynamic_send_protocol_cmd(9), hl_fw_compat_crc32(9), hl_fw_dynamic_validate_memory_bound(9), hl_fw_dynamic_validate_descriptor(9), hl_fw_dynamic_read_and_validate_descriptor(9), hl_fw_dynamic_request_descriptor(9), hl_fw_dynamic_read_device_fw_version(9), hl_fw_dynamic_copy_image(9), hl_fw_dynamic_copy_msg(9), hl_fw_boot_fit_update_state(9), hl_fw_dynamic_load_image(9), hl_fw_linux_update_state(9), hl_fw_dynamic_send_msg(9), hl_fw_dynamic_init_cpu(9), hl_fw_static_init_cpu(9), hl_fw_init_cpu(9)

like. that's the whole squad. go read them too, they're all eating πŸ”₯


and that's the page, bestie!! source path is ./drivers/accel/habanalabs/common, and this lil icon was dated October 2026 β€” so go forth, send your CPU message, and remember: 0 means success, and success means slay πŸŒˆβœ¨πŸ’œ

πŸ“¦ where this page comes from