spi_bus_unlock(9)
π spi_bus_unlock(9) β the Kernel API Manual glow-up
okay bestie, so this is a page from the Kernel API Manual about spi_bus_unlock(9), and honestly? It's a short one but she's iconic in her simplicity. Let's get into it β¨
πΈ NAME πΈ
spi_bus_unlock β release the lock for exclusive SPI bus usage π
Like, you grabbed the aux cord, and now you're giving it back. Manners. We love to see it.
β¨ SYNOPSIS β¨
int spi_bus_unlock (struct spi_controller *ctlr );
That's it. That's the whole vibe. One function, one argument, one int coming back at you π
π«Ά ARGUMENTS π«Ά
ctlrβ the SPI bus controller that was locked for exclusive bus access. yes queen, that one, the same controller you locked before. no switchesies π
π΄ CONTEXT π΄
can sleep
fr fr, this one is allowed to snooze. she's not in a rush, she's not in an interrupt, she's just vibing in a context that's permitted to sleep π€
π DESCRIPTION π
Okay so here's the tea π: this call may only be used from a context that may sleep. That's non-negotiable, bestie β don't try to sneak it into an atomic context, it's giving "read the room".
And just so you know exactly what kind of nap we're talking about: the sleep is non-interruptible, and it has no timeout. Not "sleep until someone pokes you", not "sleep for a bit then give up" β it's the committed, all-in kind of sleep. main character energy ngl π
What this call actually does: it releases an SPI bus lock previously obtained by an spi_bus_lock call. So the lock has to already exist β you're the one undoing it, not creating it π
β οΈ don't call this without having called spi_bus_lock first, okay? that's not a lock release, that's just chaos π
π₯ RETURN π₯
always zero.
always. zero. every single time. no cap. she does not have a failure mode, she does not have opinions, she simply returns 0 and walks away π
β¨
π SEE ALSO π
aaaand here's the whole friend group π«Ά β all from the kernel file ./drivers/spi/spi.c:
__spi_register_driver(9)spi_alloc_device(9)spi_add_device(9)spi_new_device(9)spi_unregister_device(9)spi_register_board_info(9)spi_res_alloc(9)spi_res_free(9)spi_res_add(9)spi_res_release(9)spi_finalize_current_transfer(9)__spi_pump_messages(9)spi_pump_messages(9)spi_take_timestamp_pre(9)spi_take_timestamp_post(9)spi_set_thread_rt(9)spi_get_next_queued_message(9)spi_finalize_current_message(9)spi_queued_transfer(9)spi_flush_queue(9)of_register_spi_devices(9)spi_new_ancillary_device(9)devm_spi_new_ancillary_device(9)acpi_spi_count_resources(9)acpi_spi_device_alloc(9)spi_target_abort(9)__spi_alloc_controller(9)__devm_spi_alloc_controller(9)spi_get_gpio_descs(9)spi_register_controller(9)devm_spi_register_controller(9)spi_unregister_controller(9)spi_replace_transfers(9)spi_split_transfers_maxsize(9)spi_split_transfers_maxwords(9)spi_set_cs_timing(9)spi_setup(9)spi_optimize_message(9)spi_unoptimize_message(9)devm_spi_optimize_message(9)spi_async(9)spi_sync(9)spi_sync_locked(9)spi_bus_lock(9)β the one that started it all πspi_write_then_read(9)
and that's the whole page, bestie!! π§ mwah π
this little icon lives in ./drivers/spi, dated October 2026, and it's filed under spi_bus_unlock(9) β go forth and unlock responsibly, ily ππ
π¦ 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