spi_sync_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spi_sync_locked(9) β€” the kernel API manual, bestie edition

okay so this is a page from the Kernel API Manual (yes, the (9) one, kernel-doc section, we're fancy here) and it's all about spi_sync_locked β€” the version of spi_sync that gets the SPI bus all to itself πŸ”’βœ¨


🌸 NAME 🌸

spi_sync_locked β€” literally the version of spi_sync with exclusive bus usage, no cap πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

int spi_sync_locked (struct spi_device *spi , struct spi_message
*message );

that's the whole signature, she's not complicated πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • spi β€” the device with which data will be exchanged 🫢
  • message β€” describes the data transfers πŸ“¨

πŸ’œ CONTEXT πŸ’œ

cannot sleep? no bestie, the opposite β€” can sleep 😴✨


πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea β˜• β€” this call may only be used from a context that may sleep. And the sleep? It's non-interruptible, and it has no timeout. So like… she's committed. She's not waking up early, she's not checking her phone, she's just in it until it's done 😭

Also, low-overhead controller drivers may DMA directly into and out of the message buffers. iconic behaviour honestly πŸŽ€

This call should be used by drivers that require exclusive access to the SPI bus. It has to be preceded by a spi_bus_lock call β€” like, you literally can't skip that step, it's giving prerequisites, it's giving prerequisites-fr-fr. And when the exclusive access is over, the SPI bus must be released by a spi_bus_unlock call. lock β†’ do the thing β†’ unlock. the trinity 🀝

lowkey a vibe check on your locking discipline: forget the unlock and everyone's stuck. just saying πŸ™ˆ

⭐ RETURN ⭐

zero on success πŸŽ‰ β€” else a negative error code πŸ’€


🌈 SEE ALSO 🌈

okay this list is long but we do not skip, we do not summarise, we list every single one because that's the assignment πŸ’… The Kernel file is ./drivers/spi/spi.c and here's everybody:


and that's the page, bestie 🫢 this one lives under ./drivers/spi, dated October 2026, and it's spi_sync_locked(9) all the way down β€” go lock that bus, slay responsibly, and remember to unlock πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from