handle_ahash_req(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… handle_ahash_req β€” like, the whole manual, but make it make sense

okay bestie, so this is handle_ahash_req(9) from the Kernel API Manual, and honestly? she's doing a lot. let's get into it 🫢


✨ NAME ✨

handle_ahash_req β€” it processes an asynchronous hash request coming in from the crypto API. that's the whole vibe. no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

int handle_ahash_req (struct iproc_reqctx_s *rctx );

like, that's it. that's the signature. iconic.


πŸŽ€ ARGUMENTS πŸŽ€

  • rctx β€” the crypto request context. she's the main character here, the whole context of the request, literally carrying everything πŸ’œ

🌸 DESCRIPTION 🌸

so what actually happens? this function builds a SPU request message that's embedded inside a mailbox message, and then submits that mailbox message on a selected mailbox channel. yes, a message inside a message. it's giving nesting dolls, it's giving iykyk ✨

the SPU request message gets constructed as a scatterlist, and here's the slay part: it includes entries from the crypto API's src scatterlist so we avoid copying the data that needs to be hashed. no unnecessary copying, we're efficient in this house πŸ’…

now, when does this get called? two situations, bestie:

  • either it's called on the thread from the crypto API
  • or β€” and this is the case where the crypto API request is too large to fit in a single SPU request message β€” it's called on the thread that invokes the receive callback with a response message

and because some operations need the response from one chunk before the next chunk can even be submitted, we always wait for the response for the previous chunk before submitting the next chunk. like, we're not gonna rush her. one thing at a time. 🧚

and since requests are submitted in lock step like this, there's no need to synchronize access to request data structures. periodt. no mutex drama, we don't need it πŸ”₯


⭐ RETURN ⭐

  • -EINPROGRESS β€” the request has been submitted to the SPU and the response will come back asynchronously. she's out there, she's working, you'll hear from her πŸ¦‹
  • -EAGAIN β€” a non-final request included a small amount of data, and for efficiency we did not submit it to the SPU, but instead stored it to be submitted to the SPU with the next part of the request. tiny data, saved for later, lowkey smart πŸ™ˆ
  • other β€” an error code. yeah. something went wrong. 😭

πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page, nothing skipped, nothing invented β€” go read the source, bestie, it's right there in the kernel file πŸ’–

and that's a wrap! πŸŽ€ this little page lives in ./drivers/crypto/bcm, dated October 2026, and it went out as handle_ahash_req(9) in the Kernel API Manual. mwah. πŸ’‹

πŸ“¦ where this page comes from