scsi_test_unit_ready(9)
π scsi_test_unit_ready (9) β Kernel API Manual π
okay so bestie, welcome to the glow-up of scsi_test_unit_ready, a little function from the kernel API manual, section 9. yes, section 9. that's the kernel-functions section, iykyk. grab a boba, we're doing this β¨
πΈ NAME πΈ
scsi_test_unit_ready β literally just vibes-checking whether the unit is ready or not π«Ά
π SYNOPSIS π
int scsi_test_unit_ready (struct scsi_device *sdev , int timeout , int
retries , struct scsi_sense_hdr *sshdr );
that's the whole signature, no cap. four args, one int back. she's tidy like that π
π¦ ARGUMENTS π¦
sdevβ the scsi device whose state we're changing. like, this is the main character of the operation πtimeoutβ the command timeout. how long we're willing to wait before we're like "ok girl, we get it" β³retriesβ how many times we try again before we officially fail. persistence!! we love to see it π₯sshdrβ an outpout pointer for decoded sense information. (yes it says outpout in the original, we are NOT correcting the king's spelling, we keep it verbatim π) it's the output pointer where the decoded sense info lands π
π DESCRIPTION π
so here's the tea: it returns zero if it's successful, or an error if TUR failed. TUR = Test Unit Ready, in case you were wondering, and no we're not writing it out every time, we're busy π
for removable media, UNIT_ATTENTION sets the ->changed flag. that's it, that's the whole behavior. she's short but she's iconic π
heads up bestie: the "returns zero if successful or an error if TUR failed" thing is literally the contract. don't expect her to do more than that, she's a specialist, not a generalist π
β SEE ALSO β
okay this list is LONG, like a group chat with 40 unread messages, but every single one is here because we do NOT skip entries in this house π«Ά
the kernel file this all lives in is ./drivers/scsi/scsi_lib.c, and here's everybody it wants you to go read next:
__scsi_queue_insert(9)scsi_queue_insert(9)scsi_failures_reset_retries(9)scsi_check_passthrough(9)scsi_execute_cmd(9)scsi_run_queue(9)scsi_result_to_blk_status(9)scsi_rq_err_bytes(9)scsi_io_completion(9)scsi_alloc_sgtables(9)scsi_initialize_rq(9)scsi_alloc_request(9)scsi_dispatch_cmd(9)scsi_get_internal_cmd(9)scsi_put_internal_cmd(9)scsi_device_from_queue(9)scsi_block_requests(9)scsi_unblock_requests(9)scsi_mode_select(9)scsi_mode_sense(9)scsi_device_set_state(9)scsi_evt_emit(9)scsi_evt_thread(9)sdev_evt_send(9)sdev_evt_alloc(9)sdev_evt_send_simple(9)scsi_device_quiesce(9)scsi_device_resume(9)scsi_internal_device_block_nowait(9)scsi_device_block(9)scsi_internal_device_unblock_nowait(9)scsi_internal_device_unblock(9)scsi_block_targets(9)scsi_host_block(9)scsi_kmap_atomic_sg(9)scsi_kunmap_atomic_sg(9)scsi_vpd_lun_id(9)scsi_vpd_lun_serial(9)scsi_vpd_tpg_id(9)scsi_build_sense(9)
forty entries, all accounted for, not one dropped, we ate that π β¨
and that's the page!! π§ quick little sign-off from the fine print at the bottom: this beauty comes from the ./drivers/scsi corner of the world, and it's dated October 2026. bookmark it, cite it, tell your friends ππ
π¦ 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