spi_controll..._mem_op_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spi_controll..._mem_op_data(9)

okay so first things first, bestie β€” welcome to the Kernel API Manual ✨. This page lives there, and yeah the title got cut off in the display (spi_controll..._mem_op_data(9)), but the actual function is the whole entire DMA-unmap-the-buffer-attached-to-a-memory-operation situation. iykyk πŸŽ€


🌸 NAME 🌸

spi_controller_dma_unmap_mem_op_data β€” literally the thing that DMA-unmaps the buffer attached to a memory operation 🫢


⭐ SYNOPSIS ⭐

void spi_controller_dma_unmap_mem_op_data (struct spi_controller *ctlr ,
const struct spi_mem_op *op , struct sg_table *sgt );

no cap, that's the signature. moving on πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ctlr β€” the SPI controller that's asking for this dma_unmap. it's the one putting in the request, so respect it πŸ‘‘
  • op β€” the memory operation that's holding the buffer you want unmapped. the buffer is in there, inside, embedded πŸŽ€
  • sgt β€” a pointer to an sg_table that was previously initialized by spi_controller_dma_map_mem_op_data. so like,, it has to be one of those ones, not some random sg_table you found lying around 😭

✨ DESCRIPTION ✨

so some controllers might want to do DMA on the data buffer embedded in op. slay for them honestly. this helper sets things up so the CPU can access the op->data.buf.{in,out} buffer again πŸ’… like it's literally giving the CPU its access back.

important bestie: this function is not intended to be called from SPI drivers. only SPI controller drivers should use it. so if you're in SPI driver land, this is not your moment, step away πŸ™ˆ

also, the timing matters fr fr: this function should be called after the DMA operation has finished, and it's only valid if the previous spi_controller_dma_map_mem_op_data call returned 0. if that map call didn't return 0, this whole thing isn't valid β€” do not pass go, do not collect $200 πŸ’€


πŸ’œ RETURN πŸ’œ

0 in case of success, and a negative error code otherwise. that's it, that's the whole vibe check 🌈


🧚 SEE ALSO 🧚

okay this list is long but we're listing every single one because we don't skip, ever ✨


and that's the page, bestie!! πŸ“ this one comes to you from ./drivers/spi, dated October 2026, and it's filed under spi_controll..._mem_op_data(9) in case you need to find it again. go forth and unmap responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from