spi_flush_queue(9)
π
spi_flush_queue β the "okay bestie, everybody out of the queue" function
So this is a page from the Kernel API Manual (the (9) section, aka the kernel-internals girlies). Sit down, hydrate, and let's talk about flushing a queue. π«Ά
β¨ NAME β¨
spi_flush_queue β send all pending messages in the queue, from the caller's own context. Yes, your context. You're the one doing it. Main character energy fr. π
πΈ SYNOPSIS πΈ
void spi_flush_queue (struct spi_controller *ctlr );
Note the void β this diva returns literally nothing. No errors, no status code, no little treat for you at the end. It just does the thing. π
π ARGUMENTS π
ctlrβ the controller you want to process the queue for. That's it, that's the whole argument list. One (1) pointer, iconic.
π DESCRIPTION π
Okay so picture this: you've got pending messages just chilling in the queue, waiting their turn, and you need them actually sent before you move on to the next thing. That's the moment you call spi_flush_queue. Use it whenever you want to make sure all those pending messages have gone out before you do something else. No cap. β¨
The spi-mem code is obsessed with this one β it uses it to make sure SPI memory operations don't preempt the regular SPI transfers that got queued up before the spi-mem operation. Basically it's the "excuse me, the line starts back there" of the SPI subsystem. π§
π SEE ALSO π
All of these live in the kernel file ./drivers/spi/spi.c, and honestly it's giving full cinematic universe. π Go read them, they're all right here, nothing skipped, nothing dropped:
__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)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)spi_bus_unlock(9)spi_write_then_read(9)
Bestie heads-up: the original page really does point you at./drivers/spi/spi.cas the kernel file for this whole friend group, and it lists./drivers/spias the source. That's the lore. π
Okay that's the whole page, mwah. π This lil' number comes to you straight out of ./drivers/spi, dated October 2026 β so like, future-dated and still relevant, we love a timeless queen. Stay flushed, stay queued, see you in the next (9) page! π¦π
π¦ 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