spi_bus_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spi_bus_lock(9) β€” the Kernel API Manual glow-up

okay so bestie, welcome to spi_bus_lock β€” the function that says "this SPI bus is mine" and means it. Sit down, we're gonna talk about exclusive access πŸŽ€


✨ NAME ✨

spi_bus_lock β€” obtain a lock for exclusive SPI bus usage. periodt, that's the whole vibe πŸ”₯


🌸 SYNOPSIS 🌸

int spi_bus_lock (struct spi_controller *ctlr );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • ctlr β€” the SPI bus controller that should be locked for exclusive bus access. like, the whole bus. not sharing, not "just for a sec", exclusive πŸ’…

🧚 CONTEXT 🧚

can sleep 😴

that's it, that's the context line. she naps.


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜• β€” this call may only be used from a context that may sleep. the sleep is non-interruptible, and has no timeout. so if you're lying to yourself about what context you're in... bestie, no. 😭

this call should be used by drivers that require exclusive access to the SPI bus. no cap, that's the whole point of her.

the SPI bus must be released by a spi_bus_unlock call when the exclusive access is over β€” do not just walk away and ghost the bus, that's not the move πŸ™ˆ

and while the SPI bus lock is held, data transfer must be done by spi_sync_locked and spi_async_locked calls. like, those two specifically. not the regular ones. iykyk 🌈


⭐ RETURN ⭐

always zero. every time. she is consistent, she is unbothered, she is iconic πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

the full extended universe, fr fr β€” kernel file ./drivers/spi/spi.c plus these legends:


🫢 and that's the page!! this lil gem lives in ./drivers/spi and the version on deck is October 2026 β€” so go forth, lock that bus, unlock it when you're done, and slay πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from