spi_controll..._mem_op_data(9)
π 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 thisdma_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 ansg_tablethat was previously initialized byspi_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 β¨
- Kernel file
./drivers/spi/spi-mem.c spi_controller_dma_map_mem_op_data(9)spi_mem_supports_op(9)spi_mem_exec_op(9)spi_mem_get_name(9)spi_mem_set_dqs(9)spi_mem_has_dqs(9)spi_mem_adjust_op_size(9)spi_mem_adjust_op_freq(9)spi_mem_calc_op_duration(9)spi_mem_dirmap_create(9)spi_mem_dirmap_destroy(9)devm_spi_mem_dirmap_create(9)devm_spi_mem_dirmap_destroy(9)spi_mem_dirmap_read(9)spi_mem_dirmap_write(9)spi_mem_poll_status(9)spi_mem_driver_register_with_owner(9)spi_mem_driver_unregister(9)
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
- 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